Commit Graph

139 Commits

Author SHA1 Message Date
Matthew Dillon
e8627df69d Add time_to_int(), int_to_time(), time_to_long(), long_to_time(). 2001-10-28 20:13:16 +00:00
Matthew Dillon
237c4e3a9e Add routines to convert time_t to/from fixed-bit fields. These routines
serve two purposes: (1) so we can maintain backwards compatibility with
protocols (rwhod, dump, etc...) that either assume time_t is 32 bits or
assume sizeof(time_t) == sizeof(int), or make other similar assumptions.
(2) To tag such routines (by the presence of these calls) for future
cleanup/extension work.

The 32->64 routine, time32_to_time() (when time_t is 64 bits, that is),
is defined specifically to implement temporal locality to properly set the
msb bits of a 64 bit time_t quantity, using the 50 year rule.  The locality
code has not been implemented yet (and doesn't need to be for a while),
but that is the intent.   This will allow us to maintain backwards protocol
compatibility past 2038.

These routines are intended to be platform and time_t agnostic.

MFC after:	1 week
2001-10-28 19:54:49 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Dima Dorfman
427fc5ed6f Recognize the %s format.
Submitted by:	Thomas Zenker <thz@lennartz-electronic.de> and
		    Maxim Konovalov <maxim@macomnet.ru>, respectively
Reviewed by:	-audit
2001-07-13 13:59:24 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Ruslan Ermilov
10ae6ece36 Document "normalizing" behavior of mktime(3).
PR:		bin/28313
Reviewed by:	bde, wollman
MFC after:	1 week
2001-06-23 08:57:40 +00:00
Garrett Wollman
80d444c883 Don't mung the user's tm_sec field if we don't need to. (Belt-and-suspenders
version.)

PR:		bin/27630
Submitted by:	Arthur David Olson <ado@nci.nih.gov>
Obtained from:	Timezone mailing-list <tz@elsie.nci.nih.gov>
MFC after:	1 month
2001-06-05 20:13:28 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Andrey A. Chernov
58dae109b5 Get rid of non-standard %E[Ff] formats, userland apps already fixed 2001-03-21 14:52:12 +00:00
Andrey A. Chernov
50b4c62c47 Oops, back out prev. change - POSIX require %y in d_fmt
Cosmetique - use exact POSIX string for %c
2001-03-21 14:12:37 +00:00
Andrey A. Chernov
e81765cbbc Replace %y with %Y 2001-03-21 13:55:09 +00:00
Andrey A. Chernov
16a7ebb62d Fix typo in the comment 2001-03-18 12:20:38 +00:00
Andrey A. Chernov
faeb1b822a Relax local FreeBSD restrictions on 3 chars abbrev. name length and %c format
since they not allows POSIXly legal locale data. Currently, if relaxed form
POSIXly legal locale data will be used right now, some programs will be broken,
but it means that either locale data or programs must be fixed, not the library.

Introduce non-standard md_order (month/day order) locale field to be used later
via nl_langinfo(). Currently %EF and %Ef emulated using this field, but they
planned for remove in future in favour of nl_langinfo() test field.

