summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime
Commit message (Collapse)AuthorAgeFilesLines
* MFC of r207830Edwin Groothuis2010-10-191-0/+8
| | | | | | | | | | | | | | | | | strptime(3) confused July with June with the fr_FR locale. When parsing the month "juillet" (abbr "jul"), %B recognized it as "juin" (abbr "jui") because the full name of the month names is checked at the same time as the abbrevation. The new behaviour checks the full names first before checking the abbrevation names. PR: kern/141939 Submitted by: Denis Chatelain <denis@tikuts.com> Notes: svn path=/stable/8/; revision=214079
* MFC r203958: %U was macroized in mdoc(7), escape.Ruslan Ermilov2010-10-061-1/+1
| | | | Notes: svn path=/stable/8/; revision=213473
* MFC 199607, 200797, 201270, 201669:John Baldwin2010-01-131-40/+41
| | | | | | | | | Use pthread_once() to initialize the thread-local storage for localtime() and gmtime() and _once() to initialize gmt state rather than home-rolled versions using pthread mutex locks. Notes: svn path=/stable/8/; revision=202201
* MFC of r200832, tzdata2009tEdwin Groothuis2009-12-291-1/+1
| | | | | | | | | | | zic: - Fix URL / reference to Calendrical Calculations: Third Edition libc/stdtime: - Fix typo in tzfile.5 (no changes in our part) Notes: svn path=/stable/8/; revision=201183
* MFCs of r197764, r197765, r197766, r197847:Edwin Groothuis2009-10-311-2/+9
| | | | | | | | | | | Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's. Also modify the "-k list" option to display only fields with a certain prefix. Add the comment "(FreeBSD only)" to the altmonth_x keywords Notes: svn path=/stable/8/; revision=198704
* Implement %z for strptime.Xin LI2009-06-251-0/+28
| | | | | | | | | PR: kern/63064 Submitted by: Stefan `Sec` Zehl <sec 42 org> (with some small changes) MFC after: 1 month Notes: svn path=/head/; revision=195015
* Remove duplicate if-statement on gmt_is_set in gmtsub().Edwin Groothuis2009-06-231-8/+6
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=194783
* Spacing fixes. No actual change.Xin LI2009-06-091-2/+2
| | | | Notes: svn path=/head/; revision=193817
* MFV of tzcode2009h revision r192887Edwin Groothuis2009-05-271-1/+1
| | | | | | | | | - Clarify the license for the tzcode: public domain MFC after: 1 month Notes: svn path=/head/; revision=192890
* MFV of tzcode2009e:Edwin Groothuis2009-05-238-376/+922
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade of the tzcode from 2004a to 2009e. Changes are numerous, but include... - New format of the output of zic, which supports both 32 and 64 bit time_t formats. - zdump on 64 bit platforms will actually produce some output instead of doing nothing for a looooooooong time. - linux_base-fX, with X >= at least 8, will work without problems related to the local time again. The original patch, based on the 2008e, has been running for a long time on both my laptop and desktop machine and have been tested by other people. After the installation of this code and the running of zic(8), you need to run tzsetup(8) again to install the new datafile. Approved by: wollman@ for usr.sbin/zic MFC after: 1 month Notes: svn path=/head/; revision=192625
* Pass a pointer to warn2 so the warn2 == IN_ALL would not be anXin LI2008-10-301-1/+1
| | | | | | | always-false condition. Notes: svn path=/head/; revision=184458
* Clarify that "ante meridiem" and "post meridiem" mean the same thingGreg Lehey2008-05-161-2/+2
| | | | | | | | | | | as the more commonly used "a.m." and "p.m.". Tripped over by: Callum Gibson. MFC after: 2 weeks Notes: svn path=/head/; revision=179038
* Normally, we are often reading local time rather than setting time zone,David Xu2008-04-011-22/+63
| | | | | | | | replace mutex with rwlock, this should eliminate lock contention in most cases. Notes: svn path=/head/; revision=177824
* Reduce lock contention for simple cases.Warner Losh2007-12-191-16/+22
| | | | | | | | | # this really should be done with pthread_once, but I've debugged this code. Reviewed by: arch@ Notes: svn path=/head/; revision=174766
* Some libc symbol map cleanups.Daniel Eischen2007-05-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | net: endhostdnsent is named _endhostdnsent and is private to netdb family of functions. posix1e: acl_size.c has been never compiled in, so there's no "acl_size". rpc: "getnetid" is a static function. stdtime: "gtime" is #ifdef'ed out in the source. some symbols are specific only to some architectures, e.g., ___tls_get_addr is only defined on i386. __htonl, __htons, __ntohl and __ntohs are no longer functions, they are now (internal) defines in <machine/endian.h>. Submitted by: ru Notes: svn path=/head/; revision=170154
* Use C comments since we now preprocess these files with CPP.Daniel Eischen2007-04-291-1/+3
| | | | Notes: svn path=/head/; revision=169092
* On FreeBSD/arm, any value > 50 bits will result in a rediculously hugeWarner Losh2007-01-191-2/+2
| | | | | | | | | | | | | | number being returned for mktime and timegm calls. Choose 48 because that works well. This does reduce the dynamic range of tm_year from about 2 billion years down to "only" about 9 million years. Please contact me if this restriction poses a problem. Due to the complexity of the code, I admit that I didn't trace down what, exactly, was overflowing with longer bits. This fixes software that we run on the embedded systems we have. Notes: svn path=/head/; revision=166102
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-092-8/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* add a missing the...John-Mark Gurney2006-12-191-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=165357
* Add each directory's symbol map file to SYM_MAPS.Daniel Eischen2006-03-131-0/+2
| | | | Notes: svn path=/head/; revision=156613
* Add symbol maps and initial symbol version definitions to libc.Daniel Eischen2006-03-131-0/+34
| | | | | | | Reviewed by: davidxu Notes: svn path=/head/; revision=156608
* The arguments for time2posix() and posix2time() are time_t values, notStefan Farfeleder2005-09-111-3/+3
| | | | | | | pointers. Notes: svn path=/head/; revision=149995
* Fix all the spelling mistakes I could find in the man pages for wordsGiorgos Keramidas2005-07-311-1/+1
| | | | | | | | | | | that have at least 3 characters. MFC after: 1 week Thanks to: Music band ``Chingon'' for keeping me company while searching for these. Notes: svn path=/head/; revision=148580
* Expand contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141851
* Expand *n't contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141846
* Sort sections.Ruslan Ermilov2005-01-201-5/+5
| | | | Notes: svn path=/head/; revision=140505
* Scheduled mdoc(7) sweep.Ruslan Ermilov2005-01-111-8/+10
| | | | Notes: svn path=/head/; revision=140081
* Add glibc-style strftime(3) padding specifiers, namely, -(no padding),Xin LI2004-11-042-21/+79
| | | | | | | | | | | | | | | _(use space as padding), and 0(zero padding). These GNU extensions are widely used ones that is worthy for us to have. Discussed with: stefanf, roam, -current Approved by: murray Prodded by: ports/72722, ports/72723 MFC After: 1 month Notes: svn path=/head/; revision=137190
* struct tm.tm_year is listed as 'years since 1900', and is signed. OnPeter Wemm2004-08-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 64 bit systems, years roughly -2^31 through 2^31 can be represented in time_t without any trouble. 32 bit time_t systems only range from roughly 1902 through 2038. As a consequence, none of the date munging code for all the various calendar tweaks before then is present. There are other problems including the fact that there was no 'year zero' and so on. So rather than get excited about trying to figure out when the calendar jumped by two weeks etc, simply disallow negative (ie: prior to 1900) years. This happens to have an important side effect. If you bzero a 'struct tm', it corresponds to 'Jan 0, 1900, 00:00 GMT'. This happens to be representable (after canonification) in 64 bit time_t space. Zero tm structs are generally an error and mktime normally returns -1 for them. Interestingly, it tries to canonify the 'jan 0' to 'dec 31, 1899', ie: year -1. This conveniently trips the negative year test above, which means we can trivially detect the null 'tm' struct. This actually tripped up code at work. :-/ (Don't ask) Notes: svn path=/head/; revision=134231
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-023-3/+6
| | | | Notes: svn path=/head/; revision=131504
* Merge changes from the tzcode2004a import. Wherever possible I tried to bringStefan Farfeleder2004-06-145-151/+374
| | | | | | | | | us closer to the vendor branch. Requested by: wollman Notes: svn path=/head/; revision=130461
* Remove a stale reference to %Ef and %EF from a comment.Stefan Farfeleder2004-06-131-2/+2
| | | | Notes: svn path=/head/; revision=130414
* Change defualt time zone from GMT to UTC. This will not be MFC-ed, andKen Smith2004-06-111-1/+6
| | | | | | | was done before 5-STABLE on purpose... Notes: svn path=/head/; revision=130332
* Remove a couple of casts added for an ancient Sun compiler.Stefan Farfeleder2004-06-081-11/+2
| | | | | | | Approved by: das (mentor) Notes: svn path=/head/; revision=130244
* 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