From 2c6cfe6853a30deb4af842aacc924fa298d0521a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 19 Dec 2005 12:11:38 +0000 Subject: Updated to fedora-glibc-20051219T1003 --- time/adjtime.c | 37 +++++++++++++++++++++++++++++++++++++ time/clock.c | 32 ++++++++++++++++++++++++++++++++ time/ftime.c | 43 +++++++++++++++++++++++++++++++++++++++++++ time/getitimer.c | 42 ++++++++++++++++++++++++++++++++++++++++++ time/gettimeofday.c | 39 +++++++++++++++++++++++++++++++++++++++ time/setitimer.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ time/settimeofday.c | 35 +++++++++++++++++++++++++++++++++++ time/stime.c | 40 ++++++++++++++++++++++++++++++++++++++++ time/sys/time.h | 2 +- time/time.c | 36 ++++++++++++++++++++++++++++++++++++ 10 files changed, 349 insertions(+), 1 deletion(-) create mode 100644 time/adjtime.c create mode 100644 time/clock.c create mode 100644 time/ftime.c create mode 100644 time/getitimer.c create mode 100644 time/gettimeofday.c create mode 100644 time/setitimer.c create mode 100644 time/settimeofday.c create mode 100644 time/stime.c create mode 100644 time/time.c (limited to 'time') diff --git a/time/adjtime.c b/time/adjtime.c new file mode 100644 index 0000000000..8645652188 --- /dev/null +++ b/time/adjtime.c @@ -0,0 +1,37 @@ +/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +/* Adjust the current time of day by the amount in DELTA. + If OLDDELTA is not NULL, it is filled in with the amount + of time adjustment remaining to be done from the last `__adjtime' call. + This call is restricted to the super-user. */ +int +__adjtime (delta, olddelta) + const struct timeval *delta; + struct timeval *olddelta; +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (adjtime) + +weak_alias (__adjtime, adjtime) +#include diff --git a/time/clock.c b/time/clock.c new file mode 100644 index 0000000000..99dc5f47e0 --- /dev/null +++ b/time/clock.c @@ -0,0 +1,32 @@ +/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Return the time used by the program so far (user time + system time). */ +clock_t +clock () +{ + __set_errno (ENOSYS); + return (clock_t) -1; +} + +stub_warning (clock) +#include diff --git a/time/ftime.c b/time/ftime.c new file mode 100644 index 0000000000..94dfbcc98b --- /dev/null +++ b/time/ftime.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1994, 1996, 1997, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +int +ftime (timebuf) + struct timeb *timebuf; +{ + int save = errno; + struct tm tp; + + __set_errno (0); + if (time (&timebuf->time) == (time_t) -1 && errno != 0) + return -1; + timebuf->millitm = 0; + + if (__localtime_r (&timebuf->time, &tp) == NULL) + return -1; + + timebuf->timezone = tp.tm_gmtoff / 60; + timebuf->dstflag = tp.tm_isdst; + + __set_errno (save); + return 0; +} diff --git a/time/getitimer.c b/time/getitimer.c new file mode 100644 index 0000000000..d9f3063e1e --- /dev/null +++ b/time/getitimer.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Set *VALUE to the current setting of timer WHICH. + Return 0 on success, -1 on errors. */ +int +__getitimer (which, value) + enum __itimer_which which; + struct itimerval *value; +{ + if (value == NULL) + { + __set_errno (EINVAL); + return -1; + } + + __set_errno (ENOSYS); + return -1; +} +stub_warning (getitimer) + +weak_alias (__getitimer, getitimer) +#include diff --git a/time/gettimeofday.c b/time/gettimeofday.c new file mode 100644 index 0000000000..f4a170c9e7 --- /dev/null +++ b/time/gettimeofday.c @@ -0,0 +1,39 @@ +/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +#undef __gettimeofday + +/* Get the current time of day and timezone information, + putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. + Returns 0 on success, -1 on errors. */ +int +__gettimeofday (tv, tz) + struct timeval *tv; + struct timezone *tz; +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (gettimeofday) + +INTDEF(__gettimeofday) +weak_alias (__gettimeofday, gettimeofday) +#include diff --git a/time/setitimer.c b/time/setitimer.c new file mode 100644 index 0000000000..755fa06a7b --- /dev/null +++ b/time/setitimer.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Set the timer WHICH to *NEW. If OLD is not NULL, + set *OLD to the old value of timer WHICH. + Returns 0 on success, -1 on errors. */ +int +__setitimer (which, new, old) + enum __itimer_which which; + const struct itimerval *new; + struct itimerval *old; +{ + if (new == NULL) + { + __set_errno (EINVAL); + return -1; + } + + __set_errno (ENOSYS); + return -1; +} +stub_warning (setitimer) + +weak_alias (__setitimer, setitimer) +#include diff --git a/time/settimeofday.c b/time/settimeofday.c new file mode 100644 index 0000000000..abff6f92a1 --- /dev/null +++ b/time/settimeofday.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +/* Set the current time of day and timezone information. + This call is restricted to the super-user. */ +int +__settimeofday (tv, tz) + const struct timeval *tv; + const struct timezone *tz; +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (settimeofday) + +weak_alias (__settimeofday, settimeofday) +#include diff --git a/time/stime.c b/time/stime.c new file mode 100644 index 0000000000..5ed1b040e2 --- /dev/null +++ b/time/stime.c @@ -0,0 +1,40 @@ +/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +/* Set the system clock to *WHEN. */ + +int +stime (when) + const time_t *when; +{ + if (when == NULL) + { + __set_errno (EINVAL); + return -1; + } + + __set_errno (ENOSYS); + return -1; +} + +stub_warning (stime) +#include diff --git a/time/sys/time.h b/time/sys/time.h index 199125bff3..96649ffa45 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -153,7 +153,7 @@ extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat (int __fd, __const char *__file, - __const struct timeval __tvp[2]) __THROW __nonnull ((2)); + __const struct timeval __tvp[2]) __THROW; #endif diff --git a/time/time.c b/time/time.c new file mode 100644 index 0000000000..ec66f119df --- /dev/null +++ b/time/time.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1991,96,97,2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +/* Return the time now, and store it in *TIMER if not NULL. */ +time_t +time (timer) + time_t *timer; +{ + __set_errno (ENOSYS); + + if (timer != NULL) + *timer = (time_t) -1; + return (time_t) -1; +} +libc_hidden_def (time) + +stub_warning (time) +#include -- cgit v1.2.3