xsystem.h 993 B

12345678910111213141516171819202122232425262728293031
  1. /* xsystem.h - system(3) with error messages
  2. Carl D. Worth
  3. Copyright (C) 2001 University of Southern California
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation; either version 2, or (at
  7. your option) any later version.
  8. This program is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. */
  13. #ifndef XSYSTEM_H
  14. #define XSYSTEM_H
  15. /* Like system(3), but with error messages printed if the fork fails
  16. or if the child process dies due to an uncaught signal. Also, the
  17. return value is a bit simpler:
  18. -1 if there was any problem
  19. Otherwise, the 8-bit return value of the program ala WEXITSTATUS
  20. as defined in <sys/wait.h>.
  21. */
  22. int xsystem(const char *argv[]);
  23. #endif