Skip to content

Instantly share code, notes, and snippets.

@jstorimer
Created March 31, 2012 01:44
Show Gist options
  • Save jstorimer/2258556 to your computer and use it in GitHub Desktop.
Save jstorimer/2258556 to your computer and use it in GitHub Desktop.
>> IO.for_fd(3)
ArgumentError: The given fd is not accessible because RubyVM reserves it
from (irb):23:in `for_fd'
from (irb):23
from /Users/jessestorimer/.rbenv/versions/1.9.3-p0-perf/bin/irb:12:in `<main>'
>> IO.for_fd(4)
ArgumentError: The given fd is not accessible because RubyVM reserves it
from (irb):24:in `for_fd'
from (irb):24
from /Users/jessestorimer/.rbenv/versions/1.9.3-p0-perf/bin/irb:12:in `<main>'
@wisq
Copy link

wisq commented Mar 31, 2012

Pipes, apparently. Although those may just be placeholders in order to reserve the FDs.

irb     6630 wisq    0u   CHR  136,1      0t0       4 /dev/pts/1
irb     6630 wisq    1u   CHR  136,1      0t0       4 /dev/pts/1
irb     6630 wisq    2u   CHR  136,1      0t0       4 /dev/pts/1
irb     6630 wisq    3r  FIFO    0,8      0t0   12037 pipe
irb     6630 wisq    4w  FIFO    0,8      0t0   12037 pipe

@jstorimer
Copy link
Author

jstorimer commented Apr 3, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment