1POSIX_SPAWN_FILE_ACTIONS_ADDPDOUSPI2X(3PPr)ogrammerP'OsSIMXa_nSuPaAlWN_FILE_ACTIONS_ADDDUP2(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_spawn_file_actions_adddup2 - add dup2 action to spawn file
13 actions object (ADVANCED REALTIME)
14
16 #include <spawn.h>
17
18 int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *
19 file_actions, int fildes, int newfildes);
20
21
23 The posix_spawn_file_actions_adddup2() function shall add a dup2()
24 action to the object referenced by file_actions that shall cause the
25 file descriptor fildes to be duplicated as newfildes (as if dup2(
26 fildes, newfildes) had been called) when a new process is spawned using
27 this file actions object.
28
29 A spawn file actions object is as defined in
30 posix_spawn_file_actions_addclose() .
31
33 Upon successful completion, the posix_spawn_file_actions_adddup2()
34 function shall return zero; otherwise, an error number shall be
35 returned to indicate the error.
36
38 The posix_spawn_file_actions_adddup2() function shall fail if:
39
40 EBADF The value specified by fildes or newfildes is negative or
41 greater than or equal to {OPEN_MAX}.
42
43 ENOMEM Insufficient memory exists to add to the spawn file actions
44 object.
45
46
47 The posix_spawn_file_actions_adddup2() function may fail if:
48
49 EINVAL The value specified by file_actions is invalid.
50
51
52 It shall not be considered an error for the fildes argument passed to
53 the posix_spawn_file_actions_adddup2() function to specify a file
54 descriptor for which the specified operation could not be performed at
55 the time of the call. Any such error will be detected when the associ‐
56 ated file actions object is later used during a posix_spawn() or
57 posix_spawnp() operation.
58
59 The following sections are informative.
60
62 None.
63
65 The posix_spawn_file_actions_adddup2() function is part of the Spawn
66 option and need not be provided on all implementations.
67
69 Refer to the RATIONALE in posix_spawn_file_actions_addclose() .
70
72 None.
73
75 dup(), posix_spawn(), posix_spawn_file_actions_addclose(),
76 posix_spawn_file_actions_destroy(), posix_spawnp(), the Base Defini‐
77 tions volume of IEEE Std 1003.1-2001, <spawn.h>
78
80 Portions of this text are reprinted and reproduced in electronic form
81 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
82 -- Portable Operating System Interface (POSIX), The Open Group Base
83 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
84 Electrical and Electronics Engineers, Inc and The Open Group. In the
85 event of any discrepancy between this version and the original IEEE and
86 The Open Group Standard, the original IEEE and The Open Group Standard
87 is the referee document. The original Standard can be obtained online
88 at http://www.opengroup.org/unix/online.html .
89
90
91
92IEEE/The Open Group 2003 POSIX_SPAWN_FILE_ACTIONS_ADDDUP2(3P)