summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime
Commit message (Collapse)AuthorAgeFilesLines
* Detect range errors when using the %s specifier. Previously, LONG_MAXJacques Vidrine2003-11-171-3/+10
| | | | | | | | | | was rejected as a range error, while any values less than LONG_MIN were silently substituted with LONG_MIN. Furthermore, on some platforms `time_t' has less range than `long' (e.g. alpha), which may give incorrect results when parsing some strings. Notes: svn path=/head/; revision=122830
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-081-1/+1
| | | | Notes: svn path=/head/; revision=119893
* Fixes to locale code to properly use indirect pointers in order to preventJordan K. Hubbard2003-06-131-1/+1
| | | | | | | | | | memory leaks (fixes bugs earlier purported to be fixed). Submitted by: Ed Moy <emoy@apple.com> Obtained from: Apple Computer, Inc. MFC after: 2 weeks Notes: svn path=/head/; revision=116274
* Backout my changes in rev. 1.32 and 1.33. There is some code that dependsMike Makonnen2003-04-301-4/+2
| | | | | | | | | | on the previous behaviour. This also brings strptime(3) behaviour back in line with the other BSDs. Approved by: markm (mentor) Notes: svn path=/head/; revision=114285
* Zero out the struct tm supplied by the caller. Otherwise,Mike Makonnen2003-04-051-0/+1
| | | | | | | | | | | strange things might happen when garbage values in the struct get passed in to localtime_r() and family. Noticed by: marcus Approved by: markm (mentor)(implicit) Notes: svn path=/head/; revision=113104
* Fill in the rest of the fields in the resulting struct tmMike Makonnen2003-03-291-2/+3
| | | | | | | | | | | | | from strptime(3). Previously, they would get filled only for the %s specifier and as a side effect of using the the %Z specifier with a GMT time zone. PR: misc/48993 Approved by: markm (mentor) Silence on: -standards Notes: svn path=/head/; revision=112787
* Ditch a static global and the mutex that protected it. Achieve theMike Makonnen2003-03-121-27/+18
| | | | | | | | | | | desired strptime(3) reentrancy by adding an extra argument to _strptime() instead. Approved by: markm (mentor) MFC: 4 weeks Notes: svn path=/head/; revision=112156
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).Jacques Vidrine2003-02-164-9/+9
| | | | | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5 Notes: svn path=/head/; revision=111010
* strptime(), like strftime(), does not handle multibyte charactersTim J. Robbins2003-01-041-1/+7
| | | | | | | in the format string correctly. Notes: svn path=/head/; revision=108653
* Mention in the BUGS section that strftime() does not handle multibyteTim J. Robbins2003-01-041-1/+7
| | | | | | | characters in the format string correctly. Notes: svn path=/head/; revision=108652
* mdoc(7) police: Fixed a few .Fa abuses.Ruslan Ermilov2002-12-191-2/+4
| | | | Notes: svn path=/head/; revision=108085
* mdoc(7) police: excessive quotes.Ruslan Ermilov2002-12-191-1/+1
| | | | Notes: svn path=/head/; revision=108083
* mdoc(7) police: "The .Fn function".Ruslan Ermilov2002-12-181-1/+13
| | | | Notes: svn path=/head/; revision=108037
* Document what happens when the format string contains insufficientTim J. Robbins2002-12-181-0/+23
| | | | | | | | | | | conversion specifications to completely specify the resulting struct tm. PR: 46331 Submitted by: Christian S.J. Peron MFC after: 2 weeks Notes: svn path=/head/; revision=108013
* Do not guarantee an overflow of tm_year when doing the binary search inPeter Wemm2002-12-051-0/+6
| | | | | | | | | localtime/mktime/tmcomp and friends on ia64. Approved by: re Notes: svn path=/head/; revision=107648
* Replace rev 1.33 with a real fix. The problem was integer overflowsPeter Wemm2002-12-021-8/+2
| | | | | | | | | | | | | | | | | | | when trying to store the year in a signed int. The maximum time_t on ia64 is around 292 billion years in the future, but 'int' and struct tm.tm_year can only represent then ext 2.1 billion years or so. This solves the problem of mktime/localtime looping on ia64. Unfortunately, the standards say that tm_year is an 'int', so we are still stuck with a y2147483647 bug. bash2's configure script looks for bugs in mktime() and fails on ia64 because of this. However, mktime() on FreeBSD fails the test normally anyway so this is no big loss. This change does not affect any other platforms besides ia64. Approved by: re Notes: svn path=/head/; revision=107480
* libc_r wasn't so tied to libc for 22 months.Ruslan Ermilov2002-11-181-3/+1
| | | | Notes: svn path=/head/; revision=107052
* Add cross-references to the wide character counterparts of these functions.Tim J. Robbins2002-10-151-1/+2
| | | | Notes: svn path=/head/; revision=105150
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-064-12/+12
| | | | Notes: svn path=/head/; revision=103012
* Fix a nasty bug exposed by mktime() when time_t is significantly biggerPeter Wemm2002-09-031-0/+6
| | | | | | | | | | than 32 bits. It was trying to figure out things like the day of week of when time_t is roughly 2^62 etc. Make a better guess for the starting point for the binary search that works on both 32 and 64 bit types. I have been using this for a while now. Notes: svn path=/head/; revision=102885
* Use one line for each function argument to keep the lineRobert Drehmel2002-08-152-2/+11
| | | | | | | | | | width smaller than 80 columns. Thanks to Ruslan for an explanation of multiple ways to achieve this. Notes: svn path=/head/; revision=101936
* - Add the 'restrict' qualifier to the function definition ofRobert Drehmel2002-08-142-7/+5
| | | | | | | | | | | | strftime(3) for IEEE Std 1003.1-2001 compliance and remove excessive usage of the 'const' qualifier that was neither present in the prototype in the publice header, nor in the local prototype just above the function definition. - Replace the K&R function definition with a ANSI-C one. - Update the prototype of strftime(3) in its manual page. Notes: svn path=/head/; revision=101888
* - Add the C99 'restrict' qualifier using the '__restrict' macro toRobert Drehmel2002-08-142-2/+3
| | | | | | | | function prototype and definition of strptime(3). - Update the manual page. Notes: svn path=/head/; revision=101886
* Style fixesAndrey A. Chernov2002-08-071-9/+6
| | | | Notes: svn path=/head/; revision=101471
* Move dillon's time conversion functions to a new header <timeconv.h>.Garrett Wollman2002-06-171-1/+1
| | | | | | | | | Since they were never documented and have never appeared in a FreeBSD release, no repo-copy of the header is done. This removes namespace pollution from <time.h>. Notes: svn path=/head/; revision=98313
* Grammar nit: treat "contents" as plural.Archie Cobbs2002-05-311-1/+1
| | | | Notes: svn path=/head/; revision=97682
* Remove use of __P() (actually P()) from code now that it's no longerAlfred Perlstein2002-05-282-42/+42
| | | | | | | available. Notes: svn path=/head/; revision=97423
* Assume __STDC__, remove non-__STDC__ code.Alfred Perlstein2002-05-281-13/+0
| | | | | | | Submitted by: keramida Notes: svn path=/head/; revision=97407
* Fix fd leak. Threads people: does the call above to `access' need to beGarrett Wollman2002-05-031-1/+3
| | | | | | | | | | underscored as well? PR: 37717 Submitted by: fred@clift.org (slightly modified by me) Notes: svn path=/head/; revision=95989
* Fix the style of the SCM ID's.David E. O'Brien2002-03-222-3/+5
| | | | | | | I believe have made all of libc .h's as consistent as possible. Notes: svn path=/head/; revision=92991
* Fix the style of the SCM ID's.David E. O'Brien2002-03-227-25/+18
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Remove 'register' keyword.David E. O'Brien2002-03-212-75/+75
| | | | Notes: svn path=/head/; revision=92889
* * style(9)'fyAlexey Zelkin2002-01-242-33/+34
| | | | | | | * declare prototype for __time_load_locale() in timelocal.h Notes: svn path=/head/; revision=89736
* I've been meaning to do this for a while. Add an underscore to theMatthew Dillon2002-01-191-12/+12
| | | | | | | | | | | time_to_xxx() and xxx_to_time() functions. e.g. _time_to_xxx() instead of time_to_xxx(), to make it more obvious that these are stopgap functions & placemarkers and not meant to create a defacto standard. They will eventually be replaced when a real standard comes out of committee. Notes: svn path=/head/; revision=89572
* Add my e-mail to copyrightsAlexey Zelkin2001-12-111-1/+1
| | | | Notes: svn path=/head/; revision=87659
* Add time_to_int(), int_to_time(), time_to_long(), long_to_time().Matthew Dillon2001-10-281-0/+40
| | | | Notes: svn path=/head/; revision=85636
* Add routines to convert time_t to/from fixed-bit fields. These routinesMatthew Dillon2001-10-282-1/+62
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=85634
* mdoc(7) police: Use the new .In macro for #include statements.Ruslan Ermilov2001-10-014-4/+4
| | | | Notes: svn path=/head/; revision=84306
* mdoc(7) police:Ruslan Ermilov2001-08-071-2/+2
| | | | | | | | | | 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. Notes: svn path=/head/; revision=81251
* Remove whitespace at EOL.Dima Dorfman2001-07-152-6/+6
| | | | Notes: svn path=/head/; revision=79754
* Recognize the %s format.Dima Dorfman2001-07-131-0/+16
| | | | | | | | | Submitted by: Thomas Zenker <thz@lennartz-electronic.de> and Maxim Konovalov <maxim@macomnet.ru>, respectively Reviewed by: -audit Notes: svn path=/head/; revision=79664
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-102-2/+2
| | | | Notes: svn path=/head/; revision=79531
* mdoc(7) police: remove extraneous .Pp before and/or after .Sh.Dima Dorfman2001-07-091-1/+0
| | | | Notes: svn path=/head/; revision=79454
* Document "normalizing" behavior of mktime(3).Ruslan Ermilov2001-06-231-1/+12
| | | | | | | | | PR: bin/28313 Reviewed by: bde, wollman MFC after: 1 week Notes: svn path=/head/; revision=78656
* Don't mung the user's tm_sec field if we don't need to. (Belt-and-suspendersGarrett Wollman2001-06-051-1/+3
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=77785
* MAN[1-9] -> MAN.Ruslan Ermilov2001-03-271-2/+2
| | | | Notes: svn path=/head/; revision=74870
* Get rid of non-standard %E[Ff] formats, userland apps already fixedAndrey A. Chernov2001-03-213-33/+4
| | | | Notes: svn path=/head/; revision=74578
* Oops, back out prev. change - POSIX require %y in d_fmtAndrey A. Chernov2001-03-211-4/+4
| | | | | | | Cosmetique - use exact POSIX string for %c Notes: svn path=/head/; revision=74572
* Replace %y with %YAndrey A. Chernov2001-03-211-1/+1
| | | | Notes: svn path=/head/; revision=74570
* Fix typo in the commentAndrey A. Chernov2001-03-181-1/+1
| | | | Notes: svn path=/head/; revision=74414