1.\"	$OpenBSD: posix_spawn_file_actions_init.3,v 1.7 2013/08/14 06:32:27 jmc Exp $
2.\"
3.\" Copyright (c) 2012 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: August 14 2013 $
18.Dt POSIX_SPAWN_FILE_ACTIONS_INIT 3
19.Os
20.Sh NAME
21.Nm posix_spawn_file_actions_init ,
22.Nm posix_spawn_file_actions_destroy
23.Nd create and destroy posix_spawn file actions objects
24.Sh SYNOPSIS
25.In spawn.h
26.Ft int
27.Fn posix_spawn_file_actions_init "posix_spawn_file_actions_t *file_actions"
28.Ft int
29.Fn posix_spawn_file_actions_destroy "posix_spawn_file_actions_t *file_actions"
30.Sh DESCRIPTION
31File actions objects can be initialized by
32.Fn posix_spawn_file_actions_init
33and destroyed by
34.Fn posix_spawn_file_actions_destroy .
35.Pp
36Multiple initialization of the same object is undefined behavior
37and will lead to memory leaks.
38.Pp
39Similarly, objects should be passed to
40.Fn posix_spawn_file_actions_destroy
41to reclaim memory.
42The object should not be re-used after destruction.
43It can however be initialized again with
44.Fn posix_spawn_file_actions_init .
45.Sh RETURN VALUES
46These function return 0 on successful completion.
47They may return
48.Er ENOMEM
49when running out of memory.
50.Sh SEE ALSO
51.Xr posix_spawn 3 ,
52.Xr posix_spawn_file_actions_addopen 3
53.Sh STANDARDS
54Both functions conform to
55.St -p1003.1-2001 .
56.Sh AUTHORS
57.An Ed Schouten Aq Mt ed@FreeBSD.org
58