]> gitweb.factorcode.org Git - factor.git/commitdiff
unix: Fix sigset_t for linux/macos.
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 2 Jan 2022 06:04:31 +0000 (00:04 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 2 Jan 2022 06:04:31 +0000 (00:04 -0600)
Related to #2535

basis/unix/process/process.factor
basis/unix/types/linux/linux.factor
basis/unix/types/macosx/macosx.factor

index 90d6a3c971e3ed30aca466845a0ff347cd451648..e5570394acca8009692c24f34dc4771e7caa04c4 100644 (file)
@@ -17,37 +17,12 @@ FUNCTION: int execv ( c-string path, c-string* argv )
 FUNCTION: int execvp ( c-string path, c-string* argv )
 FUNCTION: int execve ( c-string path, c-string* argv, c-string* envp )
 
-STRUCT: sched_param
-    { sched_priority int } ;
-
-TYPEDEF: void* spawn_action
-
-STRUCT: posix_spawn_file_actions_t
-    { __allocated int }
-    { __used int }
-    { __actions spawn_action }
-    { __pad int[16] } ;
-
-! XXX: Linux structs, macOS needs different definitions
-STRUCT: sigset_t
-    { val uchar[128] } ;
-
-STRUCT: posix_spawnattr_t
-  { __flags alien.c-types:short }
-  { __pgrp pid_t }
-  { __sd sigset_t }
-  { __ss sigset_t }
-  { __sp sched_param }
-  { __policy int }
-  { __pad int[16] } ;
-
 FUNCTION: int posix_spawn_file_actions_init ( posix_spawn_file_actions_t* file_actions )
 FUNCTION: int posix_spawn_file_actions_destroy ( posix_spawn_file_actions_t* file_actions )
 
 FUNCTION: int posix_spawnattr_init ( posix_spawnattr_t* attr )
 FUNCTION: int posix_spawnattr_destroy ( posix_spawnattr_t* attr )
 
-
 FUNCTION: int posix_spawn_file_actions_addclose (
     posix_spawn_file_actions_t *file_actions, int filedes )
 FUNCTION: int posix_spawn_file_actions_addopen (
@@ -107,15 +82,6 @@ CONSTANT: POSIX_SPAWN_PCONTROL_KILL       0x0003
 : check-posix ( n -- )
     dup 0 = [ drop ] [ (throw-errno) ] if ;
 
-: <posix-spawnattr> ( -- attr )
-    posix_spawnattr_t <struct> [ posix_spawnattr_init check-posix ] keep ;
-
-: get-sigdefault ( attr: posix_spawnattr_t out-param: sigset_t -- sigdefault )
-    [ posix_spawnattr_getsigdefault check-posix ] keep ;
-
-: set-sigdefault ( attr: posix_spawnattr_t sigdefault: sigset_t -- )
-    posix_spawnattr_setsigdefault check-posix ;
-
 : posix-spawn-file-actions-init ( -- posix_spawn_file_actions_t )
     posix_spawn_file_actions_t <struct>
     [ posix_spawn_file_actions_init check-posix ] keep ;
index f9e5849975304643e50e8c0bf99b40c956192dcf..a2bac2ad67a37d818e225ec49692580dd97dfaa4 100644 (file)
@@ -30,7 +30,6 @@ TYPEDEF: __slongword_type blksize_t
 TYPEDEF: __slongword_type blkcnt_t
 TYPEDEF: __sword_type     ssize_t
 TYPEDEF: __s32_type       pid_t
-TYPEDEF: ulong sigset_t
 TYPEDEF: __slongword_type time_t
 TYPEDEF: __slongword_type __time_t
 
@@ -40,3 +39,26 @@ TYPEDEF: ulonglong __fsblkcnt64_t
 TYPEDEF: ulonglong __fsfilcnt64_t
 TYPEDEF: ulonglong ino64_t
 TYPEDEF: ulonglong off64_t
+
+STRUCT: sched_param
+    { sched_priority int } ;
+
+TYPEDEF: void* spawn_action
+
+STRUCT: posix_spawn_file_actions_t
+    { __allocated int }
+    { __used int }
+    { __actions spawn_action }
+    { __pad int[16] } ;
+
+STRUCT: sigset_t
+    { val uchar[128] } ;
+
+STRUCT: posix_spawnattr_t
+  { __flags alien.c-types:short }
+  { __pgrp pid_t }
+  { __sd sigset_t }
+  { __ss sigset_t }
+  { __sp sched_param }
+  { __policy int }
+  { __pad int[16] } ;
index fc435cd9fbf878e42a49c065a550b17230c1ef45..6f211dec5c22c1ede3acf44dacc60e156c860f24 100644 (file)
@@ -33,3 +33,7 @@ TYPEDEF: char[512] io_string_t
 TYPEDEF: kern_return_t IOReturn
 
 TYPEDEF: uint IOOptionBits
+
+TYPEDEF: void* posix_spawn_file_actions_t
+TYPEDEF: void* posix_spawnattr_t
+TYPEDEF: uint sigset_t