sys_times.in.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* Provide a sys/times.h header file.
  2. Copyright (C) 2008-2017 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. 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 Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  13. /* Written by Simon Josefsson <simon@josefsson.org>, 2008. */
  14. /* This file is supposed to be used on platforms where <sys/times.h>
  15. is missing. */
  16. #ifndef _@GUARD_PREFIX@_SYS_TIMES_H
  17. # if __GNUC__ >= 3
  18. @PRAGMA_SYSTEM_HEADER@
  19. # endif
  20. @PRAGMA_COLUMNS@
  21. # if @HAVE_SYS_TIMES_H@
  22. # @INCLUDE_NEXT@ @NEXT_SYS_TIMES_H@
  23. # endif
  24. # define _@GUARD_PREFIX@_SYS_TIMES_H
  25. /* Get clock_t.
  26. But avoid namespace pollution on glibc systems. */
  27. # ifndef __GLIBC__
  28. # include <time.h>
  29. # endif
  30. /* The definition of _GL_ARG_NONNULL is copied here. */
  31. /* The definition of _GL_WARN_ON_USE is copied here. */
  32. # ifdef __cplusplus
  33. extern "C" {
  34. # endif
  35. # if !@HAVE_STRUCT_TMS@
  36. # if !GNULIB_defined_struct_tms
  37. /* Structure describing CPU time used by a process and its children. */
  38. struct tms
  39. {
  40. clock_t tms_utime; /* User CPU time. */
  41. clock_t tms_stime; /* System CPU time. */
  42. clock_t tms_cutime; /* User CPU time of dead children. */
  43. clock_t tms_cstime; /* System CPU time of dead children. */
  44. };
  45. # define GNULIB_defined_struct_tms 1
  46. # endif
  47. # endif
  48. # if @GNULIB_TIMES@
  49. # if !@HAVE_TIMES@
  50. extern clock_t times (struct tms *buffer) _GL_ARG_NONNULL ((1));
  51. # endif
  52. # elif defined GNULIB_POSIXCHECK
  53. # undef times
  54. # if HAVE_RAW_DECL_TIMES
  55. _GL_WARN_ON_USE (times, "times is unportable - "
  56. "use gnulib module times for portability");
  57. # endif
  58. # endif
  59. # ifdef __cplusplus
  60. }
  61. # endif
  62. #endif /* _@GUARD_PREFIX@_SYS_TIMES_H */