summaryrefslogtreecommitdiff
path: root/ext/fcntl/fcntl.c
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2022-01-15 05:25:35 +0000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-15 18:56:15 +0900
commit670f3e6cd7b6ea03810af3606139021471019017 (patch)
tree91ad12df935a6cbbdea1389e3ebd1fe27bea784b /ext/fcntl/fcntl.c
parentd853a7886ef63b7237ab2bce42eb99c26bc1eccb (diff)
[ruby/fcntl] adding few FreeBSD specific flags.
https://github.com/ruby/fcntl/commit/03d9a7937d
Diffstat (limited to 'ext/fcntl/fcntl.c')
-rw-r--r--ext/fcntl/fcntl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c
index ee42d2abe5..3bccc41e4c 100644
--- a/ext/fcntl/fcntl.c
+++ b/ext/fcntl/fcntl.c
@@ -256,4 +256,21 @@ Init_fcntl(void)
*/
rb_define_const(mFcntl, "O_ACCMODE", INT2FIX(O_RDONLY | O_WRONLY | O_RDWR));
#endif
+#ifdef F_DUP2FD
+ /* Document-const: F_DUP2FD
+ *
+ * It is a FreeBSD specific constant and equivalent
+ * to dup2 call.
+ */
+ rb_define_const(mFcntl, "F_DUP2FD", INT2NUM(F_DUP2FD));
+#endif
+#ifdef F_DUP2FD_CLOEXEC
+ /* Document-const: F_DUP2FD_CLOEXEC
+ *
+ * It is a FreeBSD specific constant and acts
+ * similarly as F_DUP2FD but set the FD_CLOEXEC
+ * flag in addition.
+ */
+ rb_define_const(mFcntl, "F_DUP2FD_CLOEXEC", INT2NUM(F_DUP2FD_CLOEXEC));
+#endif
}