1 /* $NetBSD: spawn.h,v 1.4 2012/02/22 17:51:01 martin Exp $ */ 2 3 /*- 4 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $FreeBSD: src/include/spawn.h,v 1.3.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ 29 */ 30 31 #ifndef _SPAWN_H 32 #define _SPAWN_H 33 34 #include <sys/spawn.h> 35 36 __BEGIN_DECLS 37 /* 38 * Spawn routines 39 * 40 */ 41 int posix_spawn(pid_t * __restrict, const char * __restrict, 42 const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, 43 char * const *__restrict, char * const *__restrict); 44 int posix_spawnp(pid_t * __restrict, const char * __restrict, 45 const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, 46 char * const *__restrict, char * const *__restrict); 47 48 /* 49 * File descriptor actions 50 */ 51 int posix_spawn_file_actions_init(posix_spawn_file_actions_t *); 52 int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *); 53 54 int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t * __restrict, 55 int, const char * __restrict, int, mode_t); 56 int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int); 57 int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int); 58 59 /* 60 * Spawn attributes 61 */ 62 int posix_spawnattr_init(posix_spawnattr_t *); 63 int posix_spawnattr_destroy(posix_spawnattr_t *); 64 65 int posix_spawnattr_getflags(const posix_spawnattr_t * __restrict, 66 short * __restrict); 67 int posix_spawnattr_getpgroup(const posix_spawnattr_t * __restrict, 68 pid_t * __restrict); 69 int posix_spawnattr_getschedparam(const posix_spawnattr_t * __restrict, 70 struct sched_param * __restrict); 71 int posix_spawnattr_getschedpolicy(const posix_spawnattr_t * __restrict, 72 int * __restrict); 73 int posix_spawnattr_getsigdefault(const posix_spawnattr_t * __restrict, 74 sigset_t * __restrict); 75 int posix_spawnattr_getsigmask(const posix_spawnattr_t * __restrict, 76 sigset_t * __restrict sigmask); 77 78 int posix_spawnattr_setflags(posix_spawnattr_t *, short); 79 int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t); 80 int posix_spawnattr_setschedparam(posix_spawnattr_t * __restrict, 81 const struct sched_param * __restrict); 82 int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); 83 int posix_spawnattr_setsigdefault(posix_spawnattr_t * __restrict, 84 const sigset_t * __restrict); 85 int posix_spawnattr_setsigmask(posix_spawnattr_t * __restrict, 86 const sigset_t * __restrict); 87 __END_DECLS 88 89 #endif /* _SPAWN_H */ 90