remove unneeded judgemental commentary from ftw.h
[musl] / include / spawn.h
1 #ifndef _SPAWN_H
2 #define _SPAWN_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
11 #define __restrict
12 #endif
13
14 #define __NEED_mode_t
15 #define __NEED_pid_t
16 #define __NEED_sigset_t
17
18 #include <bits/alltypes.h>
19
20 struct sched_param;
21
22 #define POSIX_SPAWN_RESETIDS 1
23 #define POSIX_SPAWN_SETPGROUP 2
24 #define POSIX_SPAWN_SETSIGDEF 4
25 #define POSIX_SPAWN_SETSIGMASK 8
26 #define POSIX_SPAWN_SETSCHEDPARAM 16
27 #define POSIX_SPAWN_SETSCHEDULER 32
28
29 typedef struct {
30         int __flags;
31         pid_t __pgrp;
32         sigset_t __def, __mask;
33         int __prio, __pol, __pad[16];
34 } posix_spawnattr_t;
35
36 typedef struct {
37         int __pad0[2];
38         void *__actions;
39         int __pad[16];
40 } posix_spawn_file_actions_t;
41
42 int posix_spawn(pid_t *__restrict, const char *__restrict, const posix_spawn_file_actions_t *,
43         const posix_spawnattr_t *__restrict, char *const *__restrict, char *const *__restrict);
44 int posix_spawnp(pid_t *__restrict, const char *__restrict, const posix_spawn_file_actions_t *,
45         const posix_spawnattr_t *__restrict, char *const *__restrict, char *const *__restrict);
46
47 int posix_spawnattr_init(posix_spawnattr_t *);
48 int posix_spawnattr_destroy(posix_spawnattr_t *);
49
50 int posix_spawnattr_setflags(posix_spawnattr_t *, short);
51 int posix_spawnattr_getflags(const posix_spawnattr_t *__restrict, short *__restrict);
52
53 int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t);
54 int posix_spawnattr_getpgroup(const posix_spawnattr_t *__restrict, pid_t *__restrict);
55
56 int posix_spawnattr_setsigmask(posix_spawnattr_t *__restrict, const sigset_t *__restrict);
57 int posix_spawnattr_getsigmask(const posix_spawnattr_t *__restrict, sigset_t *__restrict);
58
59 int posix_spawnattr_setsigdefault(posix_spawnattr_t *__restrict, const sigset_t *__restrict);
60 int posix_spawnattr_getsigdefault(const posix_spawnattr_t *__restrict, sigset_t *__restrict);
61
62 int posix_spawn_file_actions_init(posix_spawn_file_actions_t *);
63 int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *);
64
65 int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *__restrict, int, const char *__restrict, int, mode_t);
66 int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int);
67 int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif