Mercurial > octave
annotate liboctave/wrappers/time-wrappers.c @ 32096:501730f07abc
octave_gettimeofday_wrapper: Use NULL for pointer type argument.
* liboctave/wrappers/time-wrappers.c (octave_gettimeofday_wrapper): Use NULL
instead of 0 for pointer type argument.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sun, 21 May 2023 12:15:37 +0200 |
parents | 597f3ee61a48 |
children | 5e207c861831 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
3 // Copyright (C) 2016-2023 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 // These functions may be provided by gnulib. We don't include gnulib |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 // headers directly in Octave's C++ source files to avoid problems that |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 // may be caused by the way that gnulib overrides standard library |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 // functions. |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #if defined (HAVE_CONFIG_H) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 # include "config.h" |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 #endif |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 #include <sys/resource.h> |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 #include <sys/time.h> |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 #include <sys/times.h> |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 #include "time-wrappers.h" |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 int |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 octave_gettimeofday_wrapper (time_t *sec, long *usec) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 struct timeval tv; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 |
32096
501730f07abc
octave_gettimeofday_wrapper: Use NULL for pointer type argument.
Markus Mützel <markus.muetzel@gmx.de>
parents:
31706
diff
changeset
|
46 int status = gettimeofday (&tv, NULL); |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 if (status < 0) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 *sec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 *usec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 else |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 *sec = tv.tv_sec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 *usec = tv.tv_usec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 return status; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 int |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 octave_cpu_time (time_t *usr_sec, time_t *sys_sec, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 long *usr_usec, long *sys_usec) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 struct rusage ru; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 int status = getrusage (RUSAGE_SELF, &ru); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 if (status < 0) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 *usr_sec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 *sys_sec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 *usr_usec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 *sys_usec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 else |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 *usr_sec = ru.ru_utime.tv_sec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 *usr_usec = ru.ru_utime.tv_usec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 *sys_sec = ru.ru_stime.tv_sec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 *sys_usec = ru.ru_stime.tv_usec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 return status; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 int |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 octave_getrusage_wrapper (time_t *usr_sec, time_t *sys_sec, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
92 long *usr_usec, long *sys_usec, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
93 long *maxrss, long *ixrss, long *idrss, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 long *isrss, long *minflt, long *majflt, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 long *nswap, long *inblock, long *oublock, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
96 long *msgsnd, long *msgrcv, long *nsignals, |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 long *nvcsw, long *nivcsw) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
99 struct rusage ru; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
100 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
101 int status = getrusage (RUSAGE_SELF, &ru); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
102 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
103 if (status < 0) |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 *usr_sec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 *usr_usec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
108 *sys_sec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
109 *sys_usec = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
110 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
111 *maxrss = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 *ixrss = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
113 *idrss = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 *isrss = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 *minflt = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
116 *majflt = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
117 *nswap = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
118 *inblock = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 *oublock = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
120 *msgsnd = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
121 *msgrcv = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
122 *nsignals = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 *nvcsw = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
124 *nivcsw = 0; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
126 else |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
127 { |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
128 *usr_sec = ru.ru_utime.tv_sec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
129 *usr_usec = ru.ru_utime.tv_usec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
130 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
131 *sys_sec = ru.ru_stime.tv_sec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
132 *sys_usec = ru.ru_stime.tv_usec; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
133 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
134 *maxrss = ru.ru_maxrss; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
135 *ixrss = ru.ru_ixrss; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
136 *idrss = ru.ru_idrss; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
137 *isrss = ru.ru_isrss; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
138 *minflt = ru.ru_minflt; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
139 *majflt = ru.ru_majflt; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
140 *nswap = ru.ru_nswap; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
141 *inblock = ru.ru_inblock; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
142 *oublock = ru.ru_oublock; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
143 *msgsnd = ru.ru_msgsnd; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
144 *msgrcv = ru.ru_msgrcv; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
145 *nsignals = ru.ru_nsignals; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 *nvcsw = ru.ru_nvcsw; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 *nivcsw = ru.ru_nivcsw; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
148 } |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
150 return status; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
151 } |
22062
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
152 |
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
153 time_t |
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
154 octave_mktime_wrapper (struct tm *tp) |
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
155 { |
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
156 return mktime (tp); |
d18aad835ad6
provide wrapper for gnulib mktime function
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
157 } |