mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
struct timespec needs to be useable with just <time.h>, but needs to not
conflict with the kernel visible one. Make the new stuff not visible if _ANSI_SOURCE or _POSIX_SOURCE is defined (!) because the new things are not part of the base 1003.1-1990 standard or ansi (says Bruce). Reviewed by: bde
This commit is contained in:
parent
3c0a9567e5
commit
7fb149d558
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25775
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)time.h 8.5 (Berkeley) 5/4/95
|
||||
* $Id: time.h,v 1.12 1997/03/22 06:53:24 bde Exp $
|
||||
* $Id: time.h,v 1.13 1997/05/08 13:48:47 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIME_H_
|
||||
@ -48,13 +48,13 @@ struct timeval {
|
||||
long tv_usec; /* and microseconds */
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure defined by POSIX.4 to be like a timeval.
|
||||
*/
|
||||
#ifndef _TIMESPEC_DECLARED
|
||||
#define _TIMESPEC_DECLARED
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* and nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)time.h 8.5 (Berkeley) 5/4/95
|
||||
* $Id: time.h,v 1.12 1997/03/22 06:53:24 bde Exp $
|
||||
* $Id: time.h,v 1.13 1997/05/08 13:48:47 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIME_H_
|
||||
@ -48,13 +48,13 @@ struct timeval {
|
||||
long tv_usec; /* and microseconds */
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure defined by POSIX.4 to be like a timeval.
|
||||
*/
|
||||
#ifndef _TIMESPEC_DECLARED
|
||||
#define _TIMESPEC_DECLARED
|
||||
struct timespec {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* and nanoseconds */
|
||||
};
|
||||
#endif
|
||||
|
||||
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
|
Loading…
Reference in New Issue
Block a user