summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-28 00:00:08 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-28 00:00:08 +0000
commit8be918b7bb2abe46fab6c5f6e8ce3bac4da143ad (patch)
treee52c60e7b4424de720d2c54aee98494f2583d293
parent09a2231b580ea777c6bb72f6815491ae035faeea (diff)
Update.
* conform/data/sys/time.h-data: Allow sys/select.h. * conform/data/sys/un.h-data: Fix typo. * time/sys/time.h: Don't include all of <time.h>, just struct timeval. * sysdeps/posix/clock_getres.c: Include <time.h> instead of <sys/time.h>. * sysdeps/unix/clock_nanosleep.c: Likewise. * sysdeps/unix/i386/clock_getcpuclockid.c: Likewise. * sysdeps/unix/i386/i586/clock_getres.c: Likewise. * sysdeps/unix/clock_gettime.c: Also include <time.h>. * sysdeps/unix/clock_settime.c: Likewise. * sysdeps/generic/pselect.c: Include <stddef.h> for NULL. * login/getutent.c: Likewise. * login/getutid.c: Likewise. * login/getutline.c: Likewise. * socket/sys/un.h: Define SUN_LEN only if __USE_MISC.
-rw-r--r--ChangeLog18
-rw-r--r--conform/data/sys/time.h-data4
-rw-r--r--conform/data/sys/un.h-data2
-rw-r--r--login/getutent.c3
-rw-r--r--login/getutid.c3
-rw-r--r--login/getutline.c3
-rw-r--r--socket/sys/un.h10
-rw-r--r--sysdeps/generic/pselect.c3
-rw-r--r--sysdeps/posix/clock_getres.c4
-rw-r--r--sysdeps/unix/clock_gettime.c3
-rw-r--r--sysdeps/unix/clock_nanosleep.c4
-rw-r--r--sysdeps/unix/clock_settime.c3
-rw-r--r--sysdeps/unix/i386/clock_getcpuclockid.c4
-rw-r--r--sysdeps/unix/i386/i586/clock_getres.c8
-rw-r--r--sysdeps/unix/i386/i586/clock_gettime.c4
-rw-r--r--time/sys/time.h26
16 files changed, 69 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 47bb8e5859..b29afb5d38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
2001-01-27 Ulrich Drepper <drepper@redhat.com>
+ * conform/data/sys/time.h-data: Allow sys/select.h.
+ * conform/data/sys/un.h-data: Fix typo.
+ * time/sys/time.h: Don't include all of <time.h>, just struct timeval.
+ * sysdeps/posix/clock_getres.c: Include <time.h> instead of
+ <sys/time.h>.
+ * sysdeps/unix/clock_nanosleep.c: Likewise.
+ * sysdeps/unix/i386/clock_getcpuclockid.c: Likewise.
+ * sysdeps/unix/i386/i586/clock_getres.c: Likewise.
+ * sysdeps/unix/clock_gettime.c: Also include <time.h>.
+ * sysdeps/unix/clock_settime.c: Likewise.
+
+ * sysdeps/generic/pselect.c: Include <stddef.h> for NULL.
+ * login/getutent.c: Likewise.
+ * login/getutid.c: Likewise.
+ * login/getutline.c: Likewise.
+
+ * socket/sys/un.h: Define SUN_LEN only if __USE_MISC.
+
* sysdeps/unix/sysv/linux/bits/statvfs.h: Change type of f_fsid field
to unsigned long. Add __f_unused. Define _STATVFSBUF_F_UNUSED.
* sysdeps/unix/sysv/linux/internal_statvfs.c: Adjust initialization of
diff --git a/conform/data/sys/time.h-data b/conform/data/sys/time.h-data
index 0de8c278fc..174708b53d 100644
--- a/conform/data/sys/time.h-data
+++ b/conform/data/sys/time.h-data
@@ -1,3 +1,4 @@
+#ifndef ISO
type {struct timeval}
element {struct timeval} time_t tv_sec
@@ -37,3 +38,6 @@ allow tv_*
allow FD_*
allow ITIMER_*
allow *_t
+
+allow-header sys/select.h
+#endif
diff --git a/conform/data/sys/un.h-data b/conform/data/sys/un.h-data
index e8e18fbd8f..bb976f2b0b 100644
--- a/conform/data/sys/un.h-data
+++ b/conform/data/sys/un.h-data
@@ -2,7 +2,7 @@
type {struct sockaddr_un}
element {struct sockaddr_un} sa_family_t sun_family
-element {struct sockaddr_un} char sun_path [0]
+element {struct sockaddr_un} char sun_path []
type sa_family_t
#endif
diff --git a/login/getutent.c b/login/getutent.c
index 51e147586e..651bd4df73 100644
--- a/login/getutent.c
+++ b/login/getutent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -17,6 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <stddef.h> /* For NULL. */
#include <utmp.h>
diff --git a/login/getutid.c b/login/getutid.c
index 91e3ea20ac..904ac4ab72 100644
--- a/login/getutid.c
+++ b/login/getutid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -17,6 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <stddef.h> /* For NULL. */
#include <utmp.h>
diff --git a/login/getutline.c b/login/getutline.c
index 7fc402ffdd..883119eee5 100644
--- a/login/getutline.c
+++ b/login/getutline.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -17,6 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <stddef.h> /* For NULL. */
#include <utmp.h>
diff --git a/socket/sys/un.h b/socket/sys/un.h
index 03f36058bf..c2b177bae3 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 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
@@ -21,8 +21,6 @@
#include <sys/cdefs.h>
-#include <string.h> /* For prototype of `strlen'. */
-
/* Get the definition of the macro to define the common sockaddr members. */
#include <bits/sockaddr.h>
@@ -36,9 +34,13 @@ struct sockaddr_un
};
+#ifdef __USE_MISC
+# include <string.h> /* For prototype of `strlen'. */
+
/* Evaluate to actual length of the `sockaddr_un' structure. */
-#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))
+#endif
__END_DECLS
diff --git a/sysdeps/generic/pselect.c b/sysdeps/generic/pselect.c
index dab4d754f2..812bd75412 100644
--- a/sysdeps/generic/pselect.c
+++ b/sysdeps/generic/pselect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -19,6 +19,7 @@
#include <errno.h>
#include <signal.h>
+#include <stddef.h> /* For NULL. */
#include <sys/time.h>
#include <sys/select.h>
diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
index 68c9591287..0d8e29b5a8 100644
--- a/sysdeps/posix/clock_getres.c
+++ b/sysdeps/posix/clock_getres.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 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
@@ -17,8 +17,8 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <time.h>
#include <unistd.h>
-#include <sys/time.h>
#ifndef EXTRA_CLOCK_CASES
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 19df6c8685..854cb979c2 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 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
@@ -17,6 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <time.h>
#include <sys/time.h>
diff --git a/sysdeps/unix/clock_nanosleep.c b/sysdeps/unix/clock_nanosleep.c
index 18d7ac270d..0170188f06 100644
--- a/sysdeps/unix/clock_nanosleep.c
+++ b/sysdeps/unix/clock_nanosleep.c
@@ -1,5 +1,5 @@
/* High-resolution sleep with the specified clock.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 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
@@ -19,7 +19,7 @@
#include <assert.h>
#include <errno.h>
-#include <sys/time.h>
+#include <time.h>
#ifndef CLOCK_P
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
index 36bd98fdf9..9155d4607d 100644
--- a/sysdeps/unix/clock_settime.c
+++ b/sysdeps/unix/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 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
@@ -17,6 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <time.h>
#include <sys/time.h>
diff --git a/sysdeps/unix/i386/clock_getcpuclockid.c b/sysdeps/unix/i386/clock_getcpuclockid.c
index cdd662c838..c1b4487486 100644
--- a/sysdeps/unix/i386/clock_getcpuclockid.c
+++ b/sysdeps/unix/i386/clock_getcpuclockid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 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
@@ -17,8 +17,8 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <time.h>
#include <unistd.h>
-#include <sys/time.h>
int
clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
diff --git a/sysdeps/unix/i386/i586/clock_getres.c b/sysdeps/unix/i386/i586/clock_getres.c
index dd0af535ef..d11d0464af 100644
--- a/sysdeps/unix/i386/i586/clock_getres.c
+++ b/sysdeps/unix/i386/i586/clock_getres.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 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
@@ -16,8 +16,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <time.h>
#include <sys/param.h>
-#include <sys/time.h>
#include <libc-internal.h>
/* This implementation uses the TSC register in modern (i586 and up) IA-32
@@ -28,9 +28,7 @@
faster processors will not work without changes. */
-/* Clock frequency of the processor. We make it a 64-bit variable
- because some jokers are already playing with processors with more
- than 4GHz. */
+/* Clock frequency of the processor. */
static long int nsec;
diff --git a/sysdeps/unix/i386/i586/clock_gettime.c b/sysdeps/unix/i386/i586/clock_gettime.c
index 636744e4d6..85dcdcfe68 100644
--- a/sysdeps/unix/i386/i586/clock_gettime.c
+++ b/sysdeps/unix/i386/i586/clock_gettime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 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
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <sys/time.h>
+#include <time.h>
#include <libc-internal.h>
/* This implementation uses the TSC register in modern (i586 and up) IA-32
diff --git a/time/sys/time.h b/time/sys/time.h
index 3a0a952da4..9fa53efce3 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -21,10 +21,12 @@
#include <features.h>
+#include <bits/types.h>
+#define __need_time_t
+#include <time.h>
#define __need_timeval
#include <bits/time.h>
-#include <time.h>
#include <sys/select.h>
#ifndef __suseconds_t_defined
@@ -35,17 +37,20 @@ typedef __suseconds_t suseconds_t;
__BEGIN_DECLS
+#ifdef __USE_GNU
/* Macros for converting between `struct timeval' and `struct timespec'. */
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
+#endif
+#if defined __USE_GNU || defined __USE_BSD
/* Structure crudely representing a timezone.
This is obsolete and should never be used. */
struct timezone
@@ -54,7 +59,6 @@ struct timezone
int tz_dsttime; /* Nonzero if DST is ever in effect. */
};
-#if defined __USE_GNU || defined __USE_BSD
typedef struct timezone *__restrict __timezone_ptr_t;
#else
typedef void *__restrict __timezone_ptr_t;
@@ -68,6 +72,7 @@ typedef void *__restrict __timezone_ptr_t;
extern int gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __THROW;
+#ifdef __USE_MISC
/* Set the current time of day and timezone information.
This call is restricted to the super-user. */
extern int settimeofday (__const struct timeval *__tv,
@@ -79,6 +84,7 @@ extern int settimeofday (__const struct timeval *__tv,
This call is restricted to the super-user. */
extern int adjtime (__const struct timeval *__delta,
struct timeval *__olddelta) __THROW;
+#endif
/* Values for the first argument to `getitimer' and `setitimer'. */
@@ -130,15 +136,16 @@ extern int utimes (__const char *__file, __const struct timeval __tvp[2])
__THROW;
+#ifdef __USE_GNU
/* Convenience macros for operations on timevals.
NOTE: `timercmp' does not work for >= or <=. */
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
-#define timercmp(a, b, CMP) \
+# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+# define timercmp(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec))
-#define timeradd(a, b, result) \
+# define timeradd(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
@@ -148,7 +155,7 @@ extern int utimes (__const char *__file, __const struct timeval __tvp[2])
(result)->tv_usec -= 1000000; \
} \
} while (0)
-#define timersub(a, b, result) \
+# define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
@@ -157,6 +164,7 @@ extern int utimes (__const char *__file, __const struct timeval __tvp[2])
(result)->tv_usec += 1000000; \
} \
} while (0)
+#endif /* GNU */
__END_DECLS