#define FDOP_CLOSE 1 #define FDOP_DUP2 2 #define FDOP_OPEN 3 #define FDOP_CHDIR 4 #define FDOP_FCHDIR 5 #define malloc __libc_malloc #define calloc __libc_calloc #define realloc undef #define free __libc_free static inline int faexpand(posix_spawn_file_actions_t *fa, size_t str) { posix_spawn_file_actions_t *n, *blk; blk = malloc(sizeof *blk + str); if (!blk) return -1; *blk = *fa; n = fa->__actions; fa->__actions = blk; blk->__actions = n->__actions; n->__actions = blk; fa->__pad0[0] = 0; return 0; }