@@ -15,6 +15,9 @@ pub type key_t = ::c_long;
15
15
pub type msglen_t = :: c_ulong ;
16
16
pub type msgqnum_t = :: c_ulong ;
17
17
18
+ pub type posix_spawnattr_t = * mut :: c_void ;
19
+ pub type posix_spawn_file_actions_t = * mut :: c_void ;
20
+
18
21
s ! {
19
22
pub struct utmpx {
20
23
pub ut_type: :: c_short,
@@ -851,6 +854,13 @@ pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
851
854
pub const RTP_PRIO_NORMAL : :: c_ushort = 3 ;
852
855
pub const RTP_PRIO_IDLE : :: c_ushort = 4 ;
853
856
857
+ pub const POSIX_SPAWN_RESETIDS : :: c_int = 0x01 ;
858
+ pub const POSIX_SPAWN_SETPGROUP : :: c_int = 0x02 ;
859
+ pub const POSIX_SPAWN_SETSCHEDPARAM : :: c_int = 0x04 ;
860
+ pub const POSIX_SPAWN_SETSCHEDULER : :: c_int = 0x08 ;
861
+ pub const POSIX_SPAWN_SETSIGDEF : :: c_int = 0x10 ;
862
+ pub const POSIX_SPAWN_SETSIGMASK : :: c_int = 0x20 ;
863
+
854
864
extern {
855
865
pub fn __error ( ) -> * mut :: c_int ;
856
866
@@ -913,6 +923,72 @@ extern {
913
923
914
924
pub fn rtprio_thread ( function : :: c_int , lwpid : :: lwpid_t ,
915
925
rtp : * mut super :: rtprio ) -> :: c_int ;
926
+
927
+ pub fn posix_spawn ( pid : * mut :: pid_t ,
928
+ path : * const :: c_char ,
929
+ file_actions : * const :: posix_spawn_file_actions_t ,
930
+ attrp : * const :: posix_spawnattr_t ,
931
+ argv : * const * mut :: c_char ,
932
+ envp : * const * mut :: c_char ) -> :: c_int ;
933
+ pub fn posix_spawnp ( pid : * mut :: pid_t ,
934
+ file : * const :: c_char ,
935
+ file_actions : * const :: posix_spawn_file_actions_t ,
936
+ attrp : * const :: posix_spawnattr_t ,
937
+ argv : * const * mut :: c_char ,
938
+ envp : * const * mut :: c_char ) -> :: c_int ;
939
+ pub fn posix_spawnattr_init ( attr : * mut posix_spawnattr_t ) -> :: c_int ;
940
+ pub fn posix_spawnattr_destroy ( attr : * mut posix_spawnattr_t ) -> :: c_int ;
941
+ pub fn posix_spawnattr_getsigdefault ( attr : * const posix_spawnattr_t ,
942
+ default : * mut :: sigset_t ) -> :: c_int ;
943
+ pub fn posix_spawnattr_setsigdefault ( attr : * mut posix_spawnattr_t ,
944
+ default : * const :: sigset_t ) -> :: c_int ;
945
+ pub fn posix_spawnattr_getsigmask ( attr : * const posix_spawnattr_t ,
946
+ default : * mut :: sigset_t ) -> :: c_int ;
947
+ pub fn posix_spawnattr_setsigmask ( attr : * mut posix_spawnattr_t ,
948
+ default : * const :: sigset_t ) -> :: c_int ;
949
+ pub fn posix_spawnattr_getflags ( attr : * const posix_spawnattr_t ,
950
+ flags : * mut :: c_short ) -> :: c_int ;
951
+ pub fn posix_spawnattr_setflags ( attr : * mut posix_spawnattr_t ,
952
+ flags : :: c_short ) -> :: c_int ;
953
+ pub fn posix_spawnattr_getpgroup ( attr : * const posix_spawnattr_t ,
954
+ flags : * mut :: pid_t ) -> :: c_int ;
955
+ pub fn posix_spawnattr_setpgroup ( attr : * mut posix_spawnattr_t ,
956
+ flags : :: pid_t ) -> :: c_int ;
957
+ pub fn posix_spawnattr_getschedpolicy ( attr : * const posix_spawnattr_t ,
958
+ flags : * mut :: c_int ) -> :: c_int ;
959
+ pub fn posix_spawnattr_setschedpolicy ( attr : * mut posix_spawnattr_t ,
960
+ flags : :: c_int ) -> :: c_int ;
961
+ pub fn posix_spawnattr_getschedparam (
962
+ attr : * const posix_spawnattr_t ,
963
+ param : * mut :: sched_param ,
964
+ ) -> :: c_int ;
965
+ pub fn posix_spawnattr_setschedparam (
966
+ attr : * mut posix_spawnattr_t ,
967
+ param : * const :: sched_param ,
968
+ ) -> :: c_int ;
969
+
970
+ pub fn posix_spawn_file_actions_init (
971
+ actions : * mut posix_spawn_file_actions_t ,
972
+ ) -> :: c_int ;
973
+ pub fn posix_spawn_file_actions_destroy (
974
+ actions : * mut posix_spawn_file_actions_t ,
975
+ ) -> :: c_int ;
976
+ pub fn posix_spawn_file_actions_addopen (
977
+ actions : * mut posix_spawn_file_actions_t ,
978
+ fd : :: c_int ,
979
+ path : * const :: c_char ,
980
+ oflag : :: c_int ,
981
+ mode : :: mode_t ,
982
+ ) -> :: c_int ;
983
+ pub fn posix_spawn_file_actions_addclose (
984
+ actions : * mut posix_spawn_file_actions_t ,
985
+ fd : :: c_int ,
986
+ ) -> :: c_int ;
987
+ pub fn posix_spawn_file_actions_adddup2 (
988
+ actions : * mut posix_spawn_file_actions_t ,
989
+ fd : :: c_int ,
990
+ newfd : :: c_int ,
991
+ ) -> :: c_int ;
916
992
}
917
993
918
994
cfg_if ! {
0 commit comments