Implement %F per POSIX
2001-03-18 11:58:15 +00:00
Andrey A. Chernov
f7c5bca2ef Make 'A' and 'a', 'B' and 'b' the same, per POSIX 2001-03-18 08:41:06 +00:00
Andrey A. Chernov
50bab1e6fb Implement ampm_fmt (%r) per POSIX 2001-03-02 22:10:04 +00:00
Ruslan Ermilov
589a5e341f /^\.St/ s/-iso9945-1/-p1003.1-96/ 2001-02-26 14:48:38 +00:00
Ruslan Ermilov
588a200ce1 .St -ansiC -> .St -isoC 2001-02-26 13:23:47 +00:00
Kris Kennaway
d7422f2f19 Back out snprintf -> sprintf change until I have time to look at it. 2001-02-18 04:07:50 +00:00
Tor Egge
9f52fa8615 Don't depend on lcl_mutex being a recursive mutex.
Reviewed by:	deischen
2001-02-15 22:17:04 +00:00
Alexey Zelkin
39d2c772eb catch up to __part_load_locale() interface change 2001-02-13 15:32:21 +00:00
Alexey Zelkin
4e86238071 Rewrite __time_load_locale() using ldpart.c::__part_load_locale()
Reviewed by:	ache
2001-02-12 08:53:33 +00:00
Andrey A. Chernov
740972dc72 Hardcode c_fmt in a different way since used in nl_langinfo now 2001-02-08 20:55:38 +00:00
Alexey Zelkin
930cd71107 Catch up to latest chanage in timelocal structures exporting. 2001-02-08 17:08:13 +00:00
Alexey Zelkin
18f3e1e400 Export internal data structures in same manner as numeric/monetary/messages
structures exported.
Protect timelocal.h from multiple inclusions.
2001-02-08 17:06:37 +00:00
Daniel Eischen
d201fe46e3 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
Ruslan Ermilov
b77b3c00be mdoc(7) police: Ft/Vt now accept punctuation-type arguments. 2001-01-12 15:46:56 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ruslan Ermilov
ed40311694 mdoc(7) police: removed history info from the .Os FreeBSD call. 2000-12-14 11:52:05 +00:00
Kris Kennaway
4b5e6561d3 sprintf -> snprintf 2000-11-26 09:05:40 +00:00
Nik Clayton
d4c5a1f678 Create the links for the reentrant time functions.
PR:		 docs/22644
Submitted by:	 andrew@ugh.net.au
2000-11-12 16:17:53 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Andrey A. Chernov
a91655018d For %c replace reference to asctime(3) with ctime(3) from which %c genetically
originates
2000-10-26 22:11:11 +00:00
Andrey A. Chernov
aabf7d45a4 Treat c_fmt field as compatibility placeholder 2000-10-26 16:20:57 +00:00
Andrey A. Chernov
c877745700 Force "%c" to be ctime-compatible
Submitted by:	ru
2000-10-26 16:07:04 +00:00
Andrey A. Chernov
f0b22c7b6a Force %c to be "%a %Ef %T %Y" to eliminate problems with bad c_fmt
Submitted by:	ru
2000-10-26 14:22:41 +00:00
Andrey A. Chernov
a2e0cef1d5 Describe %c better
Submitted by:	ru (with modifications)
2000-10-24 15:37:48 +00:00
Kris Kennaway
dec5f6ac42 Correct factor-of-10 error in INT_STRLEN_MAXIMUM() calculation. 2000-08-04 11:03:20 +00:00
Andrey A. Chernov
849c64f5ff Fix assigning alt_month in compatibility code 2000-06-29 17:21:45 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Martin Cracauer
6686e4fafb Temporary cosmetic change to prevent gcc-2.95.2 from doing an
optimization that generates code our current as doesn't understand.

The result is bad code that damages dynamic symbol locations at
runtime. Ouch. See PR bin/16862 and discussion in -current.

This change will be backed out when gcc and gas are back in sync.

PR:		Fixes bin/16862, but not the underlying problem.
Submitted by:	bde
Approved by:	jdk
2000-03-08 12:46:25 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
Joerg Wunsch
208b582201 There were so far only 42 different conversion specifications in
strftime(3), add another one. :)  %z yields the local timezone's offset
in hours and minutes, as used in RFC822 headers.  There's a precedence
for this in Lunux' libc, and Internet software (like Perl scripts)
start using it.

OKed by (wrt. the code freeze): jkh
2000-01-28 17:40:42 +00:00
Jason Evans
9233c4d942 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
Sheldon Hearn
4720c83e4d Make the quotes in the #include line visible. 2000-01-19 13:27:03 +00:00
Jason Evans
929273386f Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
Sheldon Hearn
ababc297fa Remove discussion of %C in the BUGS section. The limitations on valid
centuries are much more serious than those mentioned and this is not the
place to discuss the limitations of time_t.
1999-12-09 07:58:28 +00:00
Sheldon Hearn
398592ffe1 Prevent digit-gobbling for all but %l and %e, which can't be fixed.
Discuss in the BUGS section of the manpage, problems involved with
the use of %C, %e, %l, %p, %U and %W.

PR:		13901
Reported by:	scott@chronis.pobox.com
1999-12-08 15:49:10 +00:00