Date: Sat, 22 Jan 2011 00:41:03 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-hackers@freebsd.org Subject: [PATCH] Make libc includes more POSIX compliant w.r.t. time.h Message-ID: <AANLkTi=iAhQznUxLQ5O_4jM_ggfFw8L1bjjFPFL2WRBv@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi,
A handful of source files in libc are missing time.h includes for
clock_* and timer_* functions, as well as related macros and other
bits defined by the POSIX 2008.1 spec and our manpages. The attached
patch makes libc more POSIX and requirements compliant with time.h and
stddef.h (required for NULL symbol as per POSIX).
The work is part of a larger effort I started in
//depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more
POSIX compliant.
If someone could assist by committing the attached patch, it would
be much appreciated.
Thanks!
-Garrett
[-- Attachment #2 --]
diff --git a/user/gcooper/posix-conformance-work/lib/libc/gen/ftw.c b/user/gcooper/posix-conformance-work/lib/libc/gen/ftw.c
index 959c9cc..60d981e 100644
--- a/user/gcooper/posix-conformance-work/lib/libc/gen/ftw.c
+++ b/user/gcooper/posix-conformance-work/lib/libc/gen/ftw.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/ftw.c,v 1.4 2004/08/24 13:00:55 tjr Exp $")
#include <fts.h>
#include <ftw.h>
#include <limits.h>
+#include <stddef.h>
int
ftw(const char *path, int (*fn)(const char *, const struct stat *, int),
diff --git a/user/gcooper/posix-conformance-work/lib/libc/gen/utime.c b/user/gcooper/posix-conformance-work/lib/libc/gen/utime.c
index f5a5d8a..edbda54 100644
--- a/user/gcooper/posix-conformance-work/lib/libc/gen/utime.c
+++ b/user/gcooper/posix-conformance-work/lib/libc/gen/utime.c
@@ -34,7 +34,7 @@ static char sccsid[] = "@(#)utime.c 8.1 (Berkeley) 6/4/93";
__FBSDID("$FreeBSD: src/lib/libc/gen/utime.c,v 1.3 2007/01/09 00:27:56 imp Exp $");
#include <sys/time.h>
-
+#include <stddef.h>
#include <utime.h>
int
diff --git a/user/gcooper/posix-conformance-work/lib/libc/include/isc/eventlib.h b/user/gcooper/posix-conformance-work/lib/libc/include/isc/eventlib.h
index 5003823..d9547c9 100644
--- a/user/gcooper/posix-conformance-work/lib/libc/include/isc/eventlib.h
+++ b/user/gcooper/posix-conformance-work/lib/libc/include/isc/eventlib.h
@@ -25,9 +25,10 @@
#define _EVENTLIB_H
#include <sys/types.h>
-#include <sys/uio.h>
#include <sys/time.h>
+#include <sys/uio.h>
#include <stdio.h>
+#include <time.h>
#include <isc/platform.h>
diff --git a/user/gcooper/posix-conformance-work/lib/libc/net/rcmd.c b/user/gcooper/posix-conformance-work/lib/libc/net/rcmd.c
index a444283..7437140 100644
--- a/user/gcooper/posix-conformance-work/lib/libc/net/rcmd.c
+++ b/user/gcooper/posix-conformance-work/lib/libc/net/rcmd.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD: src/lib/libc/net/rcmd.c,v 1.42 2007/01/09 00:28:02 imp Exp $
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <time.h>
#include <rpc/rpc.h>
#ifdef YP
#include <rpcsvc/yp_prot.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=iAhQznUxLQ5O_4jM_ggfFw8L1bjjFPFL2WRBv>
