summaryrefslogtreecommitdiff
path: root/sys/src/libc
AgeCommit message (Collapse)Author
2015-08-08fix library mkfiles for objtype=spimcinap_lenrek
2015-08-03libc: make atoi() not parse c-style octal and hex numberscinap_lenrek
interpreting octal breaks parsing of decimal numbers with leading zeros. the manpage listed this in the BUGS section, so we'r going to fix it as this just causes confusion as most callers of atoi() do not expect it.
2015-07-07libc/arm: implement _tas() with LDREX/STREX, execute memory barrier on smp ↵cinap_lenrek
systems (zynq)
2015-05-17libc: use Runemax instead of hardcoded 0x65536 for fmtchar check (thanks qrstuv)cinap_lenrek
2015-04-08pool: avoid triggering assert(b->magic != FREE_MAGIC) in blocksetsize() for ↵cinap_lenrek
mallocalignl() when we trim the front of a block with freefromfront(), the block magic of the back was not initialized which could sometimes trigger the assert in blocksetsize() to fail. fix is to just move the initialization of the magic field before the blocksetsize() call. the second b->magic = UNALLOC_MAGIC isnt really required but just done for consistency with the trim() code above.
2015-02-26pool: maintain Pool.curalloc for poolallocalign() and blockgrow()cinap_lenrek
blockgrow() and poolallocalign() change the size of allocated blocks which needs to be accounted for in Pool.curalloc.
2015-02-11libc: check name in getvent()/putenv()cinap_lenrek
passing "", "." or ".." as name caused a crash in getenv() as it would open the directory; then seek() to determine the file size would fail and return -1. now checking for these special names and set error string when its bad. doing a single read() will not work when /env has a 9p fileserver mounted onto it and the file size is bigger than the i/o unit. so doing incremental reads until we get eof.
2015-01-05pool: more strict checktree() for poolcheckcinap_lenrek
check that Free.next and Free.prev pointers are not nil. check that Free.left and Free.right are Poison in non-tree nodes. check that Free.left and Free.right are *not* Poison in tree nodes. change Poison to 0xffffffffcafebabe for 64bit machines.
2014-12-25getfcr: change getfcr/setfcr to use VFPcinap_lenrek
2014-11-07libc: import cleaned up syslog() function from sourcescinap_lenrek
this fixes a potential format string problem where the error string is passed to werrstr() as fmt. also, the directory comparsion is simplified in this version using a helper function.
2014-11-07libc: improve dial error handlingcinap_lenrek
when dial is called with a generic dialstring, it will try /net and /net.alt in sequence. error out if the /net dial gets interrupted and do not continue dialing /net.alt. reduce stack usage by using the swaping nature of errstr() instead of keeping two error string buffers on the stack.
2014-11-05libc: allow dial to be interruptedmischief
previously, if dial was interrupted by an alarm or other note while connecting to a host that resolved to multiple ips, dial would ignore the interruption and try the next host. now dial properly returns with error when it is interrupted.
2014-05-23libc: avoid static table and supurious reads in nsec()cinap_lenrek
use two per process memory slots, one for the pid and one for the fd instead of a global table avoiding the case when the table gets full. instead of calling pread() on the cached fd (dangerous as it has side effects when the fd was not closed), we check if the cached fd is still good using fd2path() when called the first time in this process.
2014-05-20libc: revert nsec() change, bring back filedescriptor cachingcinap_lenrek
theres big performance regression with this using cwfs. cwfs calls time() to update atime on every read/write which now causes walks on /dev. reverting to the previous version for now. in the long run, we'll use new _nsec() syscall but this has to wait for a later release once new kernels are established.
2014-05-20add _nsec() syscall 53 for binary compatibility with labs distributioncinap_lenrek
the new syscall is added under the symbol _nsec() for binary compatibility. nsec() is still a library function reading /dev/bintime.
2014-05-20libc: dont cache /dev/bintime filedescriptor for nsec()cinap_lenrek
2014-04-09libc: allow announce address of the form #I1/tcp!*!564cinap_lenrek
we allow protocol path to begin with # for dial, so should allow this for announce as well. this is primarily usefull when booting the fileserver to listen on alternate ip stack.
2014-02-25csdial: avoid useless werrstr() call on success (thanks mischief)cinap_lenrek
2014-02-17prof: properly save and restore RARG for amd64cinap_lenrek
amd64 passes first argument in RARG (BP) register which has the be preserved duing _profin() and _profout() calls. to handle this we introduce _saveret() and _savearg(). _saveret() returns AX, _savearg() returns RARG (BP). for archs other and amd64, _saveret() and _savearg() are the same function, doing nothing. restoing works with dummy function: uintptr _restore(uintptr, uintptr ret) { return ret; } ... ret = _saveret(); arg = _savearg(); ... return _restore(arg, ret); as we pass arg as the first argument, RARG (BP) is restored.
2014-02-14libc: remove malloc.acid and pool.acidcinap_lenrek
2014-02-06pool: use uintptr for pool sizecinap_lenrek
note, arenas and blocks still use ulong for sizes. so we have to check for overflow when attempting to merge arenas.
2014-02-02malloctag: only store lower 32bit of malloc tag, fix getrealloctagcinap_lenrek
as erik quanstro suggests, theres not much of a point in storing the full 64bit pc as one cannot get a code segment bigger than 4G and amd64 makes it hard to use a pc that isnt 64bit sign extension of 32bit. instead, we only store ulong (as originally), but sign extend back when returning in getmalloctag() and getrealloctag(). getrealloctag() used to be broken. its now fixed.
2014-02-02mallocalign: make sure alignptr offset is modulo align when -offset > aligncinap_lenrek
2014-02-01libc and ape support for amd64cinap_lenrek
2014-01-20malloc: change malloc and realloc tag types to uintptrcinap_lenrek
2013-12-17pool: update debug log format string for poolallocalign()cinap_lenrek
2013-10-17libc: updated acid files for 21 bit rune changecinap_lenrek
2013-10-08libc: remove doprintcinap_lenrek
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-09-06libc: set malloctag for runesmprint()cinap_lenrek
2013-08-14libc: Prevent infinite recursion when modf is called with NaN or Inf ↵cinap_lenrek
argument. (apply richard millers / modf-nan patch from sources)
2013-08-11tm2sec: assume local timezone when Tm.zone[0] == 0 (fixes dossrv, zipfs ↵cinap_lenrek
timestamps) from the manual: Tm2sec converts a broken-down time to seconds since the start of the epoch. It ignores wday, and assumes the local time zone if zone is not GMT. so we can assume localtime if Tm.zone is not set to GMT. all code that wants no localtime conversion should set Tm.zone explicitely to GMT. (see previous commits) tm2sec() now does the reverse of localtime() when Tm.zone[0] == 0 which seems to be what the calling code (dossrv, zipfs) assumes. this also makes sense because theres no simple way todo it outside of libc as theres otherwise no access to the timezone structure with the daylight saving periods.
2013-06-19libc: fix compiler warning for mips canlock() and _tas()cinap_lenrek
2013-06-14pool: use splaying to balance free node treecinap_lenrek
use splaytree algorithm to balance the tree of free allocations as an optimization. the data structures are unchanged by this optimization.
2013-06-10acid: fix dumptree() acid function to work in kernel debug, update ↵cinap_lenrek
malloc.acid and pool.acid files
2013-05-31pool: do poolcheck when free nodes get corrupted instead of assertcinap_lenrek
doing poolcheck should give us better context to figure out what memory blocks / owners corrupted the blocks after free. this is for hunting down a memory corruption seen in connection with usb serial.
2013-05-01frexp: handle NaN values (from sources)cinap_lenrek
2013-04-03pushtls: remove unneccesary include <auth.h> (from sources)cinap_lenrek
2013-03-03fltfmt: make %g print decimal numbers less than 1 with a leading zeroppatience0
2013-03-03fltfmt: %.0g should print with one significant figureppatience0
2013-03-01fltfmt: fix %g not printing as %e in some cases when it shouldppatience0
2013-02-27fltfmt: %.ng is supposed to print a number with n significant figures, but ↵ppatience0
it prints it with n+1. This fixes that behaviour.
2013-01-26libc: update atomic ops and fp code for arm (from sources)cinap_lenrek
2013-01-25libc: set malloctag for runestrdup()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 isotime() and isodate() functions to libc.google
2012-09-02Fix date formatting in asctime after year 2099.google
2012-08-19calloc: check multiplication overflowcinap_lenrek