diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-04-17 10:28:11 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-04-17 10:28:11 +0200 |
commit | b1ddaa81f28b8bbc62d6d50526e0935b173099eb (patch) | |
tree | e606c194f8eecdedf3f710ed097cadfe97d60122 /stdio/spawn.h | |
download | md2html-b1ddaa81f28b8bbc62d6d50526e0935b173099eb.tar.gz md2html-b1ddaa81f28b8bbc62d6d50526e0935b173099eb.zip |
Init
Diffstat (limited to 'stdio/spawn.h')
-rw-r--r-- | stdio/spawn.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/stdio/spawn.h b/stdio/spawn.h new file mode 100644 index 0000000..7fe335c --- /dev/null +++ b/stdio/spawn.h @@ -0,0 +1,50 @@ +#ifndef COSMOPOLITAN_LIBC_STDIO_SPAWN_H_ +#define COSMOPOLITAN_LIBC_STDIO_SPAWN_H_ +#include "libc/calls/struct/sched_param.h" +#include "libc/calls/struct/sigset.h" + +#define POSIX_SPAWN_RESETIDS 0x01 +#define POSIX_SPAWN_SETPGROUP 0x02 +#define POSIX_SPAWN_SETSIGDEF 0x04 +#define POSIX_SPAWN_SETSIGMASK 0x08 +#define POSIX_SPAWN_SETSCHEDPARAM 0x10 +#define POSIX_SPAWN_SETSCHEDULER 0x20 + +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +typedef char *posix_spawn_file_actions_t; +typedef struct _posix_spawnattr posix_spawnattr_t; + +int posix_spawn(int *, const char *, const posix_spawn_file_actions_t *, + const posix_spawnattr_t *, char *const[], char *const[]); +int posix_spawnp(int *, const char *, const posix_spawn_file_actions_t *, + const posix_spawnattr_t *, char *const[], char *const[]); + +int posix_spawn_file_actions_init(posix_spawn_file_actions_t *); +int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *); +int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int); +int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int); +int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *, int, + const char *, int, unsigned); + +int posix_spawnattr_init(posix_spawnattr_t *); +int posix_spawnattr_destroy(posix_spawnattr_t *); +int posix_spawnattr_getflags(const posix_spawnattr_t *, short *); +int posix_spawnattr_setflags(posix_spawnattr_t *, short); +int posix_spawnattr_getpgroup(const posix_spawnattr_t *, int *); +int posix_spawnattr_setpgroup(posix_spawnattr_t *, int); +int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *, int *); +int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); +int posix_spawnattr_getschedparam(const posix_spawnattr_t *, + struct sched_param *); +int posix_spawnattr_setschedparam(posix_spawnattr_t *, + const struct sched_param *); +int posix_spawnattr_getsigmask(const posix_spawnattr_t *, sigset_t *); +int posix_spawnattr_setsigmask(posix_spawnattr_t *, const sigset_t *); +int posix_spawnattr_getdefault(const posix_spawnattr_t *, sigset_t *); +int posix_spawnattr_setsigdefault(posix_spawnattr_t *, const sigset_t *); + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_STDIO_SPAWN_H_ */ |