1POSIX_SPAWNATTR_DESTROY(P) POSIX Programmer's ManualPOSIX_SPAWNATTR_DESTROY(P)
2
3
4

NAME

6       posix_spawnattr_destroy,  posix_spawnattr_init - destroy and initialize
7       spawn attributes object (ADVANCED REALTIME)
8

SYNOPSIS

10       #include <spawn.h>
11
12       int posix_spawnattr_destroy(posix_spawnattr_t *attr);
13       int posix_spawnattr_init(posix_spawnattr_t *attr);
14
15

DESCRIPTION

17       The posix_spawnattr_destroy() function shall destroy a spawn attributes
18       object.  A  destroyed attr attributes object can be reinitialized using
19       posix_spawnattr_init(); the results of otherwise referencing the object
20       after  it has been destroyed are undefined. An implementation may cause
21       posix_spawnattr_destroy() to set the object referenced by  attr  to  an
22       invalid value.
23
24       The posix_spawnattr_init() function shall initialize a spawn attributes
25       object attr with the default value for all of the individual attributes
26       used  by  the  implementation.  Results  are  undefined  if posix_spaw‐
27       nattr_init()  is  called  specifying  an   already   initialized   attr
28       attributes object.
29
30       A  spawn  attributes  object  is  of type posix_spawnattr_t (defined in
31       <spawn.h>) and is used to specify the inheritance of process attributes
32       across a spawn operation. IEEE Std 1003.1-2001 does not define compari‐
33       son or assignment operators for the type posix_spawnattr_t.
34
35       Each implementation shall document the individual  attributes  it  uses
36       and   their   default   values  unless  these  values  are  defined  by
37       IEEE Std 1003.1-2001. Attributes not defined  by  IEEE Std 1003.1-2001,
38       their  default values, and the names of the associated functions to get
39       and set those attribute values are implementation-defined.
40
41       The resulting spawn attributes object  (possibly  modified  by  setting
42       individual  attribute  values),  is  used  to  modify  the  behavior of
43       posix_spawn() or posix_spawnp(). After a spawn  attributes  object  has
44       been  used  to  spawn  a  process  by  a  call  to  a  posix_spawn() or
45       posix_spawnp(), any function affecting the attributes object (including
46       destruction) shall not affect any process that has been spawned in this
47       way.
48

RETURN VALUE

50       Upon successful completion, posix_spawnattr_destroy()  and  posix_spaw‐
51       nattr_init()  shall  return  zero;  otherwise, an error number shall be
52       returned to indicate the error.
53

ERRORS

55       The posix_spawnattr_init() function shall fail if:
56
57       ENOMEM Insufficient memory exists to initialize  the  spawn  attributes
58              object.
59
60
61       The posix_spawnattr_destroy() function may fail if:
62
63       EINVAL The value specified by attr is invalid.
64
65
66       The following sections are informative.
67

EXAMPLES

69       None.
70

APPLICATION USAGE

72       These  functions  are part of the Spawn option and need not be provided
73       on all implementations.
74

RATIONALE

76       The original spawn interface proposed in  IEEE Std 1003.1-2001  defined
77       the  attributes  that  specify  the  inheritance  of process attributes
78       across a spawn operation as a structure. In order to be able  to  sepa‐
79       rate  optional  individual  attributes  under their appropriate options
80       (that is, the spawn-schedparam and spawn-schedpolicy attributes depend‐
81       ing upon the Process Scheduling option), and also for extensibility and
82       consistency with the newer POSIX interfaces, the  attributes  interface
83       has been changed to an opaque data type. This interface now consists of
84       the type posix_spawnattr_t, representing  a  spawn  attributes  object,
85       together  with  associated  functions  to  initialize  or  destroy  the
86       attributes object,  and  to  set  or  get  each  individual  attribute.
87       Although  the  new  object-oriented  interface is more verbose than the
88       original structure, it is simple to use, more extensible, and  easy  to
89       implement.
90

FUTURE DIRECTIONS

92       None.
93

SEE ALSO

95       posix_spawn()  , posix_spawnattr_getsigdefault() , posix_spawnattr_get‐
96       flags() , posix_spawnattr_getpgroup() , posix_spawnattr_getschedparam()
97       ,  posix_spawnattr_getschedpolicy()  ,  posix_spawnattr_getsigmask()  ,
98       posix_spawnattr_setsigdefault()    ,    posix_spawnattr_setflags()    ,
99       posix_spawnattr_setpgroup()     ,     posix_spawnattr_setsigmask()    ,
100       posix_spawnattr_setschedpolicy()  ,  posix_spawnattr_setschedparam()  ,
101       posix_spawnp()  ,  the Base Definitions volume of IEEE Std 1003.1-2001,
102       <spawn.h>
103
105       Portions of this text are reprinted and reproduced in  electronic  form
106       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
107       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
108       Specifications  Issue  6,  Copyright  (C) 2001-2003 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
116
117IEEE/The Open Group                  2003           POSIX_SPAWNATTR_DESTROY(P)
Impressum