summaryrefslogtreecommitdiff
path: root/lib/libc/time
AgeCommit message (Collapse)Author
2023-03-02When parsing %s, the result should be in the local time zone.Todd C. Miller
Based on a patch from enh@google. OK tb@
2022-10-04Better path handling description, also document tzname, timezone daylight.Todd C. Miller
Explicitly mention that most programs do not need to call tzset() directly. OK deraadt@ jmc@ benno@
2022-10-03Allow TZ to contain absolutes paths starting with /usr/share/zoneinfo/Todd C. Miller
Other absolutes paths are still rejected.
2022-09-23POSIX timzone specs may contain '.' so only reject names containing '../'.Todd C. Miller
Noted by pjanzen@ with input from deraadt@.
2022-09-21tzset: ignore TZ if it contains an absolute path or issetugid().Todd C. Miller
Reading time zone files from user-controlled paths can result in pledge(2) or unveil(2) violations. We also ignore files that contain a '.' character to avoid paths containing ".." or hidden files. Work with and OK deraadt@
2022-09-11.Li -> .Vt where appropriate;Jason McIntyre
from josiah frentsos, tweaked by schwarze ok schwarze
2022-08-25No need to include float.h anymore.Todd C. Miller
2022-03-29man pages: add missing word, The foo() ... -> The foo() function ...Christian Weisgerber
ok jmc@ schwarze@
2020-07-16Remove obsolete LOCALE_HOME code we have never used (and never will).Todd C. Miller
Upstream removed it in 2004. From Jan Stary.
2020-04-30drop duplicate word;Ingo Schwarze
reported by Gordon Bergling <gbergling at gmail dot com>
2020-04-24Remove the deprecation notice for timegm().Ingo Schwarze
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 ofIngo Schwarze
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.Theo de Raadt
2019-06-29two more syscall == -1 checksTheo de Raadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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,Ingo Schwarze
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.Ingo Schwarze
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)Ingo Schwarze
and also delete spaces before tabs; no object change
2019-05-10repair %z: store seconds into tm_gmtoff, not centihours;Ingo Schwarze
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;Ingo Schwarze
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).Ingo Schwarze
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 givenkn
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.cheloha
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.Ted Unangst
ok cheloha
2018-03-16improve markup quality in the cases found by the new "--" style messageIngo Schwarze
2017-09-05New POSIX xlocale implementation written from scratch.Ingo Schwarze
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 assignmentsPhilip Guenther
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 * resultTodd C. Miller
parameter that was passed in. From Carlin Bingham.
2016-05-23Stop exposing <sys/localedef.h> and various symbols internal to the libcPhilip Guenther
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 functionJason McIntyre
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 withmestre
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;Jason McIntyre
2016-02-08mention mktime, since that is where struct tm is described. ok schwarzeTed Unangst
2015-12-25Simplify allocation logic based on free and realloc's behavior on NULL.mmcc
ok tedu@
2015-12-12Remove calloc cast, give sizeof parens. No functional change.mmcc
2015-11-10Document tzsetwall(). OK schwarze@ jmc@Todd C. Miller
2015-11-01delete old lint ARGSUSED commentsPhilip Guenther
2015-10-24Move #includes from private.h to the .c files that need them, getting rid ofPhilip Guenther
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,Ingo Schwarze
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 themPhilip Guenther
on arm and m88k problems with optind observed by jsg@
2015-09-14use .Va for global variables, and .Vt where the type is includedIngo Schwarze
2015-09-12Wrap <time.h> so that internal calls go direct and symbols not in C99 are weakPhilip Guenther
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.Todd C. Miller
2015-04-07Remove obsolete timezone() function.Todd C. Miller
Add timezone and daylight symbols for XSI compatibility.
2015-03-14Do not reference tzfile.h since that is an internal header.Todd C. Miller
Be clear that "standard" byte order means big endian. Update struct ttinfo.
2015-03-13delete useless comment about Open GroupTheo de Raadt
2015-02-23Convert a table unsupported by mandoc to a columnated list.Anthony J. Bentley
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 statementsTed Unangst
2015-02-16pull scopes without conditionals up into enclosing blockTed Unangst
2015-02-16knf indents to give me a fighting chance at differentiating new blocksTed Unangst
from continuation lines, of which there are many