summaryrefslogtreecommitdiffstats
path: root/lib/libc/time
AgeCommit message (Collapse)AuthorFilesLines
2020-07-16Remove obsolete LOCALE_HOME code we have never used (and never will).millert1-146/+1
Upstream removed it in 2004. From Jan Stary.
2020-04-30drop duplicate word;schwarze1-3/+3
reported by Gordon Bergling <gbergling at gmail dot com>
2020-04-24Remove the deprecation notice for timegm().schwarze1-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.
2019-07-19Update POSIX reference to the 2008 version and correct the list ofschwarze1-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.
2019-07-03snprintf/vsnprintf return < 0 on error, rather than -1.deraadt1-2/+2
2019-06-29two more syscall == -1 checksderaadt1-4/+4
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-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.
2019-05-16More consistently put remarks about the less useful LC_* categoties,schwarze2-14/+27
i.e. those other than LC_CTYPE, into the CAVEATS section, and standardize wording somewhat. OK jmc@
2019-05-12Unifdef TM_GMTOFF TM_ZONE USG_COMPAT ALTZONE to make the code more readable.schwarze5-121/+30
No binary change when compiled with -g0. Note that wcsftime.c did not even compile without TM_ZONE. OK millert@
2019-05-10trim trailing whitespace (reported by Hiltjo Posthuma)schwarze1-7/+7
and also delete spaces before tabs; no object change
2019-05-10repair %z: store seconds into tm_gmtoff, not centihours;schwarze1-26/+11
bug reported by Hiltjo Posthuma <hiltjo at codemadness dot org>; feedback and OK millert@, OK tedu@
2019-05-10repair %Z: write seconds into tm_gmtoff, not hours;schwarze1-3/+3
patch from Hiltjo Posthuma <hiltjo at codemadness dot org>; OK tedu@ millert@
2019-05-10Delete support for military timezones in %z (A-I and K-Y).schwarze2-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@.
2019-02-21Consume one leading space with %e iff givenkn2-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
2019-01-22strptime(3): Disallow double leap second.cheloha1-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@
2019-01-21strftime can print epoch seconds with %s, so allow strptime to parse it.tedu2-4/+42
ok cheloha
2018-03-16improve markup quality in the cases found by the new "--" style messageschwarze1-9/+6
2017-09-05New POSIX xlocale implementation written from scratch.schwarze3-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.
2016-09-21Delete casts to off_t and size_t that are implied by assignmentsguenther1-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@
2016-09-19gmtime_r() should return NULL on failure, not the struct tm * resultmillert1-3/+2
parameter that was passed in. From Carlin Bingham.
2016-05-23Stop exposing <sys/localedef.h> and various symbols internal to the libcguenther1-2/+2
locale implementation: _{Current,Default}*Locale, __[mn]locale_changed, __mb_len_max_runtime ok millert@ schwarze@ deraadt@
2016-03-30for some time now mandoc has not required MLINKS to functionjmc1-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
2016-03-14Remove doaccess variable and access(2) call since this interfers withmestre1-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
2016-02-08new sentence, new line;jmc1-2/+3
2016-02-08mention mktime, since that is where struct tm is described. ok schwarzetedu2-5/+9
2015-12-25Simplify allocation logic based on free and realloc's behavior on NULL.mmcc1-4/+3
ok tedu@
2015-12-12Remove calloc cast, give sizeof parens. No functional change.mmcc1-2/+2
2015-11-10Document tzsetwall(). OK schwarze@ jmc@millert1-5/+26
2015-11-01delete old lint ARGSUSED commentsguenther1-2/+1
2015-10-24Move #includes from private.h to the .c files that need them, getting rid ofguenther4-18/+15
several. Switch from FILENAME_MAX to PATH_MAX (it's for open(), not fopen()). ok deraadt@ tedu@ krw@
2015-10-11Do not insert whitespace into syntax displays, it's just confusing,schwarze1-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@
2015-09-19Don't wrap initialized variables: binutils appears to be mishandling themguenther1-1/+3
on arm and m88k problems with optind observed by jsg@
2015-09-14use .Va for global variables, and .Vt where the type is includedschwarze1-7/+6
2015-09-12Wrap <time.h> so that internal calls go direct and symbols not in C99 are weakguenther4-4/+24
Add prototypes to localtime.c for offtime(), time2posix(), posix2time() to reduce noise with -Wmissing-prototypes Eliminate unnecessary #includes
2015-04-07Add support for setting tm_zone now that we have the timezone symbol.millert1-4/+5
2015-04-07Remove obsolete timezone() function.millert2-3/+4
Add timezone and daylight symbols for XSI compatibility.
2015-03-14Do not reference tzfile.h since that is an internal header.millert1-12/+12
Be clear that "standard" byte order means big endian. Update struct ttinfo.
2015-03-13delete useless comment about Open Groupderaadt1-5/+1
2015-02-23Convert a table unsupported by mandoc to a columnated list.bentley1-34/+34
While here, correctly mark up time_t as a variable type and use prettier double quotes. ok schwarze@
2015-02-16sprinkle braces around multi line statementstedu1-11/+19
2015-02-16pull scopes without conditionals up into enclosing blocktedu1-38/+29
2015-02-16knf indents to give me a fighting chance at differentiating new blockstedu2-177/+188
from continuation lines, of which there are many
2015-02-16drop an ansi bomb on the function definitionstedu3-165/+56
2015-02-10move scheck.c into zic.ctedu1-7/+1
2015-02-10now we're cooking with gas...tedu1-4/+7
replace difftime with a clever gift from matthew. ok guenther.
2015-02-10matthew suggests a double cast so sf mortgages work right. :)tedu1-2/+2
2015-02-10remove CMU gtimetedu1-21/+1
2015-02-09it is not strictly necessary to cast the "return value" of free() to void.tedu1-16/+15
2015-02-09- register int idays; /* unsigned would be so 2003 */tedu4-118/+118
+ int idays; /* unsigned would be so 2003 */ register is so 1973
2015-02-09always define ALL_STATE (which, contrary to the name is not about alltedu1-42/+1
states, but rather heap allocating the state) and unifdef the rest