This source file includes following definitions.
- __posix_spawn_file_actions_realloc
- posix_spawn_file_actions_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19
20 #include <spawn.h>
21
22 #include <errno.h>
23 #include <stdlib.h>
24 #include <string.h>
25
26 #include "spawn_int.h"
27
28
29
30
31 int
32 __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *file_actions)
33 {
34 int newalloc = file_actions->_allocated + 8;
35 void *newmem = realloc (file_actions->_actions,
36 newalloc * sizeof (struct __spawn_action));
37
38 if (newmem == NULL)
39
40 return ENOMEM;
41
42 file_actions->_actions = (struct __spawn_action *) newmem;
43 file_actions->_allocated = newalloc;
44
45 return 0;
46 }
47
48
49
50 int
51 posix_spawn_file_actions_init (posix_spawn_file_actions_t *file_actions)
52 {
53
54 memset (file_actions, '\0', sizeof (*file_actions));
55 return 0;
56 }