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