From 670f3e6cd7b6ea03810af3606139021471019017 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 15 Jan 2022 05:25:35 +0000 Subject: [PATCH] [ruby/fcntl] adding few FreeBSD specific flags. https://github.com/ruby/fcntl/commit/03d9a7937d --- ext/fcntl/fcntl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 }