U:RDoc::NormalModule[iI" Fcntl:ET@0o:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"JFcntl loads the constants defined in the system's C header ;TI"Jfile, and used with both the fcntl(2) and open(2) POSIX system calls.;To:RDoc::Markup::BlankLineo; ;[I"4To perform a fcntl(2) operation, use IO::fcntl.;T@o; ;[I"6To perform an open(2) operation, use IO::sysopen.;T@o; ;[I"IThe set of operations and constants available depends upon specific ;TI"Noperating system. Some values listed below may not be supported on your ;TI" system.;T@o; ;[I"5See your fcntl(2) man page for complete details.;T@o; ;[I"KOpen /tmp/tempfile as a write-only file that is created if it doesn't ;TI" exist:;T@o:RDoc::Markup::Verbatim;[ I"require 'fcntl' ;TI" ;TI"&fd = IO.sysopen('/tmp/tempfile', ;TI"G Fcntl::O_WRONLY | Fcntl::O_EXCL | Fcntl::O_CREAT) ;TI"f = IO.open(fd) ;TI"f.syswrite("TEMP DATA") ;TI" f.close ;T: @format0o; ;[I"Get the flags on file +s+:;T@o; ;[I"$m = s.fcntl(Fcntl::F_GETFL, 0) ;T; 0o; ;[I"OSet the non-blocking flag on +f+ in addition to the existing flags in +m+.;T@o; ;[I"1f.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK|m);T; 0: @fileI"ext/fcntl/fcntl.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[[U:RDoc::Constant[iI" F_DUPFD;TI"Fcntl::F_DUPFD;T00o;;[ o; ;[I" F_DUPFD;T@o; ;[I"GDuplicate a file descriptor to the mimimum unused file descriptor ;TI"+greater than or equal to the argument.;T@o; ;[I"FThe close-on-exec flag of the duplicated file descriptor is set. ;TI"F(Ruby uses F_DUPFD_CLOEXEC internally if available to avoid race ;TI"Fcondition. F_SETFD is used if F_DUPFD_CLOEXEC is not available.);T; @8;0@8@cRDoc::NormalModule0U;[iI" F_GETFD;TI"Fcntl::F_GETFD;T00o;;[o; ;[I" F_GETFD;T@o; ;[I"6Read the close-on-exec flag of a file descriptor.;T; @8;0@8@@M0U;[iI" F_GETLK;TI"Fcntl::F_GETLK;T00o;;[o; ;[I" F_GETLK;T@o; ;[I"MDetermine whether a given region of a file is locked. This uses one of ;TI"the F_*LK flags.;T; @8;0@8@@M0U;[iI" F_SETFD;TI"Fcntl::F_SETFD;T00o;;[o; ;[I" F_SETFD;T@o; ;[I"5Set the close-on-exec flag of a file descriptor.;T; @8;0@8@@M0U;[iI" F_GETFL;TI"Fcntl::F_GETFL;T00o;;[o; ;[I" F_GETFL;T@o; ;[I"IGet the file descriptor flags. This will be one or more of the O_* ;TI" flags.;T; @8;0@8@@M0U;[iI" F_SETFL;TI"Fcntl::F_SETFL;T00o;;[o; ;[I" F_SETFL;T@o; ;[I"ISet the file descriptor flags. This will be one or more of the O_* ;TI" flags.;T; @8;0@8@@M0U;[iI" F_SETLK;TI"Fcntl::F_SETLK;T00o;;[o; ;[I" F_SETLK;T@o; ;[I"HAcquire a lock on a region of a file. This uses one of the F_*LCK ;TI" flags.;T; @8;0@8@@M0U;[iI" F_SETLKW;TI"Fcntl::F_SETLKW;T00o;;[o; ;[I" F_SETLKW;T@o; ;[I"LAcquire a lock on a region of a file, waiting if necessary. This uses ;TI"one of the F_*LCK flags;T; @8;0@8@@M0U;[iI"FD_CLOEXEC;TI"Fcntl::FD_CLOEXEC;T00o;;[o; ;[I"FD_CLOEXEC;T@o; ;[I")the value of the close-on-exec flag.;T; @8;0@8@@M0U;[iI" F_RDLCK;TI"Fcntl::F_RDLCK;T00o;;[o; ;[I" F_RDLCK;T@o; ;[I"%Read lock for a region of a file;T; @8;0@8@@M0U;[iI" F_UNLCK;TI"Fcntl::F_UNLCK;T00o;;[o; ;[I" F_UNLCK;T@o; ;[I"'Remove lock for a region of a file;T; @8;0@8@@M0U;[iI" F_WRLCK;TI"Fcntl::F_WRLCK;T00o;;[o; ;[I" F_WRLCK;T@o; ;[I"&Write lock for a region of a file;T; @8;0@8@@M0U;[iI" O_CREAT;TI"Fcntl::O_CREAT;T00o;;[o; ;[I" O_CREAT;T@o; ;[I"(Create the file if it doesn't exist;T; @8;0@8@@M0U;[iI" O_EXCL;TI"Fcntl::O_EXCL;T00o;;[o; ;[I" O_EXCL;T@o; ;[I"/Used with O_CREAT, fail if the file exists;T; @8;0@8@@M0U;[iI" O_NOCTTY;TI"Fcntl::O_NOCTTY;T00o;;[o; ;[I" O_NOCTTY;T@o; ;[I"5Open TTY without it becoming the controlling TTY;T; @8;0@8@@M0U;[iI" O_TRUNC;TI"Fcntl::O_TRUNC;T00o;;[o; ;[I" O_TRUNC;T@o; ;[I"Truncate the file on open;T; @8;0@8@@M0U;[iI" O_APPEND;TI"Fcntl::O_APPEND;T00o;;[o; ;[I" O_APPEND;T@o; ;[I"!Open the file in append mode;T; @8;0@8@@M0U;[iI"O_NONBLOCK;TI"Fcntl::O_NONBLOCK;T00o;;[o; ;[I"O_NONBLOCK;T@o; ;[I"'Open the file in non-blocking mode;T; @8;0@8@@M0U;[iI" O_NDELAY;TI"Fcntl::O_NDELAY;T00o;;[o; ;[I" O_NDELAY;T@o; ;[I"'Open the file in non-blocking mode;T; @8;0@8@@M0U;[iI" O_RDONLY;TI"Fcntl::O_RDONLY;T00o;;[o; ;[I" O_RDONLY;T@o; ;[I"$Open the file in read-only mode;T; @8;0@8@@M0U;[iI" O_RDWR;TI"Fcntl::O_RDWR;T00o;;[o; ;[I" O_RDWR;T@o; ;[I"%Open the file in read-write mode;T; @8;0@8@@M0U;[iI" O_WRONLY;TI"Fcntl::O_WRONLY;T00o;;[o; ;[I" O_WRONLY;T@o; ;[I"&Open the file in write-only mode.;T; @8;0@8@@M0U;[iI"O_ACCMODE;TI"Fcntl::O_ACCMODE;T00o;;[o; ;[I"O_ACCMODE;T@o; ;[I")Mask to extract the read/write flags;T; @8;0@8@@M0[[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[;[[;[[;[[[U:RDoc::Context::Section[i0o;;[; 0;0[@8@8cRDoc::TopLevel