feat(process): fork/exec/id/session + system/popen

This commit is contained in:
2026-09-05 16:55:14 -04:00
parent c9e9676d38
commit 14c6fd6cf6
19 changed files with 2118 additions and 2 deletions
+15
View File
@@ -261,6 +261,21 @@ tmpfile(void);
__attribute__((pure)) int
fileno(FILE *stream);
/*
* Run command in a subshell ("sh -c command") with a pipe attached to
* its standard output (mode "r") or standard input (mode "w"). Only the
* two POSIX modes are accepted (the glibc "re"/"we" close-on-exec
* extension is not). Returns the stream, or NULL with errno set.
* pclose closes the stream, waits for the shell, and returns its
* termination status (the raw wait status, e.g. 0 for "exit 0"), or -1
* when the stream was not opened by popen or the wait failed.
*/
FILE *
popen(const char *command, const char *mode);
int
pclose(FILE *stream);
/* getc/putc/getchar/putchar as macros over fgetc/fputc (see above). */
#define getc(stream) fgetc(stream)
#define putc(c, stream) fputc((c), (stream))