xref: /dflybsd-src/lib/libc/gen/posix_spawnattr_init.3 (revision c9c6988b3417c76f002af80950e0b3264917d3b1)
1c4dd129bSPeter Avalos.\" Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
2c4dd129bSPeter Avalos.\" All rights reserved.
3c4dd129bSPeter Avalos.\"
4c4dd129bSPeter Avalos.\" Redistribution and use in source and binary forms, with or without
5c4dd129bSPeter Avalos.\" modification, are permitted provided that the following conditions
6c4dd129bSPeter Avalos.\" are met:
7c4dd129bSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright
8c4dd129bSPeter Avalos.\"    notice, this list of conditions and the following disclaimer.
9c4dd129bSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright
10c4dd129bSPeter Avalos.\"    notice, this list of conditions and the following disclaimer in the
11c4dd129bSPeter Avalos.\"    documentation and/or other materials provided with the distribution.
12c4dd129bSPeter Avalos.\"
13c4dd129bSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14c4dd129bSPeter Avalos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15c4dd129bSPeter Avalos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16c4dd129bSPeter Avalos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17c4dd129bSPeter Avalos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18c4dd129bSPeter Avalos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19c4dd129bSPeter Avalos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20c4dd129bSPeter Avalos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21c4dd129bSPeter Avalos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22c4dd129bSPeter Avalos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23c4dd129bSPeter Avalos.\" SUCH DAMAGE.
24c4dd129bSPeter Avalos.\"
25c4dd129bSPeter Avalos.\" Portions of this text are reprinted and reproduced in electronic form
26c4dd129bSPeter Avalos.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology --
27c4dd129bSPeter Avalos.\" Portable Operating System Interface (POSIX), The Open Group Base
28c4dd129bSPeter Avalos.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
29c4dd129bSPeter Avalos.\" Electrical and Electronics Engineers, Inc and The Open Group.  In the
30c4dd129bSPeter Avalos.\" event of any discrepancy between this version and the original IEEE and
31c4dd129bSPeter Avalos.\" The Open Group Standard, the original IEEE and The Open Group Standard is
32c4dd129bSPeter Avalos.\" the referee document.  The original Standard can be obtained online at
33c4dd129bSPeter Avalos.\"	http://www.opengroup.org/unix/online.html.
34c4dd129bSPeter Avalos.\"
35c4dd129bSPeter Avalos.\" $FreeBSD: src/lib/libc/gen/posix_spawnattr_init.3,v 1.1 2008/07/28 02:22:19 davidxu Exp $
36c4dd129bSPeter Avalos.\"
37ee79eb2cSSascha Wildner.Dd April 7, 2009
38c4dd129bSPeter Avalos.Dt POSIX_SPAWNATTR_INIT 3
39c4dd129bSPeter Avalos.Os
40c4dd129bSPeter Avalos.Sh NAME
41c4dd129bSPeter Avalos.Nm posix_spawnattr_init ,
42c4dd129bSPeter Avalos.Nm posix_spawnattr_destroy
43c4dd129bSPeter Avalos.Nd "initialize and destroy spawn attributes object"
44c4dd129bSPeter Avalos.Sh LIBRARY
45c4dd129bSPeter Avalos.Lb libc
46c4dd129bSPeter Avalos.Sh SYNOPSIS
47c4dd129bSPeter Avalos.In spawn.h
48c4dd129bSPeter Avalos.Ft int
49c4dd129bSPeter Avalos.Fn posix_spawnattr_init "posix_spawnattr_t * attr"
50c4dd129bSPeter Avalos.Ft int
51c4dd129bSPeter Avalos.Fn posix_spawnattr_destroy "posix_spawnattr_t * attr"
52c4dd129bSPeter Avalos.Sh DESCRIPTION
53c4dd129bSPeter AvalosThe
54c4dd129bSPeter Avalos.Fn posix_spawnattr_init
55c4dd129bSPeter Avalosfunction initializes a spawn attributes object
56c4dd129bSPeter Avalos.Fa attr
57c4dd129bSPeter Avaloswith the default value for all of the individual attributes used by the
58c4dd129bSPeter Avalosimplementation.
59c4dd129bSPeter AvalosInitializing an already initialized spawn attributes object may cause
60c4dd129bSPeter Avalosmemory to be leaked.
61c4dd129bSPeter Avalos.Pp
62c4dd129bSPeter AvalosThe
63c4dd129bSPeter Avalos.Fn posix_spawnattr_destroy
64c4dd129bSPeter Avalosfunction destroys a spawn attributes object.
65c4dd129bSPeter AvalosA destroyed
66c4dd129bSPeter Avalos.Fa attr
67c4dd129bSPeter Avalosattributes object can be reinitialized using
68c4dd129bSPeter Avalos.Fn posix_spawnattr_init .
69c4dd129bSPeter AvalosThe object should not be used after it has been destroyed.
70c4dd129bSPeter Avalos.Pp
71c4dd129bSPeter AvalosA spawn attributes object is of type
72c4dd129bSPeter Avalos.Vt posix_spawnattr_t
73c4dd129bSPeter Avalos(defined in
74c4dd129bSPeter Avalos.In spawn.h )
75c4dd129bSPeter Avalosand is used to specify the inheritance of process attributes across a
76c4dd129bSPeter Avalosspawn operation.
77c4dd129bSPeter Avalos.Pp
78c4dd129bSPeter AvalosThe resulting spawn attributes object (possibly modified by setting
79c4dd129bSPeter Avalosindividual attribute values), is used to modify the behavior of
80c4dd129bSPeter Avalos.Fn posix_spawn
81c4dd129bSPeter Avalosor
82c4dd129bSPeter Avalos.Fn posix_spawnp .
83c4dd129bSPeter AvalosAfter a spawn attributes object has been used to spawn a process by a
84c4dd129bSPeter Avaloscall to a
85c4dd129bSPeter Avalos.Fn posix_spawn
86c4dd129bSPeter Avalosor
87c4dd129bSPeter Avalos.Fn posix_spawnp ,
88c4dd129bSPeter Avalosany function affecting the attributes object (including destruction)
89c4dd129bSPeter Avaloswill not affect any process that has been spawned in this way.
90c4dd129bSPeter Avalos.Sh RETURN VALUES
91c4dd129bSPeter AvalosUpon successful completion,
92c4dd129bSPeter Avalos.Fn posix_spawnattr_init
93c4dd129bSPeter Avalosand
94c4dd129bSPeter Avalos.Fn posix_spawnattr_destroy
95c4dd129bSPeter Avalosreturn zero;
96c4dd129bSPeter Avalosotherwise, an error number is returned to indicate the error.
97c4dd129bSPeter Avalos.Sh ERRORS
98c4dd129bSPeter AvalosThe
99c4dd129bSPeter Avalos.Fn posix_spawnattr_init
100c4dd129bSPeter Avalosfunction will fail if:
101c4dd129bSPeter Avalos.Bl -tag -width Er
102c4dd129bSPeter Avalos.It Bq Er ENOMEM
103c4dd129bSPeter AvalosInsufficient memory exists to initialize the spawn file actions object.
104c4dd129bSPeter Avalos.El
105c4dd129bSPeter Avalos.Sh SEE ALSO
106c4dd129bSPeter Avalos.Xr posix_spawn 3 ,
107c4dd129bSPeter Avalos.Xr posix_spawnp 3
108c4dd129bSPeter Avalos.Sh STANDARDS
109c4dd129bSPeter AvalosThe
110c4dd129bSPeter Avalos.Fn posix_spawnattr_init
111c4dd129bSPeter Avalosand
112c4dd129bSPeter Avalos.Fn posix_spawnattr_destroy
113c4dd129bSPeter Avalosfunctions conform to
114c4dd129bSPeter Avalos.St -p1003.1-2001 .
115c4dd129bSPeter Avalos.Sh HISTORY
116c4dd129bSPeter AvalosThe
117c4dd129bSPeter Avalos.Fn posix_spawnattr_init
118c4dd129bSPeter Avalosand
119c4dd129bSPeter Avalos.Fn posix_spawnattr_destroy
120c4dd129bSPeter Avalosfunctions first appeared in
121c4dd129bSPeter Avalos.Fx 8.0 .
122c4dd129bSPeter Avalos.Sh AUTHORS
123*c9c6988bSSascha Wildner.An \&Ed Schouten Aq Mt ed@FreeBSD.org
124