Przeglądaj źródła

Added posix_spawn

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7076 8c9fc860-2736-0410-a75d-ab315db34111
felixf 8 lat temu
rodzic
commit
acbd884602
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      source/Generic.Linux.I386.Unix.Mod

+ 4 - 0
source/Generic.Linux.I386.Unix.Mod

@@ -467,6 +467,8 @@ VAR
 	
 	(*pid: return param for process id. Only set if initialized non-null. path: pointer to string denoting the executable. file_actions: modify which files are open for the new process, if NIL it inherits open files from parent process. attrp: sets process groups, scheduler, signals etc, leave NIL. argv, evp: char** to the arguments and env. variables*)
 	posix_spawnp- 	: PROCEDURE{C}(pid: ADDRESS; path: ADDRESS; file_actions: ADDRESS; attrp: ADDRESS; argv: ADDRESS ; envp: ADDRESS): LONGINT;
+	(*more restrictive than spawnp*)
+	posix_spawn- 	: PROCEDURE{C}(pid: ADDRESS; path: ADDRESS; file_actions: ADDRESS; attrp: ADDRESS; argv: ADDRESS ; envp: ADDRESS): LONGINT;
 	waitpid-			: PROCEDURE{C}(pid: pid_t; status: ADDRESS; options: LONGINT): pid_t;
 	pipe-				:PROCEDURE{C}(pipefd: ADDRESS); (*pipefd is assumed to be a pointer to a C array of 2 elements, after pipe creation the array will contain file descriptors for the input and output end of the pipe. returns 0 on success, or -1 on fail*)	
 	dup2-				:PROCEDURE{C}(oldfd,newfd: LONGINT): LONGINT; (*overwrites file descriptor newfd with a copy of oldfd. useful for redirecting pipes.*)
@@ -1154,6 +1156,8 @@ static void sighandler( int sig, siginfo_t *scp, void *ucp ) {
 		Dlsym( libp, "pthread_self", ADDRESSOF(pthread_self));
 		
 		Dlsym( libc, "posix_spawnp", ADDRESSOF(posix_spawnp));
+		Dlsym( libc, "posix_spawn", ADDRESSOF(posix_spawn));
+
 		Dlsym( libc, "waitpid", ADDRESSOF(waitpid));		
 		Dlsym( libc, "pipe", ADDRESSOF(pipe));
 		Dlsym( libc, "dup2",ADDRESSOF(dup2));