summaryrefslogtreecommitdiffstats
path: root/lib/libc/time (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove obsolete LOCALE_HOME code we have never used (and never will).millert2020-07-161-146/+1
| | | | Upstream removed it in 2004. From Jan Stary.
* drop duplicate word;schwarze2020-04-301-3/+3
| | | | reported by Gordon Bergling <gbergling at gmail dot com>
* Remove the deprecation notice for timegm().schwarze2020-04-241-4/+57
| | | | | | | | | | | | | | | | | | | | | The tzcode package marked it dprecated in the late 1980ies but it is universally supported and here to stay. Triggered by a question from Rodrigo <hruodr at gmail dot com> on misc@. William Ahern <william at 25thandclement dot com> listed a number of sound arguments why it shouldn't be considered deprecated, in particular that there is no better alternative, in particular none that is thread-safe. While here, fix the non-standard section name "NOTES", add the missing STANDARDS section and provide additional information in the HISTORY section, based on inspection of C89, C11, POSIX 2008, UNIX v4 and v5 at TUHS, Tahoe and Reno at the CSRG archives, amd the SunOS 3.5 and 4.0 manuals on bitsavers. Reasearch on tzcode and SunOS history done by millert@. OK millert@ on an earlier version of this patch, and deraadt@ agrees with the general direction.
* Update POSIX reference to the 2008 version and correct the list ofschwarze2019-07-191-6/+11
| | | | | | | | conversion specifications that are extensions; issues reported by Andras Farkas <deepbluemistake at gmail dot com> on misc@. While here, note that alternative conversion modifiers have no effect and that flags and field width specifications are not supported.
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-031-2/+2
|
* two more syscall == -1 checksderaadt2019-06-291-4/+4
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-2/+2
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* More consistently put remarks about the less useful LC_* categoties,schwarze2019-05-162-14/+27
| | | | | | i.e. those other than LC_CTYPE, into the CAVEATS section, and standardize wording somewhat. OK jmc@
* Unifdef TM_GMTOFF TM_ZONE USG_COMPAT ALTZONE to make the code more readable.schwarze2019-05-125-121/+30
| | | | | | No binary change when compiled with -g0. Note that wcsftime.c did not even compile without TM_ZONE. OK millert@
* trim trailing whitespace (reported by Hiltjo Posthuma)schwarze2019-05-101-7/+7
| | | | | and also delete spaces before tabs; no object change
* repair %z: store seconds into tm_gmtoff, not centihours;schwarze2019-05-101-26/+11
| | | | | bug reported by Hiltjo Posthuma <hiltjo at codemadness dot org>; feedback and OK millert@, OK tedu@
* repair %Z: write seconds into tm_gmtoff, not hours;schwarze2019-05-101-3/+3
| | | | | patch from Hiltjo Posthuma <hiltjo at codemadness dot org>; OK tedu@ millert@
* Delete support for military timezones in %z (A-I and K-Y).schwarze2019-05-102-34/+4
| | | | | | | | | | | They were originally defined in one way, then RFC822 erroneously redefined them the opposite way, then RFC5322 said they can no longer be used reliably. So return NULL like FreeBSD, DragonFly, glibc, and musl do. Issue reported by Hiltjo Posthuma <hiltjo at codemadness dot org>. Deletion suggested by tedu@ and deraadt@. Feedback and OK on the patch from tedu@.
* Consume one leading space with %e iff givenkn2019-02-212-7/+10
| | | | | | | | | Since strftime(3)'s %e conversion specification preceeds single digits by a blank, do the converse here to allow safe data round trips through these functions with the same format string. Positive feedback tedu deraadt, OK millert jca
* strptime(3): Disallow double leap second.cheloha2019-01-221-2/+2
| | | | | | | | | | POSIX allows for one extra second in a minute, i.e. "23:59:60", so that leap seconds can be parsed. They don't allow for *two* extra seconds, i.e. "23:59:61", though. Typo introduced in NetBSD lib/libc/time/strptime.c,v1.3. ok krw@ bcook@ tedu@
* strftime can print epoch seconds with %s, so allow strptime to parse it.tedu2019-01-212-4/+42
| | | | ok cheloha
* improve markup quality in the cases found by the new "--" style messageschwarze2018-03-161-9/+6
|
* New POSIX xlocale implementation written from scratch.schwarze2017-09-053-10/+59
| | | | | | | | | | | | Complete in the sense that all POSIX *locale(3) and *_l(3) functions are included, but in OpenBSD, we of course only really care about LC_CTYPE and we only support ASCII and UTF-8. With important help from kettenis@, guenther@, and jca@. Repeated testing in ports bulk builds by naddy@. Additional testing by jca@, sebastia@, dcoppa@, and others. OK kettenis@ dcoppa@, and guenther@ on an earlier version. Riding guenther@'s libc/librthread major bump.
* Delete casts to off_t and size_t that are implied by assignmentsguenther2016-09-211-2/+2
| | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
* gmtime_r() should return NULL on failure, not the struct tm * resultmillert2016-09-191-3/+2
| | | | parameter that was passed in. From Carlin Bingham.
* Stop exposing <sys/localedef.h> and various symbols internal to the libcguenther2016-05-231-2/+2
| | | | | | | locale implementation: _{Current,Default}*Locale, __[mn]locale_changed, __mb_len_max_runtime ok millert@ schwarze@ deraadt@
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-9/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* Remove doaccess variable and access(2) call since this interfers withmestre2016-03-141-11/+2
| | | | | | | | | | | | | | | | applications like zdump(8) because pledge(2) doesn't allow access(2) to /usr/share/zoneinfo. millert@ better described why this call can go away: "This looks like an attempt to do access checks based on the real uid instead of the effective uid. Basically for setuid programs we don't want to allow a user to set TZ to a path they should not be able to otherwise access. However, we already have a check for issetugid() above so I think the doaccess bits can just be removed and we can rely on open()." After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them
* new sentence, new line;jmc2016-02-081-2/+3
|
* mention mktime, since that is where struct tm is described. ok schwarzetedu2016-02-082-5/+9
|
* Simplify allocation logic based on free and realloc's behavior on NULL.mmcc2015-12-251-4/+3
| | | | ok tedu@
* Remove calloc cast, give sizeof parens. No functional change.mmcc2015-12-121-2/+2
|
* Document tzsetwall(). OK schwarze@ jmc@millert2015-11-101-5/+26
|
* delete old lint ARGSUSED commentsguenther2015-11-011-2/+1
|
* Move #includes from private.h to the .c files that need them, getting rid ofguenther2015-10-244-18/+15
| | | | | | several. Switch from FILENAME_MAX to PATH_MAX (it's for open(), not fopen()). ok deraadt@ tedu@ krw@
* Do not insert whitespace into syntax displays, it's just confusing,schwarze2015-10-111-49/+23
| | | | | | | | except at the one place where it is indeed helpful. Add some missing .Cm macros. Remove some useless escaping, one needless .Xo, and an empty .No. Triggered by a much smaller patch from guenther@. OK jmc@ guenther@
* Don't wrap initialized variables: binutils appears to be mishandling themguenther2015-09-191-1/+3
| | | | | | on arm and m88k problems with optind observed by jsg@
* use .Va for global variables, and .Vt where the type is includedschwarze2015-09-141-7/+6
|
* Wrap <time.h> so that internal calls go direct and symbols not in C99 are weakguenther2015-09-124-4/+24
| | | | | | Add prototypes to localtime.c for offtime(), time2posix(), posix2time() to reduce noise with -Wmissing-prototypes Eliminate unnecessary #includes
* Add support for setting tm_zone now that we have the timezone symbol.millert2015-04-071-4/+5
|
* Remove obsolete timezone() function.millert2015-04-072-3/+4
| | | | Add timezone and daylight symbols for XSI compatibility.
* Do not reference tzfile.h since that is an internal header.millert2015-03-141-12/+12
| | | | | Be clear that "standard" byte order means big endian. Update struct ttinfo.
* delete useless comment about Open Groupderaadt2015-03-131-5/+1
|
* Convert a table unsupported by mandoc to a columnated list.bentley2015-02-231-34/+34
| | | | | | | While here, correctly mark up time_t as a variable type and use prettier double quotes. ok schwarze@
* sprinkle braces around multi line statementstedu2015-02-161-11/+19
|
* pull scopes without conditionals up into enclosing blocktedu2015-02-161-38/+29
|
* knf indents to give me a fighting chance at differentiating new blockstedu2015-02-162-179/+190
| | | | from continuation lines, of which there are many
* drop an ansi bomb on the function definitionstedu2015-02-163-165/+56
|
* move scheck.c into zic.ctedu2015-02-101-7/+1
|
* now we're cooking with gas...tedu2015-02-101-4/+7
| | | | replace difftime with a clever gift from matthew. ok guenther.
* matthew suggests a double cast so sf mortgages work right. :)tedu2015-02-101-2/+2
|
* remove CMU gtimetedu2015-02-101-21/+1
|
* it is not strictly necessary to cast the "return value" of free() to void.tedu2015-02-091-16/+15
|
* - register int idays; /* unsigned would be so 2003 */tedu2015-02-094-118/+118
| | | | | | + int idays; /* unsigned would be so 2003 */ register is so 1973
* always define ALL_STATE (which, contrary to the name is not about alltedu2015-02-091-42/+1
| | | | states, but rather heap allocating the state) and unifdef the rest