| OLD | NEW |
| (Empty) |
| 1 /*- | |
| 2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> | |
| 3 * All rights reserved. | |
| 4 * | |
| 5 * Redistribution and use in source and binary forms, with or without | |
| 6 * modification, are permitted provided that the following conditions | |
| 7 * are met: | |
| 8 * 1. Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | |
| 11 * notice, this list of conditions and the following disclaimer in the | |
| 12 * documentation and/or other materials provided with the distribution. | |
| 13 * | |
| 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
| 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
| 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
| 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
| 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
| 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
| 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
| 24 * SUCH DAMAGE. | |
| 25 */ | |
| 26 | |
| 27 #ifndef _SPAWN_H_ | |
| 28 #define _SPAWN_H_ | |
| 29 | |
| 30 // This is slighly modified from the newlib version of spawn.h. | |
| 31 // TODO(sbc): remove this once bionic toolchain gets a copy of | |
| 32 // spawn.h. | |
| 33 #define _EXFUN(name, proto) name proto | |
| 34 #define _BEGIN_STD_C __BEGIN_DECLS | |
| 35 #define _END_STD_C __END_DECLS | |
| 36 | |
| 37 #include <sys/cdefs.h> | |
| 38 #include <sys/types.h> | |
| 39 #include <sys/_types.h> | |
| 40 #define __need_sigset_t | |
| 41 #include <signal.h> | |
| 42 | |
| 43 #ifndef __BIONIC__ | |
| 44 #error "This header is only indended for use with the bionic toolchain" | |
| 45 #endif | |
| 46 | |
| 47 struct sched_param; | |
| 48 | |
| 49 typedef struct __posix_spawnattr *posix_spawnattr_t; | |
| 50 typedef struct __posix_spawn_file_actions *posix_spawn_file_actions_t; | |
| 51 | |
| 52 #define POSIX_SPAWN_RESETIDS 0x01 | |
| 53 #define POSIX_SPAWN_SETPGROUP 0x02 | |
| 54 #define POSIX_SPAWN_SETSCHEDPARAM 0x04 | |
| 55 #define POSIX_SPAWN_SETSCHEDULER 0x08 | |
| 56 #define POSIX_SPAWN_SETSIGDEF 0x10 | |
| 57 #define POSIX_SPAWN_SETSIGMASK 0x20 | |
| 58 | |
| 59 _BEGIN_STD_C | |
| 60 /* | |
| 61 * Spawn routines | |
| 62 * | |
| 63 * XXX both arrays should be __restrict, but this does not work when GCC | |
| 64 * is invoked with -std=c99. | |
| 65 */ | |
| 66 int _EXFUN(posix_spawn, (pid_t * __restrict, const char * __restrict, | |
| 67 const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict
, | |
| 68 char * const [], char * const []) | |
| 69 ); | |
| 70 int _EXFUN(posix_spawnp, (pid_t * __restrict, const char * __restrict, | |
| 71 const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict
, | |
| 72 char * const [], char * const []) | |
| 73 ); | |
| 74 | |
| 75 /* | |
| 76 * File descriptor actions | |
| 77 */ | |
| 78 int _EXFUN(posix_spawn_file_actions_init, (posix_spawn_file_actions_t *)); | |
| 79 int _EXFUN(posix_spawn_file_actions_destroy, (posix_spawn_file_actions_t *)); | |
| 80 | |
| 81 int _EXFUN(posix_spawn_file_actions_addopen, | |
| 82 (posix_spawn_file_actions_t * __restrict, int, const char * __restrict,
int, mode_t) | |
| 83 ); | |
| 84 int _EXFUN(posix_spawn_file_actions_adddup2, | |
| 85 (posix_spawn_file_actions_t *, int, int) | |
| 86 ); | |
| 87 int _EXFUN(posix_spawn_file_actions_addclose, | |
| 88 (posix_spawn_file_actions_t *, int) | |
| 89 ); | |
| 90 | |
| 91 /* | |
| 92 * Spawn attributes | |
| 93 */ | |
| 94 int _EXFUN(posix_spawnattr_init, (posix_spawnattr_t *)); | |
| 95 int _EXFUN(posix_spawnattr_destroy, (posix_spawnattr_t *)); | |
| 96 | |
| 97 int _EXFUN(posix_spawnattr_getflags, | |
| 98 (const posix_spawnattr_t * __restrict, short * __restrict) | |
| 99 ); | |
| 100 int _EXFUN(posix_spawnattr_getpgroup, | |
| 101 (const posix_spawnattr_t * __restrict, pid_t * __restrict)); | |
| 102 int _EXFUN(posix_spawnattr_getschedparam, | |
| 103 (const posix_spawnattr_t * __restrict, struct sched_param * __restrict) | |
| 104 ); | |
| 105 int _EXFUN(posix_spawnattr_getschedpolicy, | |
| 106 (const posix_spawnattr_t * __restrict, int * __restrict) | |
| 107 ); | |
| 108 int _EXFUN(posix_spawnattr_getsigdefault, | |
| 109 (const posix_spawnattr_t * __restrict, sigset_t * __restrict) | |
| 110 ); | |
| 111 int _EXFUN(posix_spawnattr_getsigmask, | |
| 112 (const posix_spawnattr_t * __restrict, sigset_t * __restrict) | |
| 113 ); | |
| 114 | |
| 115 int _EXFUN(posix_spawnattr_setflags, (posix_spawnattr_t *, short)); | |
| 116 int _EXFUN(posix_spawnattr_setpgroup, (posix_spawnattr_t *, pid_t)); | |
| 117 int _EXFUN(posix_spawnattr_setschedparam, | |
| 118 (posix_spawnattr_t * __restrict, const struct sched_param * __restrict) | |
| 119 ); | |
| 120 int _EXFUN(posix_spawnattr_setschedpolicy, (posix_spawnattr_t *, int)); | |
| 121 int _EXFUN(posix_spawnattr_setsigdefault, | |
| 122 (posix_spawnattr_t * __restrict, const sigset_t * __restrict) | |
| 123 ); | |
| 124 int _EXFUN(posix_spawnattr_setsigmask, | |
| 125 (posix_spawnattr_t * __restrict, const sigset_t * __restrict) | |
| 126 ); | |
| 127 _END_STD_C | |
| 128 | |
| 129 #endif /* !_SPAWN_H_ */ | |
| OLD | NEW |