aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-05 19:18:13 +0000
committerRoland McGrath <roland@gnu.org>1996-07-05 19:18:13 +0000
commitdbe31b9a738993b563382c602d092c970bdc79ae (patch)
treed2150cd99276abac237c29308b843f2a33db40d3 /time
parentf5348425d095f93cce1532c7ca20915aea480868 (diff)
downloadglibc-dbe31b9a738993b563382c602d092c970bdc79ae.zip
glibc-dbe31b9a738993b563382c602d092c970bdc79ae.tar.gz
glibc-dbe31b9a738993b563382c602d092c970bdc79ae.tar.bz2
* nss/nss_files/files-parse.c (parse_list): Set EOL from LINE if it
points within DATA->linebuffer; otherwise use all of DATA->linebuffer itself, no need to skip past a NUL. * nss/nsswitch.h (known_function): Comment fix. * nss/nsswitch.c (nss_lookup_function): Rewritten using __tsearch directly. Do the lookup and insertion with a single call, and fill in the tree node afterwards if new. (known_compare, nss_find_entry, nss_insert_entry): Functions removed. * misc/sys/select.h: #define __need_timespec before <sys/time.h> incl. (struct timeval): Add bodiless decl for scope. * time/time.h (struct timespec): Rename members from `ts_*' to `tv_*'. Move struct timespec defn outside [_TIME_H] so it can be got with #define __need_timespec. * time/sys/time.h (TIMEVAL_TO_TIMESPEC): Use `tv_*' instead of `ts_*' for `struct timespec' member names. (TIMESPEC_TO_TIMEVAL): Likewise. * nss/Makefile (extra-libs-others): New variable. * extra-lib.mk: Don't test for $($(lib)-no-lib-dep). Instead match $(lib) in $(extra-libs-others). * sunrpc/Makefile (extra-libs-others): New variable. (librpcsvc-no-lib-dep): Variable removed. Thu Jul 4 05:21:59 1996 David Mosberger-Tang <davidm@azstarnet.com> * login/utmp.h: Fix typos. * misc/syslog.c (vsyslog): Use __send instead of send and __connect instead of connect to avoid name-space collisions (e.g., with psgetty).
Diffstat (limited to 'time')
-rw-r--r--time/sys/time.h8
-rw-r--r--time/time.h29
2 files changed, 24 insertions, 13 deletions
diff --git a/time/sys/time.h b/time/sys/time.h
index c075333..ca82d87 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -35,12 +35,12 @@ struct timeval
/* Macros for converting between `struct timeval' and `struct timespec'. */
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->ts_sec = (tv)->tv_sec; \
- (ts)->ts_nsec = (tv)->tv_usec * 1000; \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->ts_sec; \
- (tv)->tv_usec = (ts)->ts_nsec / 1000; \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
diff --git a/time/time.h b/time/time.h
index 5926d80..596351b 100644
--- a/time/time.h
+++ b/time/time.h
@@ -22,7 +22,8 @@ Cambridge, MA 02139, USA. */
#ifndef _TIME_H
-#if !defined(__need_time_t) && !defined(__need_clock_t)
+#if (! defined (__need_time_t) && !defined(__need_clock_t) && \
+ ! defined (__need_timespec))
#define _TIME_H 1
#include <features.h>
@@ -78,6 +79,24 @@ typedef __time_t time_t;
#undef __need_time_t
+#if ! defined(__timespec_defined) && \
+ ((defined (_TIME_H) && defined (__USE_POSIX)) || \
+ defined (__need_timespec))
+#define __timespec_defined 1
+
+/* POSIX.4 structure for a time value. This is like a `struct timeval' but
+ has nanoseconds instead of microseconds. */
+struct timespec
+ {
+ long int tv_sec; /* Seconds. */
+ long int tv_nsec; /* Nanoseconds. */
+ };
+
+#endif /* timespec not defined and <time.h> or need timespec. */
+#undef __need_timespec
+
+
+
#ifdef _TIME_H
/* Used by other time functions. */
struct tm
@@ -229,14 +248,6 @@ extern int dysize __P ((int __year));
#endif
-/* POSIX.4 structure for a time value. This is like a `struct timeval' but
- has nanoseconds instead of microseconds. */
-struct timespec
- {
- long int ts_sec; /* Seconds. */
- long int ts_nsec; /* Nanoseconds. */
- };
-
#ifdef __USE_POSIX
/* Pause execution for a number of nanoseconds. */
extern int nanosleep __P ((__const struct timespec *__requested_time,