maint: update almost all copyright ranges to include 2011
[gnulib.git] / lib / sys_times.in.h
1 /* Provide a sys/times.h header file.
2    Copyright (C) 2008-2011 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software Foundation,
16    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
18 /* Written by Simon Josefsson <simon@josefsson.org>, 2008.  */
19
20 /* This file is supposed to be used on platforms where <sys/times.h>
21    is missing.  */
22
23 #ifndef _GL_SYS_TIMES_H
24
25 # if __GNUC__ >= 3
26 @PRAGMA_SYSTEM_HEADER@
27 # endif
28 @PRAGMA_COLUMNS@
29
30 # if @HAVE_SYS_TIMES_H@
31 #  @INCLUDE_NEXT@ @NEXT_SYS_TIMES_H@
32 # endif
33
34 # define _GL_SYS_TIMES_H
35
36 /* Get clock_t.
37    But avoid namespace pollution on glibc systems.  */
38 # ifndef __GLIBC__
39 #  include <time.h>
40 # endif
41
42 /* The definition of _GL_ARG_NONNULL is copied here.  */
43
44 /* The definition of _GL_WARN_ON_USE is copied here.  */
45
46 # ifdef __cplusplus
47 extern "C" {
48 # endif
49
50 # if !@HAVE_STRUCT_TMS@
51   /* Structure describing CPU time used by a process and its children.  */
52   struct tms
53   {
54     clock_t tms_utime;          /* User CPU time.  */
55     clock_t tms_stime;          /* System CPU time.  */
56
57     clock_t tms_cutime;         /* User CPU time of dead children.  */
58     clock_t tms_cstime;         /* System CPU time of dead children.  */
59   };
60 # endif
61
62 # if @GNULIB_TIMES@
63 #  if !@HAVE_TIMES@
64   extern clock_t times (struct tms *buffer) _GL_ARG_NONNULL ((1));
65 #  endif
66 # elif defined GNULIB_POSIXCHECK
67 #  undef times
68 #  if HAVE_RAW_DECL_TIMES
69 _GL_WARN_ON_USE (times, "times is unportable - "
70                  "use gnulib module times for portability");
71 #  endif
72 # endif
73
74 # ifdef __cplusplus
75 }
76 # endif
77
78 #endif                          /* _GL_SYS_TIMES_H */