summaryrefslogtreecommitdiff
path: root/lib/libc/gen/posix_spawnattr_init.3
blob: f9779d92371ec38c0e6533286d0f87679b685cf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\"	$OpenBSD: posix_spawnattr_init.3,v 1.5 2012/04/11 14:32:38 jmc Exp $
.\"
.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: April 11 2012 $
.Dt POSIX_SPAWNATTR_INIT 3
.Os
.Sh NAME
.Nm posix_spawnattr_init ,
.Nm posix_spawnattr_destroy
.Nd "create and destroy posix_spawn attributes object"
.Sh SYNOPSIS
.In spawn.h
.Ft int
.Fn posix_spawnattr_init "posix_spawnattr_t *attr"
.Ft int
.Fn posix_spawnattr_destroy "posix_spawnattr_t *attr"
.Sh DESCRIPTION
.Xr posix_spawn 3
attributes objects can be initialized by
.Fn posix_spawnattr_init
and destroyed by
.Fn posix_spawnattr_destroy .
.Pp
Initialization fills an attributes object pointed by
.Fa attr
with the default values for all the attributes.
.Pp
Multiple initialization of the same object is undefined behavior
and will lead to memory leaks.
.Pp
Similarly, objects should be passed to
.Fn posix_spawnattr_destroy
to reclaim memory.
The object should not be re-used after destruction.
It can however be initialized again with
.Fn posix_spawnattr_init .
.Pp
An attributes object, possibly modified by
.Fn posix_spawn_set* ,
is used to specify what process attributes
will be passed across a spawn operation as implemented by
.Fn posix_spawn
or
.Fn posix_spawnp .
.Pp
Attribute details are described in
.Xr posix_spawnattr_setflags 3 .
.Pp
Modifying or destroying attributes object
will not affect processes that have already been spawned.
.Sh RETURN VALUES
These function return 0 on successful completion.
They may return
.Er ENOMEM
when running out of memory.
.Sh SEE ALSO
.Xr posix_spawn 3
.Sh STANDARDS
Both functions conform to
.St -p1003.1-2001 .
.Sh AUTHORS
.An Ed Schouten Aq ed@FreeBSD.org