1.\"	$OpenBSD: posix_spawnattr_getflags.3,v 1.9 2014/11/30 02:41:43 schwarze Exp $
2.\"
3.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 30 2014 $
18.Dt POSIX_SPAWNATTR_GETFLAGS 3
19.Os
20.Sh NAME
21.Nm posix_spawnattr_getflags ,
22.Nm posix_spawnattr_setflags
23.Nd get and set flags of a posix_spawn attributes object
24.Sh SYNOPSIS
25.In spawn.h
26.Ft int
27.Fn posix_spawnattr_getflags "const posix_spawnattr_t *restrict attr" "short *restrict flags"
28.Ft int
29.Fn posix_spawnattr_setflags "posix_spawnattr_t *attr" "short flags"
30.Sh DESCRIPTION
31The
32.Fn posix_spawnattr_getflags
33and
34.Fn posix_spawnattr_setflags
35functions are used to get or set the flags part of a
36.Xr posix_spawn 3
37attribute object referenced by
38.Fa attr .
39.Pp
40Flag values are OR-ed from the following flags:
41.Bl -tag -width POSIX_SPAWN
42.It Dv POSIX_SPAWN_RESETIDS
43Reset the effective user and group ID of the child process to the parent's
44real user and group ID;
45see
46.Xr setegid 2 .
47.Pp
48If the new process is created from a set-user-ID or set-group-ID file, usual
49.Xr execve 2
50semantics take precedence.
51.It Dv POSIX_SPAWN_SETPGROUP
52Set the process group of the child process according to the pgroup attribute
53of the object; see
54.Xr posix_spawnattr_getpgroup 3
55and
56.Xr setpgid 2 .
57.It Dv POSIX_SPAWN_SETSIGDEF
58Reset signals set by
59.Xr posix_spawnattr_setsigdefault 3
60to their default value in the child process.
61.It Dv POSIX_SPAWN_SETSIGMASK
62Set the signal mask of the child process according
63to the value set by
64.Xr posix_spawnattr_setsigmask 3 ,
65using
66.Xr sigprocmask 2 .
67.It Dv POSIX_SPAWN_SETSCHEDPARAM
68Set the scheduling parameter of the child process
69according to the value set by
70.Xr posix_spawnattr_setschedparam 3
71.Po
72mandated by
73.St -p1003.1-2001 ,
74this implementation currently does nothing
75.Pc .
76.It Dv POSIX_SPAWN_SETSCHEDULER
77Set the scheduler policy of the child process
78according to the value set by
79.Xr posix_spawnattr_setschedpolicy 3
80.Po
81mandated by
82.St -p1003.1-2001 ,
83this implementation currently does nothing
84.Pc .
85.El
86.Pp
87.Xr posix_spawnattr_init 3
88initializes this value to no flags set.
89.Sh RETURN VALUES
90Both functions return 0.
91.Sh SEE ALSO
92.Xr posix_spawn 3 ,
93.Xr posix_spawnattr_init 3
94.Sh STANDARDS
95Both functions conform to
96.St -p1003.1-2001 .
97.Sh AUTHORS
98.An \&Ed Schouten Aq Mt ed@FreeBSD.org
99