Commit Graph

35 Commits

Author SHA1 Message Date
christos
66412e7240 compat code reorg 2005-09-13 01:44:32 +00:00
perry
19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
kleink
413b3367fe Do a little const cleanup, for consistency with std interfaces. 2003-12-21 23:19:02 +00:00
kleink
9865e7ff1d Sprinkle restrict into timer_{create,settime}(2). 2003-09-13 22:31:04 +00:00
agc
039cc95684 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22270, verified by myself.
2003-08-07 09:44:09 +00:00
bjh21
4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
bjh21
c1ba727b47 Version times() so that programs compiled before the recent change to make
sysconf(_SC_CLK_TCK) return hz will work.

In detail:
__times13() returns values scaled by hz.
times() returns values scaled by 100.
<sys/times.h> renames times() to __times13().

_SC_CLK_TCK has changed from 3 to 39.
sysconf(3) returns 100.
sysconf(39) returns hz.
CLK_TCK is defined as sysconf(39).
2002-06-30 09:45:39 +00:00
perry
25e1b60346 In the manner of Solaris and other OSes, we now define CLK_TCK to
expand to a call to __sysconf(_SC_CLK_TCK), rather than hard coding it
as a constant.
2002-06-23 19:41:04 +00:00
kleink
a495a577a0 Finally deprecate the old timezone() interface in favor of an XSH5
timezone/daytime pair; as proposed by J.T. in September, 1996.
Fixes PR standards/11807 by Nick Hudson.
2001-03-31 18:29:20 +00:00
kleink
8ca649a389 Sprinkle some restrict. 2001-03-29 19:06:39 +00:00
hubertf
770f687519 Fix typo in comment: CUT -> UTC 2000-07-06 12:46:48 +00:00
kleink
1bba558e50 Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.
2000-01-10 16:58:38 +00:00
kleink
c07f17e8d9 For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above.  As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.
1999-12-22 21:26:15 +00:00
kleink
866c9e7b5d Remove the public declaration of gtime(), which is shipped with tzcode but is
not compiled into our libc since it is intended for use with Mach only.
1998-09-15 12:24:28 +00:00
kleink
9db5e6b9bf Declare asctime_r(), ctime_r(), gmtime_r() and localtime_r(), and rearrange
name space protection a bit.
1998-09-10 18:37:28 +00:00
mycroft
29916a94a6 Slight rearrangement. 1998-07-27 11:09:19 +00:00
mycroft
b8f6f58d3b Need cdefs.h. 1998-07-27 11:08:38 +00:00
mycroft
633b8f45a9 Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software.  *sigh*
1998-07-27 09:09:03 +00:00
mycroft
bb96d7f5ba const poisoning. 1998-07-26 12:58:15 +00:00
mycroft
79788fe0d2 const poisoning. 1998-07-26 12:47:38 +00:00
perry
b7b7322c68 merge lite-2 1998-02-02 21:07:13 +00:00
kleink
d7a71d0ef9 * Move prototypes of clock_getres(), clock_gettime() and clock_settime() from
<sys/time.h> to this file.
* Update range comment wrt. the tm_sec member of struct tm to [0-61] (double
  leap seconds are supported).
1997-11-02 18:31:38 +00:00
kleink
7ebb8314c4 Per 1003.1b-93, move nanosleep() prototype from <sys/time.h> to <time.h>
and add appropriate namespace protection.  Also protect timer_*() prototypes.
1997-10-04 15:00:42 +00:00
christos
8115e016aa Add typedefs for clockid_t and timer_t 1997-07-13 18:32:18 +00:00
christos
34eb75ff52 - Added prototypes for non POSIX that are marked STD inspired:
offtime, timelocal, timegm, timeoff, gtime, time2posix, posix2time.
- Added prototypes for the currently stubbed out timer functions:
    timer_{create,delete,getoverrun,gettime,settime}
1997-07-13 18:09:51 +00:00
kleink
936cbaf003 Add strptime(3) prototype. 1997-05-26 16:03:58 +00:00
cgd
4d2cbfce0a new RCS ID format. 1994-10-26 00:55:40 +00:00
cgd
2922de7461 add _BSD's to ansi types 1994-05-21 09:41:59 +00:00
cgd
e6b5ddd91e update all but ctype.h, dumprestore.h, time.h to 4.4-Lite versions.
USL copyright additions on those.  Kill varargs.h, because it can simply
be a link to the machine-dependent version.
1994-05-16 10:58:53 +00:00
jtc
d5956614c6 Declare tzname[] extern, so compiler won't include it in object files. 1994-01-20 02:54:36 +00:00
jtc
7050b3fd65 declare char *tzname[2]; 1993-10-11 18:45:05 +00:00
jtc
ed37f93ef0 As per Chris Torek's suggestion, define CLOCKS_PER_SEC and CLK_TCK to 100.
When we get sysconf, we can define them in terms of the kernel's notion of
interrupts per second if we so choose.  Until then, the constant value
seems to satisfy the requirements presented by ISO C and POSIX, even if it
may lie about the true number of clocks per second.
1993-08-18 01:02:58 +00:00
jtc
d4cfab9dd1 Define CLOCKS_PER_SEC. 1993-08-17 20:33:56 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00