summaryrefslogtreecommitdiff
path: root/sys/include/libc.h
AgeCommit message (Collapse)Author
2020-08-09libc: new date apisOri Bernstein
The current date and time APIs on Plan 9 are not good. They're inflexible, non-threadsafe, and don't expose timezone information. This commit adds new time APIs that allow parsing arbitrary dates, work from multiple threads, and can handle timezones effectively.
2020-06-15libc: revert date change again. this is getting ridicuoulus.cinap_lenrek
this breaks the sample from the seconds manpage, and overall produces funky results. this needs alot more testing. term% seconds '23 may 2011' seconds: tmparse: invalid date 23 may 2011 near 'may 2011' term% seconds '2019-01-01 00:00:00' -118370073600
2020-06-14libc, seconds: new time and date apis (try 2)Ori Bernstein
Redo date handling in libc almost entirely. This allows handling dates and times from outside your timezones, fixes timezone loading in multithreaded applications, and allows parsing and formatting using custom format strings. As a test of the APIs, we replace the formatting code in seconds(1), shrinking it massively. The last commit missed a few removals, and made it unnecessarily hard to do an update.
2020-06-14libc: reverting previous change until ori can fix itcinap_lenrek
2020-06-13libc, seconds: new time and date apis.Ori Bernstein
Redo date handling in libc almost entirely. This allows handling dates and times from outside your timezones, fixes timezone loading in multithreaded applications, and allows parsing and formatting using custom format strings. As a test of the APIs, we replace the formatting code in seconds(1), shrinking it massively.
2018-09-26libc: add procsetname()cinap_lenrek
2018-09-26libc: return number of bytes produced for idn2utf() and utf2idn()cinap_lenrek
2018-09-25libc: add utf2idn() and idn2utf() functions to deal with internationalized ↵cinap_lenrek
domain names
2017-12-31libc: constant time implementation for encode(2) routines, fix base32cinap_lenrek
the string encoding functions touch secret key material in a bunch of places (devtls, devcap), so make sure we do not leak information by cache timing side channels, making the encoding and decoding routines constant time. we also expose the alphabets through encXchr()/decXchr() functions so caller can find the end of a encoded string before calling decode function (for libmp). the base32 encoding was broken in several ways. inputs lengths of len%5 == [2,3,4] had output truncated and it was using non-standard alphabet. documenting the alphabet change in the manpage.
2017-10-28libc: improve alignment of QLp structure on amd64, cosmeticscinap_lenrek
the QLp structure used to occupy 24 bytes on amd64. with some rearranging the fields we can get it to 16 bytes, saving 8K in the data section for the 1024 preallocated structs in the ql arena. the rest of the changes are of cosmetic nature: - getqlp() zeros the next pointer, so there is no need to set it when queueing the entry. - always explicitely compare pointers to nil. - delete unused code from ape's qlock.c
2016-01-07introduce signed intptr and %z format modifier for formating uintptr and intptrcinap_lenrek
2015-09-06libc: remove privfree(), simplify privalloc()cinap_lenrek
2014-01-20malloc: change malloc and realloc tag types to uintptrcinap_lenrek
2013-10-17change Rune from ushort to uint for to 21 bit runes (thanks mischief!)cinap_lenrek
big big change. requires rebuilding 8c first and then rebuild everything.
2013-09-26reverting semaphore lock changes from sources (r41ccd6d221da, rb28756e5ba29)cinap_lenrek
semaphore locks have much higher overhead than initially presented in the "Semaphores in Plan9" paper. until the reason for it has been found out i will revert the changes.
2013-09-21libc: change tas/sleep locks to cas/semacquire/semrelease locks (from sources)cinap_lenrek
spinlocks have been changed to use the new semacquire/semrelease syscalls in combination with atomic compare and swap operations.
2013-04-24make all the commands agnostic about Rune width. (from sources)cinap_lenrek
2012-12-31fix utf and rune handling in preparation for 32bit runescinap_lenrek
2012-09-01isodate in libc? revert every commit for great justice!cinap_lenrek
2012-09-02Add prototypes for isotime and isodate. This should have been in the ↵google
previous commit.
2012-08-02format check for octal fmt strings (import from sources)cinap_lenrek
2012-07-29add tsemacquire syscall for gocinap_lenrek
2011-06-25added ainc / adec prototypeaiju
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso image - sys/includeTaru Karttunen