Subject: standards/25331: posix standard and simple change to sys/time.h
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <murray@river-styx.org>
List: netbsd-bugs
Date: 04/26/2004 11:10:17
>Number:         25331
>Category:       standards
>Synopsis:       posix standard and simple change to sys/time.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 26 11:11:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Murray Armfield
>Release:        NetBSD-current
>Organization:
>Environment:
NetBSD ra 2.0E NetBSD 2.0E (RA.MP) #0: Sun Apr 25 10:36:47 EST 2004  admin@ra:/usr/obj/sys/arch/i386/compile/RA.MP i386
>Description:
The posix standard defines the pointers used in the geettimeofday and
setitimer to be restrict pointers as found in sys/time.h.
They are currently not in NetBSD.

Also, the second argument to gettimeofday is of void* type in posix,
but struct timezone* type in NetBSD.

And, the second argument to utimes is a fixed sized array in posix,
but a pointer in NetBSD.

Not mentioning the much bigger changes w.r.t. struct timeval. That is
another pr (one day). And select function is not defined here.

Is it worth flagging in the source, functions marked as LEGACY in
posix, ie utimes
>How-To-Repeat:
Inspect posix standard.
Inspect NetBSD sys/sys/time.h
>Fix:
patch to time.h follows. Some simple additional patching required in
other areas of NetBSD source tree.

--- time.h.orig 2004-04-26 20:46:17.000000000 +1000
+++ time.h
@@ -237,11 +237,12 @@ __BEGIN_DECLS
 int    adjtime __P((const struct timeval *, struct timeval *));
 int    futimes __P((int, const struct timeval *));
 int    getitimer __P((int, struct itimerval *));
-int    gettimeofday __P((struct timeval *, struct timezone *));
+int    gettimeofday __P((struct timeval * __restrict, void * __restrict));
 int    lutimes __P((const char *, const struct timeval *));
-int    setitimer __P((int, const struct itimerval *, struct itimerval *));
+int    setitimer __P((int, const struct itimerval * __restrict,
+           struct itimerval * __restrict));
 int    settimeofday __P((const struct timeval *, const struct timezone *));
-int    utimes __P((const char *, const struct timeval *));
+int    utimes __P((const char *, const struct timeval [2]));
 __END_DECLS
 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
>Release-Note:
>Audit-Trail:
>Unformatted: