spawn_int.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (C) 2000, 2008-2013 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #include <sys/types.h>
  14. /* Data structure to contain the action information. */
  15. struct __spawn_action
  16. {
  17. enum
  18. {
  19. spawn_do_close,
  20. spawn_do_dup2,
  21. spawn_do_open
  22. } tag;
  23. union
  24. {
  25. struct
  26. {
  27. int fd;
  28. } close_action;
  29. struct
  30. {
  31. int fd;
  32. int newfd;
  33. } dup2_action;
  34. struct
  35. {
  36. int fd;
  37. const char *path;
  38. int oflag;
  39. mode_t mode;
  40. } open_action;
  41. } action;
  42. };
  43. #if !_LIBC
  44. # define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc
  45. #endif
  46. extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
  47. file_actions);
  48. #if !_LIBC
  49. # define __spawni gl_posix_spawn_internal
  50. #endif
  51. extern int __spawni (pid_t *pid, const char *path,
  52. const posix_spawn_file_actions_t *file_actions,
  53. const posix_spawnattr_t *attrp, char *const argv[],
  54. char *const envp[], int use_path);