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