1POSIX_SPAWNATTR_DESTROY(3P)POSIX Programmer's ManualPOSIX_SPAWNATTR_DESTROY(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 posix_spawnattr_destroy, posix_spawnattr_init — destroy and initialize
13 spawn attributes object (ADVANCED REALTIME)
14
16 #include <spawn.h>
17
18 int posix_spawnattr_destroy(posix_spawnattr_t *attr);
19 int posix_spawnattr_init(posix_spawnattr_t *attr);
20
22 The posix_spawnattr_destroy() function shall destroy a spawn attributes
23 object. A destroyed attr attributes object can be reinitialized using
24 posix_spawnattr_init(); the results of otherwise referencing the object
25 after it has been destroyed are undefined. An implementation may cause
26 posix_spawnattr_destroy() to set the object referenced by attr to an
27 invalid value.
28
29 The posix_spawnattr_init() function shall initialize a spawn attributes
30 object attr with the default value for all of the individual attributes
31 used by the implementation. Results are undefined if posix_spaw‐
32 nattr_init() is called specifying an already initialized attr
33 attributes object.
34
35 A spawn attributes object is of type posix_spawnattr_t (defined in
36 <spawn.h>) and is used to specify the inheritance of process attributes
37 across a spawn operation. POSIX.1‐2008 does not define comparison or
38 assignment operators for the type posix_spawnattr_t.
39
40 Each implementation shall document the individual attributes it uses
41 and their default values unless these values are defined by
42 POSIX.1‐2008. Attributes not defined by POSIX.1‐2008, their default
43 values, and the names of the associated functions to get and set those
44 attribute values are implementation-defined.
45
46 The resulting spawn attributes object (possibly modified by setting
47 individual attribute values), is used to modify the behavior of
48 posix_spawn() or posix_spawnp(). After a spawn attributes object has
49 been used to spawn a process by a call to a posix_spawn() or
50 posix_spawnp(), any function affecting the attributes object (including
51 destruction) shall not affect any process that has been spawned in this
52 way.
53
55 Upon successful completion, posix_spawnattr_destroy() and posix_spaw‐
56 nattr_init() shall return zero; otherwise, an error number shall be
57 returned to indicate the error.
58
60 The posix_spawnattr_init() function shall fail if:
61
62 ENOMEM Insufficient memory exists to initialize the spawn attributes
63 object.
64
65 The posix_spawnattr_destroy() function may fail if:
66
67 EINVAL The value specified by attr is invalid.
68
69 The following sections are informative.
70
72 None.
73
75 These functions are part of the Spawn option and need not be provided
76 on all implementations.
77
79 The original spawn interface proposed in POSIX.1‐2008 defined the
80 attributes that specify the inheritance of process attributes across a
81 spawn operation as a structure. In order to be able to separate
82 optional individual attributes under their appropriate options (that
83 is, the spawn-schedparam and spawn-schedpolicy attributes depending
84 upon the Process Scheduling option), and also for extensibility and
85 consistency with the newer POSIX interfaces, the attributes interface
86 has been changed to an opaque data type. This interface now consists of
87 the type posix_spawnattr_t, representing a spawn attributes object,
88 together with associated functions to initialize or destroy the
89 attributes object, and to set or get each individual attribute.
90 Although the new object-oriented interface is more verbose than the
91 original structure, it is simple to use, more extensible, and easy to
92 implement.
93
95 None.
96
98 posix_spawn(), posix_spawnattr_getsigdefault(), posix_spawnattr_get‐
99 flags(), posix_spawnattr_getpgroup(), posix_spawnattr_getschedparam(),
100 posix_spawnattr_getschedpolicy(), posix_spawnattr_getsigmask()
101
102 The Base Definitions volume of POSIX.1‐2017, <spawn.h>
103
105 Portions of this text are reprinted and reproduced in electronic form
106 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
107 table Operating System Interface (POSIX), The Open Group Base Specifi‐
108 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
109 Electrical and Electronics Engineers, Inc and The Open Group. In the
110 event of any discrepancy between this version and the original IEEE and
111 The Open Group Standard, the original IEEE and The Open Group Standard
112 is the referee document. The original Standard can be obtained online
113 at http://www.opengroup.org/unix/online.html .
114
115 Any typographical or formatting errors that appear in this page are
116 most likely to have been introduced during the conversion of the source
117 files to man page format. To report such errors, see https://www.ker‐
118 nel.org/doc/man-pages/reporting_bugs.html .
119
120
121
122IEEE/The Open Group 2017 POSIX_SPAWNATTR_DESTROY(3P)