summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Externalize malloc's spinlock so that a thread library can takeDaniel Eischen2003-11-042-0/+9
| | | | | | | | | | | | | | it around an application's fork() call. Our new thread libraries (libthr, libpthread) can now have threads running while another thread calls fork(). In this case, it is possible for malloc to be left in an inconsistent state in the child. Our thread libraries, libpthread in particular, need to use malloc internally after a fork (in the child). Reviewed by: davidxu Notes: svn path=/head/; revision=122069
* Pass mbrtowc() and wcrtomb() NULL instead of a pointer to a freshly zeroedTim J. Robbins2003-11-043-9/+3
| | | | | | | | | | mbstate_t object that they ignore. The zeroing is fairly expensive, and it will never be necessary in these functions; when we support state-dependent encodings, we will pass in a pointer to the file's mbstate_t object, and only zero it at the time the file gets opened. Notes: svn path=/head/; revision=122042
* Add a reference to the new utrace(2) manual page.Tim J. Robbins2003-11-041-1/+2
| | | | Notes: svn path=/head/; revision=122040
* When printing ACLs, truncate user and group names if they're too long,Robert Watson2003-11-031-3/+5
| | | | | | | | | | | | rather than generating an error. This is consistent with other tools printing user and group names, and means you can read the ACL using our tools rather than being up a creek. PR: 56991 Submitted by: Michael Bretterklieber <mbretter@a-quadrat.at> Notes: svn path=/head/; revision=121975
* Convert the Big5, EUC, MSKanji and UTF-8 encoding methods to implementTim J. Robbins2003-11-024-254/+233
| | | | | | | | | mbrtowc() and wcrtomb() directly. GB18030, GBK and UTF2 are left unconverted; GB18030 will be done eventually, but GBK and UTF2 may just be removed, as they are subsets of GB18030 and UTF-8 respectively. Notes: svn path=/head/; revision=121893
* Remove TODO comment about creating a macro version of towctrans().Tim J. Robbins2003-11-011-4/+0
| | | | | | | Remove unnecessary inclusion of <ctype.h>. Notes: svn path=/head/; revision=121852
* Fix a typo that caused the optimized single-byte locale path not to be taken.Tim J. Robbins2003-11-011-1/+1
| | | | Notes: svn path=/head/; revision=121851
* Add a manual page for the utrace() system call.Tim J. Robbins2003-11-012-1/+87
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=121846
* Allow mbrtowc() and wcrtomb() to be implemented directly, instead ofTim J. Robbins2003-11-017-50/+204
| | | | | | | | | | | | | | | | | | | | as wrappers around the deprecated 4.4BSD rune functions. This paves the way for state-dependent encodings, which the rune API does not support. - Add __emulated_sgetrune() and __emulated_sputrune(), which are implementations of sgetrune() and sputrune() in terms of mbrtowc() and wcrtomb(). - Rename the old rune-wrapper mbrtowc() and wcrtomb() functions to __emulated_mbrtowc() and __emulated_wcrtomb(). - Add __mbrtowc and __wcrtomb function pointers, which point to the current locale's conversion functions, or the __emulated versions. - Implement mbrtowc() and wcrtomb() as calls to these function pointers. - Make the "NONE" encoding implement mbrtowc() and wcrtomb() directly. All of this emulation mess will be removed, together with rune support, in FreeBSD 6. Notes: svn path=/head/; revision=121845
* Don't bother passing a freshly-zeroed mbstate to mbsrtowcs() etc.Tim J. Robbins2003-10-314-75/+25
| | | | | | | | | | when the current implementation won't use it, anyway. Just pass NULL. This will need to be changed when state-dependent encodings are supported, but there's no need to take the performance hit in the meantime. Notes: svn path=/head/; revision=121796
* Implement fgetrune(), fungetrune() and fputrune() as wrappers aroundTim J. Robbins2003-10-311-36/+8
| | | | | | | fgetwc(), ungetwc() and fputwc(). Notes: svn path=/head/; revision=121788
* add destination address selection described in RFC3484.Hajimu UMEMOTO2003-10-301-7/+412
| | | | | | | | | | | | in KAME implementation, even when no policy is installed into kernel, getaddrinfo(3) sorts addresses. Since it causes POLA violation, I modified to don't sort addresses when no policy is installed into kernel, Obtained from: KAME Notes: svn path=/head/; revision=121747
* Add '#' to the characters VIS_GLOB encodes. This fixes a bug in mtree.Poul-Henning Kamp2003-10-302-2/+3
| | | | Notes: svn path=/head/; revision=121737
* Add a new flag to vis(3): VIS_GLOB which encodes the glob(3) magicPoul-Henning Kamp2003-10-302-2/+7
| | | | | | | characters '*', '?' and '['. Notes: svn path=/head/; revision=121728
* Remove incomplete support for running FreeBSD userland on old NetBSD kernelsTim J. Robbins2003-10-298-31/+4
| | | | | | | lacking the issetugid() and utrace() syscalls. Notes: svn path=/head/; revision=121667
* Make this part identical with NetBSD: Use recvlen instead of inlen.Martin Blapp2003-10-291-1/+1
| | | | | | | | | No functionality change. Obtained from: NetBSD Notes: svn path=/head/; revision=121654
* Don't compare NULL against a character.Martin Blapp2003-10-291-3/+3
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=121653
* Don't use NULL to compare against a char.Martin Blapp2003-10-291-2/+2
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=121652
* Don't use NULL to compare against a character.Martin Blapp2003-10-291-1/+1
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=121651
* Don peril sensitive (ie: bikeshed sensitive) sunglasses and quietlyPeter Wemm2003-10-282-408/+1
| | | | | | | | | | | | | | send strhash(3) off to sleep with the fishes. Nothing in our tree uses it. It has no documentation. It is nonstandard and in spite of the filename strhash.c and strhash.h, it lives in application namespace by providing compulsory global symbols hash_create()/hash_destroy()/hash_search()/ hash_traverse()/hash_purge()/hash_stats() regardless of whether you #include <strhash.h> or not. If it turns out that there is a huge application for this after all, I can repocopy it somewhere safer and we can revive it elsewhere. But please, not in libc! Notes: svn path=/head/; revision=121639
* Pacify gcc about casting pointers to integers (for the lowest few bits).Peter Wemm2003-10-261-6/+8
| | | | Notes: svn path=/head/; revision=121531
* Consistently cast to (u_char *) when filling with junk.Poul-Henning Kamp2003-10-251-3/+3
| | | | Notes: svn path=/head/; revision=121518
* Style changes. Inching closer to convergence with OpenBSD.Poul-Henning Kamp2003-10-251-61/+60
| | | | Notes: svn path=/head/; revision=121500
* according to RFC3542 10.5, the 5th argment of inet6_opt_next()Hajimu UMEMOTO2003-10-251-1/+1
| | | | | | | | | is not size_t but socklen_t. Reported by: tinderbox Notes: svn path=/head/; revision=121496
* - fix description of what processes SIGCONT can be sent toKen Smith2003-10-241-1/+1
| | | | | | | | | PR: docs/58413 Reviewed by: rwatson Approved by: blackend (mentor) Notes: svn path=/head/; revision=121484
* oops, revert previous change to getaddrinfo.c. This is not relatedHajimu UMEMOTO2003-10-241-275/+155
| | | | | | | | to RFC3493. The previous change was related to RFC3484 (Default Address Selection for IPv6), and it will come later. Notes: svn path=/head/; revision=121474
* Switch Advanced Sockets API for IPv6 from RFC2292 to RFC3542Hajimu UMEMOTO2003-10-246-366/+1400
| | | | | | | | | | | | | (aka RFC2292bis). Though I believe this commit doesn't break backward compatibility againt existing binaries, it breaks backward compatibility of API. Now, the applications which use Advanced Sockets API such as telnet, ping6, mld6query and traceroute6 use RFC3542 API. Obtained from: KAME Notes: svn path=/head/; revision=121472
* reorder functions to be in sync with KAME.Hajimu UMEMOTO2003-10-231-128/+132
| | | | Notes: svn path=/head/; revision=121426
* EAI_ADDRFAMILY and EAI_NODATA was deprecated in RFC3493Hajimu UMEMOTO2003-10-232-17/+4
| | | | | | | | | | | (aka RFC2553bis). Now, getaddrinfo(3) returns EAI_NONAME instead of EAI_NODATA. Our getaddrinfo(3) nor getnameinfo(3) didn't use EAI_ADDRFAMILY. Obtained from: KAME Notes: svn path=/head/; revision=121425
* Add implementations of amd64_[gs]et_[fg]sbase().Peter Wemm2003-10-235-0/+158
| | | | Notes: svn path=/head/; revision=121407
* oops, gai_strerror must return default value when error codeHajimu UMEMOTO2003-10-221-0/+1
| | | | | | | isn't found in ai_errlist. Notes: svn path=/head/; revision=121348
* make ai_errlist struct. this is preparation for RFC3493Hajimu UMEMOTO2003-10-221-19/+32
| | | | | | | | | (EAI_NODATA is depricated). Obtained from: KAME Notes: svn path=/head/; revision=121347
* The FP status register allows for 6 traps to be masked. One of them,Marcel Moolenaar2003-10-222-3/+3
| | | | | | | | | | | | | | | the denormal/unnormal trap, is not a standard IEEE trap. We did not exclude it from being returned by fpgetmask(), nor did we make sure that fpsetmask() didn't clobber it. Since the non-IEEE trap is not part of fp_except_t, users of ifpgetmask()/fpsetmask() would be confronted with unexpected behaviour, one of which is a SIGFPE for denormal/unnormal FP results. This commit makes sure that we don't leak the denormal/unnormal mask bit in fp_except_t and also that we don't clobber it. Notes: svn path=/head/; revision=121332
* stop use of NI_WITHSCOPEID. it was deprecated.Hajimu UMEMOTO2003-10-211-8/+3
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=121316
* Bring the description of st_[cma]time modification conditions a bitDiomidis Spinellis2003-10-201-6/+18
| | | | | | | | | closer to reality. More work remains to be done. st_mtime should be the most complete based on IEEE Std 1003.1, 2003 Edition, a review of ufs_vnops.c, and some experimentation. Notes: svn path=/head/; revision=121279
* document the fact that kqueue will immediately return and not timeout whenJohn-Mark Gurney2003-10-201-0/+8
| | | | | | | | | nevents is 0. PR: kern/45291 Notes: svn path=/head/; revision=121263
* Add rfork_thread(3).Alan Cox2003-10-132-1/+102
| | | | Notes: svn path=/head/; revision=121074
* Changed EINVAL constant reference from UIO_MAXIOV to IOV_MAX.Diomidis Spinellis2003-10-111-1/+1
| | | | | | | | The former is a kernel-only visible constant, the latter the POSIX-specified userland constant defined by including limits.h. Notes: svn path=/head/; revision=121011
* Cite the published version of "Engineering a Sort Function" instead ofTim J. Robbins2003-09-301-4/+7
| | | | | | | an email address. Spell McIlroy correctly. Notes: svn path=/head/; revision=120598
* More style fixes to improve diffability with OpenBSD.Poul-Henning Kamp2003-09-271-46/+54
| | | | | | | Pull 'A' evilness for realloc(3) from OpenBSD. Notes: svn path=/head/; revision=120524
* Style changes to improve diffability against OpenBSD version.Poul-Henning Kamp2003-09-271-91/+91
| | | | Notes: svn path=/head/; revision=120520
* Fix fabs(). This commit brought to you by the letter 'l'.Peter Wemm2003-09-261-1/+1
| | | | | | | | | | | | (fstp stores a mem32 value, fstpl stores a mem64 value) This fixes ghostscript for 'make release' on amd64. Ghostscript for some reason thinks it is a good idea to use -fno-builtin, which means it is vulnerable to bugs in libc that are normally hidden by the builtin gcc functions. Oops. Notes: svn path=/head/; revision=120448
* From OpenBSD:Bill Fenner2003-09-151-1/+1
| | | | | | | | | | | | | | | always widen the imputed netmask if it is narrower than the specified octets. fixes a strange behaviour where inet_net_pton would always return 4 (bits) for multicast addresses no matter how many octets were specified. negotiated with Paul Vixie, original author of this function. PR: standards/53151 Submitted by: Max Laier <max@love2party.net> Optained from: OpenBSD Notes: svn path=/head/; revision=120107
* Our getaddrinfo() and getnameinfo() are thread-safe butHajimu UMEMOTO2003-09-152-2/+10
| | | | | | | | | some limitation. Reported by: Marc G. Fournier <scrappy@hub.org> Notes: svn path=/head/; revision=120084
* Get rid of duplicates.Ruslan Ermilov2003-09-143-3/+3
| | | | Notes: svn path=/head/; revision=120054
* mdoc(7): Fix common mistakes made in the SEE ALSO section.Ruslan Ermilov2003-09-123-6/+8
| | | | Notes: svn path=/head/; revision=120010
* mdoc(7): Properly mark C headers.Ruslan Ermilov2003-09-1020-29/+29
| | | | Notes: svn path=/head/; revision=119964
* Document the fact that send(2) can return EPIPE (like when a socket is notOllivier Robert2003-09-101-0/+4
| | | | | | | | | | | connected). PR: docs/56683 Submitted by: Chris S.J. Peron <maneo@bsdpro.com> MFC after: 3 days Notes: svn path=/head/; revision=119963
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-0862-105/+105
| | | | Notes: svn path=/head/; revision=119893
* In the !MNT_BYFSID case, return EINVAL from unmount(2) when theIan Dowse2003-09-081-7/+12
| | | | | | | | | | | | | | | | | specified directory is not found in the mount list. Before the MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent path and EINVAL for a non-mountpoint, but we can no longer distinguish between these cases. Of the two error codes, EINVAL was more likely to occur in practice, and it was the only one of the two that was documented. Update the manual page to match the current behaviour. Suggested by: tjr Reviewed by: tjr Notes: svn path=/head/; revision=119885