@@ -52,6 +52,9 @@ pub type Elf64_Xword = u64;
52
52
pub type ENTRY = entry ;
53
53
pub type ACTION = :: c_int ;
54
54
55
+ pub type posix_spawnattr_t = * mut :: c_void ;
56
+ pub type posix_spawn_file_actions_t = * mut :: c_void ;
57
+
55
58
#[ cfg_attr( feature = "extra_traits" , derive( Debug ) ) ]
56
59
pub enum timezone { }
57
60
impl :: Copy for timezone { }
@@ -1438,6 +1441,13 @@ pub const LOG_SERIAL: ::c_int = 16 << 12;
1438
1441
pub const LOG_PERROR : :: c_int = 32 << 12 ;
1439
1442
pub const LOG_NOWAIT : :: c_int = 64 << 12 ;
1440
1443
1444
+ // spawn.h
1445
+ pub const POSIX_SPAWN_RESETIDS : :: c_int = 0x01 ;
1446
+ pub const POSIX_SPAWN_SETPGROUP : :: c_int = 0x02 ;
1447
+ pub const POSIX_SPAWN_SETSIGDEF : :: c_int = 0x10 ;
1448
+ pub const POSIX_SPAWN_SETSIGMASK : :: c_int = 0x20 ;
1449
+ pub const POSIX_SPAWN_SETSID : :: c_int = 0x40 ;
1450
+
1441
1451
const_fn ! {
1442
1452
{ const } fn CMSG_ALIGN ( len: usize ) -> usize {
1443
1453
len + :: mem:: size_of:: <usize >( ) - 1 & !( :: mem:: size_of:: <usize >( ) - 1 )
@@ -1888,6 +1898,74 @@ extern "C" {
1888
1898
1889
1899
pub fn brk ( addr : * mut :: c_void ) -> :: c_int ;
1890
1900
pub fn sbrk ( increment : :: intptr_t ) -> * mut :: c_void ;
1901
+
1902
+ pub fn posix_spawn (
1903
+ pid : * mut :: pid_t ,
1904
+ path : * const :: c_char ,
1905
+ file_actions : * const :: posix_spawn_file_actions_t ,
1906
+ attrp : * const :: posix_spawnattr_t ,
1907
+ argv : * const * mut :: c_char ,
1908
+ envp : * const * mut :: c_char ,
1909
+ ) -> :: c_int ;
1910
+ pub fn posix_spawnp (
1911
+ pid : * mut :: pid_t ,
1912
+ file : * const :: c_char ,
1913
+ file_actions : * const :: posix_spawn_file_actions_t ,
1914
+ attrp : * const :: posix_spawnattr_t ,
1915
+ argv : * const * mut :: c_char ,
1916
+ envp : * const * mut :: c_char ,
1917
+ ) -> :: c_int ;
1918
+
1919
+ pub fn posix_spawn_file_actions_init ( file_actions : * mut posix_spawn_file_actions_t ) -> :: c_int ;
1920
+ pub fn posix_spawn_file_actions_destroy (
1921
+ file_actions : * mut posix_spawn_file_actions_t ,
1922
+ ) -> :: c_int ;
1923
+ pub fn posix_spawn_file_actions_addopen (
1924
+ file_actions : * mut posix_spawn_file_actions_t ,
1925
+ fildes : :: c_int ,
1926
+ path : * const :: c_char ,
1927
+ oflag : :: c_int ,
1928
+ mode : :: mode_t ,
1929
+ ) -> :: c_int ;
1930
+ pub fn posix_spawn_file_actions_addclose (
1931
+ file_actions : * mut posix_spawn_file_actions_t ,
1932
+ fildes : :: c_int ,
1933
+ ) -> :: c_int ;
1934
+ pub fn posix_spawn_file_actions_adddup2 (
1935
+ file_actions : * mut posix_spawn_file_actions_t ,
1936
+ fildes : :: c_int ,
1937
+ newfildes : :: c_int ,
1938
+ ) -> :: c_int ;
1939
+
1940
+ pub fn posix_spawnattr_init ( attr : * mut posix_spawnattr_t ) -> :: c_int ;
1941
+ pub fn posix_spawnattr_destroy ( attr : * mut posix_spawnattr_t ) -> :: c_int ;
1942
+ pub fn posix_spawnattr_getflags (
1943
+ attr : * const posix_spawnattr_t ,
1944
+ _flags : * mut :: c_short ,
1945
+ ) -> :: c_int ;
1946
+ pub fn posix_spawnattr_setflags ( attr : * mut posix_spawnattr_t , flags : :: c_short ) -> :: c_int ;
1947
+ pub fn posix_spawnattr_getpgroup (
1948
+ attr : * const posix_spawnattr_t ,
1949
+ _pgroup : * mut :: pid_t ,
1950
+ ) -> :: c_int ;
1951
+ pub fn posix_spawnattr_setpgroup ( attr : * mut posix_spawnattr_t , pgroup : :: pid_t ) -> :: c_int ;
1952
+ pub fn posix_spawnattr_getsigdefault (
1953
+ attr : * const posix_spawnattr_t ,
1954
+ sigdefault : * mut :: sigset_t ,
1955
+ ) -> :: c_int ;
1956
+ pub fn posix_spawnattr_setsigdefault (
1957
+ attr : * mut posix_spawnattr_t ,
1958
+ sigdefault : * const :: sigset_t ,
1959
+ ) -> :: c_int ;
1960
+ pub fn posix_spawnattr_getsigmask (
1961
+ attr : * const posix_spawnattr_t ,
1962
+ _sigmask : * mut :: sigset_t ,
1963
+ ) -> :: c_int ;
1964
+ pub fn posix_spawnattr_setsigmask (
1965
+ attr : * mut posix_spawnattr_t ,
1966
+ sigmask : * const :: sigset_t ,
1967
+ ) -> :: c_int ;
1968
+
1891
1969
}
1892
1970
1893
1971
#[ link( name = "bsd" ) ]
0 commit comments