xref: /minix3/lib/libc/gen/posix_spawn_file_actions_init.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\" $NetBSD: posix_spawn_file_actions_init.3,v 1.5 2014/02/02 16:59:13 wiz 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_spawn_file_actions_init.3,v 1.1.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $
38f14fb602SLionel Sambuc.\"
39*0a6a1f1dSLionel Sambuc.Dd February 2, 2014
40f14fb602SLionel Sambuc.Dt POSIX_SPAWN_FILE_ACTIONS_INIT 3
41f14fb602SLionel Sambuc.Os
42f14fb602SLionel Sambuc.Sh NAME
43f14fb602SLionel Sambuc.Nm posix_spawn_file_actions_init ,
44f14fb602SLionel Sambuc.Nm posix_spawn_file_actions_destroy
45f14fb602SLionel Sambuc.Nd "initialize and destroy spawn file actions 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_spawn_file_actions_init "posix_spawn_file_actions_t * file_actions"
52f14fb602SLionel Sambuc.Ft int
53f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_destroy "posix_spawn_file_actions_t * file_actions"
54f14fb602SLionel Sambuc.Sh DESCRIPTION
55f14fb602SLionel SambucThe
56f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_init
57f14fb602SLionel Sambucfunction initialize the object referenced by
58f14fb602SLionel Sambuc.Fn file_actions
59f14fb602SLionel Sambucto contain no file actions for
60f14fb602SLionel Sambuc.Fn posix_spawn
61f14fb602SLionel Sambucor
62f14fb602SLionel Sambuc.Fn posix_spawnp .
63f14fb602SLionel SambucInitializing an already initialized spawn file actions object may cause
64f14fb602SLionel Sambucmemory to be leaked.
65f14fb602SLionel Sambuc.Pp
66f14fb602SLionel SambucThe
67f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_destroy
68f14fb602SLionel Sambucfunction destroy the object referenced by
69f14fb602SLionel Sambuc.Fa file_actions ;
70f14fb602SLionel Sambucthe object becomes, in effect, uninitialized.
71f14fb602SLionel SambucA destroyed spawn file actions object can be reinitialized using
72f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_init .
73f14fb602SLionel SambucThe object should not be used after it has been destroyed.
74f14fb602SLionel Sambuc.Sh RETURN VALUES
75f14fb602SLionel SambucUpon successful completion, these functions return zero;
76f14fb602SLionel Sambucotherwise, an error number is returned to indicate the error.
77f14fb602SLionel Sambuc.Sh ERRORS
78f14fb602SLionel SambucThe
79f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_init
80f14fb602SLionel Sambucfunction will fail if:
81f14fb602SLionel Sambuc.Bl -tag -width Er
82*0a6a1f1dSLionel Sambuc.It Bq Er EINVAL
83*0a6a1f1dSLionel SambucThe value specified by
84*0a6a1f1dSLionel Sambuc.Fa file_actions
85*0a6a1f1dSLionel Sambucis invalid.
86f14fb602SLionel Sambuc.It Bq Er ENOMEM
87f14fb602SLionel SambucInsufficient memory exists to initialize the spawn file actions object.
88f14fb602SLionel Sambuc.El
89f14fb602SLionel Sambuc.Sh SEE ALSO
90f14fb602SLionel Sambuc.Xr posix_spawn 3 ,
91f14fb602SLionel Sambuc.Xr posix_spawn_file_actions_addclose 3 ,
92f14fb602SLionel Sambuc.Xr posix_spawn_file_actions_adddup2 3 ,
93f14fb602SLionel Sambuc.Xr posix_spawn_file_actions_addopen 3 ,
94f14fb602SLionel Sambuc.Xr posix_spawnp 3
95f14fb602SLionel Sambuc.Sh STANDARDS
96f14fb602SLionel SambucThe
97f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_init
98f14fb602SLionel Sambucand
99f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_destroy
100f14fb602SLionel Sambucfunctions conform to
101f14fb602SLionel Sambuc.St -p1003.1-2001 .
102f14fb602SLionel Sambuc.Sh HISTORY
103f14fb602SLionel SambucThe
104f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_init
105f14fb602SLionel Sambucand
106f14fb602SLionel Sambuc.Fn posix_spawn_file_actions_destroy
107f14fb602SLionel Sambucfunctions first appeared in
108f14fb602SLionel Sambuc.Fx 8.0
109f14fb602SLionel Sambucand imported for
110f14fb602SLionel Sambuc.Nx 6.0 .
111f14fb602SLionel Sambuc.Sh AUTHORS
11284d9c625SLionel Sambuc.An Ed Schouten Aq Mt ed@FreeBSD.org
113