094bdac0bd
* lib/linux/clock_gettime.c: New file, move from gnu.c. * lib/linux/gettimeofday.c: New file, move from tcc.c. * lib/linux/time.c: New file, move from tcc.c. * lib/linux/libc.c: Include them. * lib/linux/gnu.c (clock_gettime): Remove. * lib/linux/tcc.c (time, gettimeofday): Remove. * include/time.h (CLOCK_PROCESS_CPUTIME_ID): New define. * src/posix.c (init_time, current_time, gettimeofday_, seconds_and_nanoseconds_to_long, get_internal_run_time): New function. * src/mes.c (scm_symbol_internal_time_units_per_second): New symbol. (main): Call init_time.
28 lines
977 B
C
28 lines
977 B
C
/* -*-comment-start: "//";comment-end:""-*-
|
|
* GNU Mes --- Maxwell Equations of Software
|
|
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
|
*
|
|
* This file is part of GNU Mes.
|
|
*
|
|
* GNU Mes is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or (at
|
|
* your option) any later version.
|
|
*
|
|
* GNU Mes is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <time.h>
|
|
|
|
int
|
|
clock_gettime (clockid_t clk_id, struct timespec *tp)
|
|
{
|
|
return _sys_call2 (SYS_clock_gettime, (long)clk_id, (long)tp);
|
|
}
|