xref: /freebsd/lib/libc/gen/posix_spawn_file_actions_init.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
162187b41SDavid Xu.\" Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
262187b41SDavid Xu.\" All rights reserved.
362187b41SDavid Xu.\"
462187b41SDavid Xu.\" Redistribution and use in source and binary forms, with or without
562187b41SDavid Xu.\" modification, are permitted provided that the following conditions
662187b41SDavid Xu.\" are met:
762187b41SDavid Xu.\" 1. Redistributions of source code must retain the above copyright
862187b41SDavid Xu.\"    notice, this list of conditions and the following disclaimer.
962187b41SDavid Xu.\" 2. Redistributions in binary form must reproduce the above copyright
1062187b41SDavid Xu.\"    notice, this list of conditions and the following disclaimer in the
1162187b41SDavid Xu.\"    documentation and/or other materials provided with the distribution.
1262187b41SDavid Xu.\"
1362187b41SDavid Xu.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1462187b41SDavid Xu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1562187b41SDavid Xu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1662187b41SDavid Xu.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1762187b41SDavid Xu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1862187b41SDavid Xu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1962187b41SDavid Xu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2062187b41SDavid Xu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2162187b41SDavid Xu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2262187b41SDavid Xu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2362187b41SDavid Xu.\" SUCH DAMAGE.
2462187b41SDavid Xu.\"
2562187b41SDavid Xu.\" Portions of this text are reprinted and reproduced in electronic form
2662187b41SDavid Xu.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology --
2762187b41SDavid Xu.\" Portable Operating System Interface (POSIX), The Open Group Base
2862187b41SDavid Xu.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
2962187b41SDavid Xu.\" Electrical and Electronics Engineers, Inc and The Open Group.  In the
3062187b41SDavid Xu.\" event of any discrepancy between this version and the original IEEE and
3162187b41SDavid Xu.\" The Open Group Standard, the original IEEE and The Open Group Standard is
3262187b41SDavid Xu.\" the referee document.  The original Standard can be obtained online at
3362187b41SDavid Xu.\"	http://www.opengroup.org/unix/online.html.
3462187b41SDavid Xu.\"
35bd44dce5SKonstantin Belousov.Dd November 28, 2021
3662187b41SDavid Xu.Dt POSIX_SPAWN_FILE_ACTIONS_INIT 3
3762187b41SDavid Xu.Os
3862187b41SDavid Xu.Sh NAME
3962187b41SDavid Xu.Nm posix_spawn_file_actions_init ,
4062187b41SDavid Xu.Nm posix_spawn_file_actions_destroy
4162187b41SDavid Xu.Nd "initialize and destroy spawn file actions object"
4262187b41SDavid Xu.Sh LIBRARY
4362187b41SDavid Xu.Lb libc
4462187b41SDavid Xu.Sh SYNOPSIS
4562187b41SDavid Xu.In spawn.h
4662187b41SDavid Xu.Ft int
4762187b41SDavid Xu.Fn posix_spawn_file_actions_init "posix_spawn_file_actions_t * file_actions"
4862187b41SDavid Xu.Ft int
4962187b41SDavid Xu.Fn posix_spawn_file_actions_destroy "posix_spawn_file_actions_t * file_actions"
5062187b41SDavid Xu.Sh DESCRIPTION
5162187b41SDavid XuThe
5262187b41SDavid Xu.Fn posix_spawn_file_actions_init
5362187b41SDavid Xufunction initialize the object referenced by
5462187b41SDavid Xu.Fn file_actions
5562187b41SDavid Xuto contain no file actions for
5662187b41SDavid Xu.Fn posix_spawn
5762187b41SDavid Xuor
5862187b41SDavid Xu.Fn posix_spawnp .
5962187b41SDavid XuInitializing an already initialized spawn file actions object may cause
6062187b41SDavid Xumemory to be leaked.
6162187b41SDavid Xu.Pp
6262187b41SDavid XuThe
6362187b41SDavid Xu.Fn posix_spawn_file_actions_destroy
6462187b41SDavid Xufunction destroy the object referenced by
6562187b41SDavid Xu.Fa file_actions ;
6662187b41SDavid Xuthe object becomes, in effect, uninitialized.
6762187b41SDavid XuA destroyed spawn file actions object can be reinitialized using
6862187b41SDavid Xu.Fn posix_spawn_file_actions_init .
6962187b41SDavid XuThe object should not be used after it has been destroyed.
7062187b41SDavid Xu.Sh RETURN VALUES
7162187b41SDavid XuUpon successful completion, these functions return zero;
7262187b41SDavid Xuotherwise, an error number is returned to indicate the error.
7362187b41SDavid Xu.Sh ERRORS
7462187b41SDavid XuThe
7562187b41SDavid Xu.Fn posix_spawn_file_actions_init
7662187b41SDavid Xufunction will fail if:
7762187b41SDavid Xu.Bl -tag -width Er
7862187b41SDavid Xu.It Bq Er ENOMEM
7962187b41SDavid XuInsufficient memory exists to initialize the spawn file actions object.
8062187b41SDavid Xu.El
8162187b41SDavid Xu.Sh SEE ALSO
8262187b41SDavid Xu.Xr posix_spawn 3 ,
8362187b41SDavid Xu.Xr posix_spawn_file_actions_addclose 3 ,
84*78963d79SKonstantin Belousov.Xr posix_spawn_file_actions_addclosefrom_np 3 ,
8562187b41SDavid Xu.Xr posix_spawn_file_actions_adddup2 3 ,
8662187b41SDavid Xu.Xr posix_spawn_file_actions_addopen 3 ,
8762187b41SDavid Xu.Xr posix_spawnp 3
8862187b41SDavid Xu.Sh STANDARDS
8962187b41SDavid XuThe
9062187b41SDavid Xu.Fn posix_spawn_file_actions_init
9162187b41SDavid Xuand
9262187b41SDavid Xu.Fn posix_spawn_file_actions_destroy
9362187b41SDavid Xufunctions conform to
9462187b41SDavid Xu.St -p1003.1-2001 .
9562187b41SDavid Xu.Sh HISTORY
9662187b41SDavid XuThe
9762187b41SDavid Xu.Fn posix_spawn_file_actions_init
9862187b41SDavid Xuand
9962187b41SDavid Xu.Fn posix_spawn_file_actions_destroy
10062187b41SDavid Xufunctions first appeared in
10162187b41SDavid Xu.Fx 8.0 .
10262187b41SDavid Xu.Sh AUTHORS
10318c5321dSBaptiste Daroussin.An \&Ed Schouten Aq Mt ed@FreeBSD.org
104