xref: /dflybsd-src/lib/libc/gen/posix_spawn_file_actions_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_spawn_file_actions_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_SPAWN_FILE_ACTIONS_INIT 3
39c4dd129bSPeter Avalos.Os
40c4dd129bSPeter Avalos.Sh NAME
41c4dd129bSPeter Avalos.Nm posix_spawn_file_actions_init ,
42c4dd129bSPeter Avalos.Nm posix_spawn_file_actions_destroy
43c4dd129bSPeter Avalos.Nd "initialize and destroy spawn file actions 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_spawn_file_actions_init "posix_spawn_file_actions_t * file_actions"
50c4dd129bSPeter Avalos.Ft int
51c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_destroy "posix_spawn_file_actions_t * file_actions"
52c4dd129bSPeter Avalos.Sh DESCRIPTION
53c4dd129bSPeter AvalosThe
54c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_init
55c4dd129bSPeter Avalosfunction initialize the object referenced by
5627292f35SSascha Wildner.Fa file_actions
57c4dd129bSPeter Avalosto contain no file actions for
58c4dd129bSPeter Avalos.Fn posix_spawn
59c4dd129bSPeter Avalosor
60c4dd129bSPeter Avalos.Fn posix_spawnp .
61c4dd129bSPeter AvalosInitializing an already initialized spawn file actions object may cause
62c4dd129bSPeter Avalosmemory to be leaked.
63c4dd129bSPeter Avalos.Pp
64c4dd129bSPeter AvalosThe
65c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_destroy
66c4dd129bSPeter Avalosfunction destroy the object referenced by
67c4dd129bSPeter Avalos.Fa file_actions ;
68c4dd129bSPeter Avalosthe object becomes, in effect, uninitialized.
69c4dd129bSPeter AvalosA destroyed spawn file actions object can be reinitialized using
70c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_init .
71c4dd129bSPeter AvalosThe object should not be used after it has been destroyed.
72c4dd129bSPeter Avalos.Sh RETURN VALUES
73c4dd129bSPeter AvalosUpon successful completion, these functions return zero;
74c4dd129bSPeter Avalosotherwise, an error number is returned to indicate the error.
75c4dd129bSPeter Avalos.Sh ERRORS
76c4dd129bSPeter AvalosThe
77c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_init
78c4dd129bSPeter Avalosfunction will fail if:
79c4dd129bSPeter Avalos.Bl -tag -width Er
80c4dd129bSPeter Avalos.It Bq Er ENOMEM
81c4dd129bSPeter AvalosInsufficient memory exists to initialize the spawn file actions object.
82c4dd129bSPeter Avalos.El
83c4dd129bSPeter Avalos.Sh SEE ALSO
84c4dd129bSPeter Avalos.Xr posix_spawn 3 ,
85c4dd129bSPeter Avalos.Xr posix_spawn_file_actions_addclose 3 ,
86c4dd129bSPeter Avalos.Xr posix_spawn_file_actions_adddup2 3 ,
87c4dd129bSPeter Avalos.Xr posix_spawn_file_actions_addopen 3 ,
88c4dd129bSPeter Avalos.Xr posix_spawnp 3
89c4dd129bSPeter Avalos.Sh STANDARDS
90c4dd129bSPeter AvalosThe
91c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_init
92c4dd129bSPeter Avalosand
93c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_destroy
94c4dd129bSPeter Avalosfunctions conform to
95c4dd129bSPeter Avalos.St -p1003.1-2001 .
96c4dd129bSPeter Avalos.Sh HISTORY
97c4dd129bSPeter AvalosThe
98c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_init
99c4dd129bSPeter Avalosand
100c4dd129bSPeter Avalos.Fn posix_spawn_file_actions_destroy
101c4dd129bSPeter Avalosfunctions first appeared in
102c4dd129bSPeter Avalos.Fx 8.0 .
103c4dd129bSPeter Avalos.Sh AUTHORS
104*c9c6988bSSascha Wildner.An \&Ed Schouten Aq Mt ed@FreeBSD.org
105