Skip to content

Commit

Permalink
Merge pull request rust-lang#26 from alexcrichton/cloexec
Browse files Browse the repository at this point in the history
Add some CLOEXEC constants
  • Loading branch information
alexcrichton committed Nov 3, 2015
2 parents 7a83039 + 14f7e02 commit 0f7e88e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ pub const O_CREAT: ::c_int = 512;
pub const O_EXCL: ::c_int = 2048;
pub const O_NOCTTY: ::c_int = 131072;
pub const O_TRUNC: ::c_int = 1024;
pub const O_CLOEXEC: ::c_int = 0x1000000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
Expand Down Expand Up @@ -195,6 +196,7 @@ pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 67;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pub const O_CREAT: ::c_int = 512;
pub const O_EXCL: ::c_int = 2048;
pub const O_NOCTTY: ::c_int = 32768;
pub const O_TRUNC: ::c_int = 1024;
pub const O_CLOEXEC: ::c_int = 0x00100000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
Expand Down Expand Up @@ -145,6 +146,7 @@ pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 17;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/openbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub const O_CREAT : c_int = 512;
pub const O_EXCL : c_int = 2048;
pub const O_NOCTTY : c_int = 32768;
pub const O_TRUNC : c_int = 1024;
pub const O_CLOEXEC: ::c_int = 0x10000;
pub const S_IFIFO : mode_t = 4096;
pub const S_IFCHR : mode_t = 8192;
pub const S_IFBLK : mode_t = 24576;
Expand Down
3 changes: 1 addition & 2 deletions src/unix/notbsd/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
};
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;

pub const O_SYNC: ::c_int = 0x1000;

pub const FIOCLEX: ::c_ulong = 0x5451;

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

pub const O_ACCMODE: ::c_int = 3;
pub const O_SYNC: ::c_int = 0x1000;

pub const RUSAGE_CHILDREN: ::c_int = -1;

Expand Down
2 changes: 2 additions & 0 deletions src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ pub const MAP_32BIT: ::c_int = 0x0040;

pub const TCP_MD5SIG: ::c_int = 14;

pub const F_DUPFD_CLOEXEC: ::c_int = 1030;

pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__align: [],
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
pub const O_TRUNC: ::c_int = 512;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const S_IFIFO: ::mode_t = 4096;
pub const S_IFCHR: ::mode_t = 8192;
pub const S_IFBLK: ::mode_t = 24576;
Expand Down

0 comments on commit 0f7e88e

Please sign in to comment.