I've written this patch that packs posix_spawn file actions into the posix_spawn_file_actions struct padding. I'm not sure if the way I've split the code up is desirable. Maybe the faexpand() function needs a different name and to be in its own .c file; or maybe a different approach is preferable. I've only lightly tested it but it seems to work just fine as-is. The whole explanation of how it works can be found in the patch file.