1posix_spawn_file_actions_aSdtdadnudpa2r(d3CC)LibrarypoFsuinxc_tsipoanwsn_file_actions_adddup2(3C)
2
3
4

NAME

6       posix_spawn_file_actions_adddup2  -  add  dup2  action  to  spawn  file
7       actions object
8

SYNOPSIS

10       #include <spawn.h>
11
12       int posix_spawn_file_actions_adddup2(
13            posix_spawn_file_actions_t *file_actions, int fildes,
14            int newfildes);
15
16

DESCRIPTION

18       The posix_spawn_file_actions_adddup2() function adds a dup2(3C)  action
19       to  the object referenced by file_actions that causes the file descrip‐
20       tor fildes to be duplicated as newfildes (as if dup2(fildes, newfildes)
21       had  been called) when a new process is spawned using this file actions
22       object.
23
24
25       A    spawn    file    actions    object    is     as     defined     in
26       posix_spawn_file_actions_addclose(3C).
27

RETURN VALUES

29       Upon   successful  completion,  the  posix_spawn_file_actions_adddup2()
30       function returns 0. Otherwise, an error number is be returned to  indi‐
31       cate the error.
32

ERRORS

34       The posix_spawn_file_actions_adddup2() function will fail if:
35
36       EBADF     The  value  specified  by  fildes or newfildes is negative or
37                 greater than or equal to {OPEN_MAX}.
38
39
40       ENOMEM    Insufficient memory exists to add to the spawn  file  actions
41                 object.
42
43
44
45       The posix_spawn_file_actions_adddup2() function may fail if:
46
47       EINVAL    The value specified by file_actions is invalid.
48
49
50
51       It  is  not  considered  an  error  for  the  fildes argument passed to
52       posix_spawn_file_actions_adddup2() to specify  a  file  descriptor  for
53       which the specified operation could not be performed at the time of the
54       call. Any such error will be detected when the associated file  actions
55       object is later used during a posix_spawn(3C) or posix_spawnp(3C) oper‐
56       ation.
57

ATTRIBUTES

59       See attributes(5) for descriptions of the following attributes:
60
61
62
63
64       ┌─────────────────────────────┬─────────────────────────────┐
65       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
66       ├─────────────────────────────┼─────────────────────────────┤
67       │Interface Stability          │Standard                     │
68       ├─────────────────────────────┼─────────────────────────────┤
69       │MT-Level                     │MT-Safe                      │
70       └─────────────────────────────┴─────────────────────────────┘
71

SEE ALSO

73       dup2(3C),    posix_spawn(3C),    posix_spawn_file_actions_addclose(3C),
74       posix_spawn_file_actions_destroy(3C), attributes(5), standards(5)
75
76
77
78SunOS 5.11                        30 Jan 20p0o4six_spawn_file_actions_adddup2(3C)
Impressum