Skip to content

Commit 0f7e88e

Browse files
committed
Merge pull request rust-lang#26 from alexcrichton/cloexec
Add some CLOEXEC constants
2 parents 7a83039 + 14f7e02 commit 0f7e88e

File tree

6 files changed

+9
-2
lines changed

6 files changed

+9
-2
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pub const O_CREAT: ::c_int = 512;
161161
pub const O_EXCL: ::c_int = 2048;
162162
pub const O_NOCTTY: ::c_int = 131072;
163163
pub const O_TRUNC: ::c_int = 1024;
164+
pub const O_CLOEXEC: ::c_int = 0x1000000;
164165
pub const S_IFIFO: mode_t = 4096;
165166
pub const S_IFCHR: mode_t = 8192;
166167
pub const S_IFBLK: mode_t = 24576;
@@ -195,6 +196,7 @@ pub const F_LOCK: ::c_int = 1;
195196
pub const F_TEST: ::c_int = 3;
196197
pub const F_TLOCK: ::c_int = 2;
197198
pub const F_ULOCK: ::c_int = 0;
199+
pub const F_DUPFD_CLOEXEC: ::c_int = 67;
198200
pub const SIGHUP: ::c_int = 1;
199201
pub const SIGINT: ::c_int = 2;
200202
pub const SIGQUIT: ::c_int = 3;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ pub const O_CREAT: ::c_int = 512;
111111
pub const O_EXCL: ::c_int = 2048;
112112
pub const O_NOCTTY: ::c_int = 32768;
113113
pub const O_TRUNC: ::c_int = 1024;
114+
pub const O_CLOEXEC: ::c_int = 0x00100000;
114115
pub const S_IFIFO: mode_t = 4096;
115116
pub const S_IFCHR: mode_t = 8192;
116117
pub const S_IFBLK: mode_t = 24576;
@@ -145,6 +146,7 @@ pub const F_LOCK: ::c_int = 1;
145146
pub const F_TEST: ::c_int = 3;
146147
pub const F_TLOCK: ::c_int = 2;
147148
pub const F_ULOCK: ::c_int = 0;
149+
pub const F_DUPFD_CLOEXEC: ::c_int = 17;
148150
pub const SIGHUP: ::c_int = 1;
149151
pub const SIGINT: ::c_int = 2;
150152
pub const SIGQUIT: ::c_int = 3;

src/unix/bsd/openbsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pub const O_CREAT : c_int = 512;
123123
pub const O_EXCL : c_int = 2048;
124124
pub const O_NOCTTY : c_int = 32768;
125125
pub const O_TRUNC : c_int = 1024;
126+
pub const O_CLOEXEC: ::c_int = 0x10000;
126127
pub const S_IFIFO : mode_t = 4096;
127128
pub const S_IFCHR : mode_t = 8192;
128129
pub const S_IFBLK : mode_t = 24576;

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
181181
};
182182
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
183183

184-
pub const O_SYNC: ::c_int = 0x1000;
185-
186184
pub const FIOCLEX: ::c_ulong = 0x5451;
187185

188186
pub const SA_ONSTACK: ::c_ulong = 0x08000000;
@@ -194,6 +192,7 @@ pub const SIGBUS: ::c_int = 7;
194192
pub const SIG_SETMASK: ::c_int = 2;
195193

196194
pub const O_ACCMODE: ::c_int = 3;
195+
pub const O_SYNC: ::c_int = 0x1000;
197196

198197
pub const RUSAGE_CHILDREN: ::c_int = -1;
199198

src/unix/notbsd/linux/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ pub const MAP_32BIT: ::c_int = 0x0040;
223223

224224
pub const TCP_MD5SIG: ::c_int = 14;
225225

226+
pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
227+
226228
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
227229
__align: [],
228230
size: [0; __SIZEOF_PTHREAD_MUTEX_T],

src/unix/notbsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ pub const O_RDONLY: ::c_int = 0;
122122
pub const O_WRONLY: ::c_int = 1;
123123
pub const O_RDWR: ::c_int = 2;
124124
pub const O_TRUNC: ::c_int = 512;
125+
pub const O_CLOEXEC: ::c_int = 0x80000;
125126
pub const S_IFIFO: ::mode_t = 4096;
126127
pub const S_IFCHR: ::mode_t = 8192;
127128
pub const S_IFBLK: ::mode_t = 24576;

0 commit comments

Comments
 (0)