aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-27 00:24:04 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-27 00:24:04 +0000
commitbe1dd9498ba15988055e8de83bf5b67a0d0a6543 (patch)
tree4284b8546a2565f36e2efd901e2334831369813e /time
parent38b4c0404f30e9b68a4f7609b269d9906a6a5e82 (diff)
downloadglibc-be1dd9498ba15988055e8de83bf5b67a0d0a6543.zip
glibc-be1dd9498ba15988055e8de83bf5b67a0d0a6543.tar.gz
glibc-be1dd9498ba15988055e8de83bf5b67a0d0a6543.tar.bz2
Update.
1999-07-26 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/clock_getres.c: New file. * sysdeps/generic/clock_gettime.c: New file. * sysdeps/generic/clock_settime.c: New file. * sysdeps/generic/timer_create.c: New file. * sysdeps/generic/timer_delete.c: New file. * sysdeps/generic/timer_getoverr.c: New file. * sysdeps/generic/timer_gettime.c: New file. * sysdeps/generic/timer_settime.c: New file. * sysdeps/generic/bits/time.h: Define __clockid_t, __timer_t, CLOCK_REALTIME, and TIMER_ABSTIME. * sysdeps/mach/hurd/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_TIMERS. * sysdeps/unix/sysv/linux/bits/siginfo.h: Define si_timer1 and si_timer2. * sysdeps/unix/sysv/linux/syscalls.list: Add clock and timer syscalls. * time/Makefile (routines): Add clock_getres, clock_gettime, clock_setres, timer_create, timer_delete, timer_getoverr, timer_gettime, and timer_settime. * time/time.h: Define clockid_t, timer_t, and struct itimerspec for POSIX.1b. Add prototypes for clock and timer functions.
Diffstat (limited to 'time')
-rw-r--r--time/Makefile5
-rw-r--r--time/time.h48
2 files changed, 51 insertions, 2 deletions
diff --git a/time/Makefile b/time/Makefile
index c0cbb91..8986e96 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -28,7 +28,10 @@ routines := offtime asctime clock ctime ctime_r difftime \
gettimeofday settimeofday adjtime tzset \
tzfile getitimer setitimer \
stime dysize timegm ftime \
- strptime getdate wcsftime
+ strptime getdate wcsftime \
+ clock_getres clock_gettime clock_setres \
+ timer_create timer_delete timer_getoverr \
+ timer_gettime timer_settime
tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime
diff --git a/time/time.h b/time/time.h
index 0871561..7479e8f 100644
--- a/time/time.h
+++ b/time/time.h
@@ -78,7 +78,7 @@ typedef __time_t time_t;
((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timespec)
# define __timespec_defined 1
-/* POSIX.4 structure for a time value. This is like a `struct timeval' but
+/* POSIX.1b structure for a time value. This is like a `struct timeval' but
has nanoseconds instead of microseconds. */
struct timespec
{
@@ -114,6 +114,22 @@ struct tm
};
+#ifdef __USE_POSIX199309
+/* Clock ID used in clock and timer functions. */
+typedef __clockid_t clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+typedef __timer_t timer_t;
+
+/* POSIX.1b structure for timer start values and intervals. */
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+#endif /* POSIX.1b */
+
+
/* Time used by the program so far (user time + system time).
The result / CLOCKS_PER_SECOND is program time in seconds. */
extern clock_t clock __P ((void));
@@ -239,6 +255,36 @@ extern int dysize __P ((int __year));
/* Pause execution for a number of nanoseconds. */
extern int nanosleep __P ((__const struct timespec *__requested_time,
struct timespec *__remaining));
+
+
+/* Get resolution of clock CLOCK_ID. */
+extern int clock_getres __P ((clockid_t __clock_id, struct timespec *__res));
+
+/* Get current value of clock CLOCK_ID and store it in TP. */
+extern int clock_gettime __P ((clockid_t __clock_id, struct timespec *__tp));
+
+/* Set clock CLOCK_ID to value TP. */
+extern int clock_settime __P ((clockid_t __clock_id,
+ __const struct timespec *__tp));
+
+
+/* Create new per-process timer using CLOCK_ID. */
+extern int timer_create __P ((clockid_t __clock_id, struct sigevent *__evp,
+ timer_t *__timerid));
+
+/* Delete timer TIMERID. */
+extern int timer_delete __P ((timer_t __timerid));
+
+/* Set timer TIMERID to VALUE, returning old value in OVLAUE. */
+extern int timer_settime __P ((timer_t __timerid, int __flags,
+ __const struct itimerspec *__value,
+ struct itimerspec *__ovalue));
+
+/* Get current value of timer TIMERID and store it in VLAUE. */
+extern int timer_gettime __P ((timer_t __timerid, struct itimerspec *__value));
+
+/* Get expiration overrun for timer TIMERID. */
+extern int timer_getoverrun __P ((timer_t __timerid));
# endif