summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdtime
Commit message (Collapse)AuthorAgeFilesLines
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.rodrigc2015-09-201-25/+7
|
* 1) Fix the case we have less arguments for format string than we expected.ache2014-10-071-4/+3
| | | | | | | 2) Return error on unsupported format specs. (both according to POSIX) PR: 93197
* Back out timegm error check from r272562.ache2014-10-071-2/+0
| | | | | | | POSIX treats negative time_t as undefined (i.e. may be valid too, depends on system's policy we don't have) and we don't set EOVERFLOW in mktime/timegm as POSIX requires to surely distinguish -1 return as valid negative time from -1 as error return.
* 1) For %Z format, understand "UTC" name too.ache2014-10-051-1/+5
| | | | | 2) Return NULL if timegm() fails, because it means we can convert what we have in GMT to local time needed.
* Minor doc format fix.pfg2014-10-041-1/+2
| | | | Submitted by: Yonghyeon PYUN
* strptime(3): Update manpage for %U and %W.pfg2014-10-021-10/+6
| | | | | | | %U and %W were implemented as part of r272273 so take them out of the BUGS section and mention them in the SYNOPSIS. MFC after: 1 month
* strptime: %s format fix.pfg2014-10-021-1/+4
| | | | | | | | | | Almost never needed in real life because %s is tends to be only one format spec. 1) Return code of gmtime_r() is checked. 2) All flags are set. Submitted by: ache MFC after: 3 weeks
* strptime: fix bug introduced in r272273.pfg2014-10-011-1/+2
| | | | | | Reported by: portmgr (antoine) Fix by: Andrey Chernov, David Carlier PR: 137307 (follow up)
* Add strptime(3) support for %U and %W (take 2)pfg2014-09-281-7/+119
| | | | | | | | | | | | | | | | | | | | Add support for the missing POSIX-2001 %U and %W features: the existing FreeBSD strptime code recognizes both directives and validates that the week number lies in the permitted range, but then simply discards the value. Initial support for the feature was written by Paul Green. David Carlier added the initial handling of tm_wday/tm_yday. Major credit goes to Andrey Chernov for detecting much of the brokenness, and rewriting/cleaning most of the code, making it much more robust. Tested independently with the strptime test from the GNU C library. PR: 137307 MFC after: 1 month Relnotes: yes
* Revert r272122pfg2014-09-251-126/+5
| | | | | | | | | The patch still needs to be more robust and it broke the build on MIPS so revert it for now while all the issues are fixed. Reported by: ache, davide PR: 137307
* Add strptime(3) support for %U and %Wpfg2014-09-251-5/+126
| | | | | | | | | | | | | | Add support for the missing POSIX-2001 %U and %W features: the existing FreeBSD strptime code recognizes both directives and validates that the week number lies in the permitted range, but then simply discards the value. Initial support for the feature was written by Paul Green with important fixes by Andrey Chernov. Additional support for handling tm_wday/tm_yday was written by David Carlier. PR: 137307 MFC after: 1 month
* strftime() xlocale cleanups.pfg2014-07-261-37/+46
| | | | | | | | | | | Replace fprintf_l with fputs when output is unformatted. Use locale_t in _conv() since it was using sprintf (now sprintf_l) Use locale_t on _yconv() sinci it calls _conv() Obtained from: Apple Inc. (Libc 997.90.3) CR: D482 Reviewed by: theraven MFC after: 1 week
* strptime: add support for %t and %npfg2014-06-181-38/+20
| | | | | | | | | | | | | | | Posix strptime() requires support for %t and %n, which were added to the illumos port. Curiously we were skipping white spaces by default in most other cases making %t meaningless. We now skip spaces in the case of the %e specifier as strftime(3) explicitly adds a space for the single digit case. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html Obtained from: Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2) MFC after: 3 weeks
* Fix syntax error.wblock2014-06-181-1/+1
| | | | | | PR: 191131 Submitted by: dan.mcgregor@usask.ca MFC after: 1 week
* stdtime: style(9) fixes.pfg2014-06-183-184/+186
| | | | | Obtained from: illumos MFC after: 5 days
* Update license to strptime(3) implementation.pfg2014-06-161-28/+5
| | | | | | | | | | | | | | | | | | | | Our strptime(3) implementation was the base for the illumos implementation and after contacting the author, Kevin Rudy stated the code is under a 2-Clause BSD License [1] After reviewing our local changes to the file in question, the FreeBSD Foundation has agreed that their contributions to this file are not required to carry clause 3 or 4 so the file can be relicensed as in Illumos [2]. References: [1] https://www.illumos.org/issues/357 [2] Illumos Revision: 13222:02526851ba75 Approved: core (jhb) Approved: FreeBSD Foundation (emaste) MFC after: 4 days
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}marcel2014-03-041-4/+4
| | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc.
* Compile contrib/tzcode/stdtime/localtime.c with -fwrapv, since it reliesdim2013-03-241-0/+3
| | | | | | | | | | | | | on signed integer overflow wrapping. Otherwise mktime(3) and timegm(3) can hang, in case the timestamp passed in struct tm is not representable in a time_t. Specifically, any timestamp after 2038-01-19 03:14:07, in combination with a 32-bit time_t. Note that it would be better to change the code to not rely on undefined behaviour, but it is contributed code, and it is not entirely trivial to fix the issue properly. MFC after: 3 days
* Add more locale-specific functions to the relevant man pages andissyl02012-06-253-2/+27
| | | | | | | | | | Makefiles: - libc/stdtime/strftime.3 - libc/stdtime/strptime.3 - libc/stdlib/strfmon.3 Reviewed by: theraven Approved by: gabor (mentor)
* libc: Reduce relative relocations in strftime().jilles2012-06-171-1/+1
|
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-204-100/+197
| | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
* strptime(3) confused July with June with the fr_FR locale.edwin2010-05-091-0/+8
| | | | | | | | | | | | | 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> MFC after: 1 week
* Split the contributed code from libc/stdtime from lib/libc/stdtimeedwin2010-02-269-3620/+4
| | | | to contrib/tzcode/stdtime.
* %U was macroized in mdoc(7), escape.ru2010-02-161-1/+1
|
* Use _pthread_once() rather than _once() for localtime() and gmtime(). Thesejhb2010-01-061-2/+2
| | | | | | | methods are only invoked when __isthreaded is true at which point it is safe to use _pthread_once() directly. MFC after: 1 week
* Use _once() to initialize the pthread key for thread-local storage to holdjhb2009-12-301-14/+14
| | | | | | the results of gmtime() instead of using a pthread mutex directly. MFC after: 1 week
* MFV of tzdata2009t, r200831edwin2009-12-221-1/+1
| | | | | | | | | | zic: - Fix URL / reference to Calendrical Calculations: Third Edition libc/stdtime: - Fix typo in tzfile.5 (no changes in our part) MFC after: 1 week
* Use _once() to initialize the pthread key for thread-local storage to holdjhb2009-12-211-14/+14
| | | | | | the results of localtime() instead of using a pthread mutex directly. MFC after: 1 week
* Replace gmt_is_set and the gmt_mutex lock with a pthread_once_t variable andjhb2009-11-201-12/+13
| | | | | | an init routine run on the first invocation via _once(). MFC after: 1 week
* Improve the way failure of pthread_key_create() gets detected.edwin2009-09-141-2/+9
| | | | | | PR: threads/138603 Submitted by: Mikulas Patocka MFC after: 1 week
* Use (unsigned char) cast for ctype macroache2009-09-021-1/+1
|
* Implement %z for strptime.delphij2009-06-251-0/+28
| | | | | | PR: kern/63064 Submitted by: Stefan `Sec` Zehl <sec 42 org> (with some small changes) MFC after: 1 month
* Remove duplicate if-statement on gmt_is_set in gmtsub().edwin2009-06-231-8/+6
| | | | MFC after: 1 week
* Spacing fixes. No actual change.delphij2009-06-091-2/+2
|
* MFV of tzcode2009h revision r192887edwin2009-05-271-1/+1
| | | | | | - Clarify the license for the tzcode: public domain MFC after: 1 month
* MFV of tzcode2009e:edwin2009-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
* Pass a pointer to warn2 so the warn2 == IN_ALL would not be andelphij2008-10-301-1/+1
| | | | always-false condition.
* Clarify that "ante meridiem" and "post meridiem" mean the same thinggrog2008-05-161-2/+2
| | | | | | | | as the more commonly used "a.m." and "p.m.". Tripped over by: Callum Gibson. MFC after: 2 weeks
* Normally, we are often reading local time rather than setting time zone,davidxu2008-04-011-22/+63
| | | | | replace mutex with rwlock, this should eliminate lock contention in most cases.
* Reduce lock contention for simple cases.imp2007-12-191-16/+22
| | | | | | # this really should be done with pthread_once, but I've debugged this code. Reviewed by: arch@
* Some libc symbol map cleanups.deischen2007-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
* Use C comments since we now preprocess these files with CPP.deischen2007-04-291-1/+3
|
* On FreeBSD/arm, any value > 50 bits will result in a rediculously hugeimp2007-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.
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-092-8/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* add a missing the...jmg2006-12-191-1/+1
| | | | MFC after: 3 days
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+2
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+34
| | | | Reviewed by: davidxu
* The arguments for time2posix() and posix2time() are time_t values, notstefanf2005-09-111-3/+3
| | | | pointers.
* Fix all the spelling mistakes I could find in the man pages for wordskeramida2005-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.
* Expand contractions.ru2005-02-131-1/+1
|
OpenPOWER on IntegriCloud