summaryrefslogtreecommitdiff
path: root/ext/fcntl
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-28 03:34:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-28 03:34:43 +0000
commit8477d3131c1dadc79e5646533baa471278be7ee2 (patch)
tree4f0bc00bb3fe90f6f1e2ef9dbf5418d09f7dbf64 /ext/fcntl
parentb2ca2c58f15948629f16ccd763e70fcd5f85a124 (diff)
* ext/fcntl/fcntl.c: update document. use "file descriptor" instead
of "file handle" because it is not used other Ruby documents and it is confusing with Windows file handle. correct F_DUPFD behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fcntl')
-rw-r--r--ext/fcntl/fcntl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c
index 311569c134..3538d94948 100644
--- a/ext/fcntl/fcntl.c
+++ b/ext/fcntl/fcntl.c
@@ -68,15 +68,19 @@ Init_fcntl()
#ifdef F_DUPFD
/* Document-const: F_DUPFD
*
- * Duplicate a close-on-exec file handle to a non-close-on-exec file
- * handle.
+ * Duplicate a file descriptor to the mimimum unused file descriptor
+ * greater than or equal to the argument.
+ *
+ * The close-on-exec flag of the duplicated file descriptor is set.
+ * (Ruby uses F_DUPFD_CLOEXEC internally if available to avoid race
+ * condition. F_SETFD is used if F_DUPFD_CLOEXEC is not available.)
*/
rb_define_const(mFcntl, "F_DUPFD", INT2NUM(F_DUPFD));
#endif
#ifdef F_GETFD
/* Document-const: F_GETFD
*
- * Read the close-on-exec flag of a file handle.
+ * Read the close-on-exec flag of a file descriptor.
*/
rb_define_const(mFcntl, "F_GETFD", INT2NUM(F_GETFD));
#endif
@@ -91,7 +95,7 @@ Init_fcntl()
#ifdef F_SETFD
/* Document-const: F_SETFD
*
- * Set the close-on-exec flag of a file handle.
+ * Set the close-on-exec flag of a file descriptor.
*/
rb_define_const(mFcntl, "F_SETFD", INT2NUM(F_SETFD));
#endif
@@ -128,7 +132,7 @@ Init_fcntl()
rb_define_const(mFcntl, "F_SETLKW", INT2NUM(F_SETLKW));
#endif
#ifdef FD_CLOEXEC
- /* Document-const: F_CLOEXEC
+ /* Document-const: FD_CLOEXEC
*
* the value of the close-on-exec flag.
*/