summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* The UTF-8 decoder should not accept byte sequences which decode to unicodestsp2010-08-051-1/+9
| | | | | | | | | code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 http://unicode.org/faq/utf_bom.html#utf8-4 ok phessler, millert, miod, deraadt
* When the target pointer 'pwcs' passed to mbsrtowcs() is NULL, mbsrtowcs()stsp2010-08-031-15/+9
| | | | | | | | | | | | | | | | | | | | | is supposed to ignore the 'n' parameter and return the number of wide characters needed to represent the given multi-byte character sequence. However, in the special case where 'pwcs' is NULL and 'n' is zero, our mbsrtowcs() implementation for single-byte locales mistakenly returned zero. Before the UTF-8 locale was added, this bug was invisible to callers of mbstowcs() because mbstowcs() handled this special case itself. But our new mbstowcs() implementation simply forwards to the locale-specific mbsrtowcs() implementation and expects it to do the right thing. The "awesome" window manager's "Run:" command prompt uses mbstowcs() to measure how many (possibly multi-byte) characters a user has typed, and due to this bug would always be tricked into thinking the user had entered zero characters when a single-byte locale was used. Found after prodding by dcoppa. ok deraadt sthen espie
* add missing header needed by strcmp()chl2010-08-012-2/+6
| | | | | | add missing prototype ok stsp@
* Remove stray newline, fix $OpenBSD$; ok deraadtstsp2010-07-292-3/+2
|
* Sync hcreate(3) with NetBSD, adding some caveats.ray2010-07-281-12/+67
| | | | OK jmc
* Remove a stray space. No binary change.marco2010-07-271-2/+2
|
* Replace the single-byte placeholders for the multi-byte/wide-characterstsp2010-07-2724-155/+1259
| | | | | | | | | | | | | | | | | | | | | | | | | | | conversion interfaces of libc (mbrtowc(3) and friends) with new implementations that internally call an API based on NetBSD's citrus. This allows us to support locales with multi-byte character encodings. Provide two implementations of the citrus-based API: one based on the old single-byte placeholders for use with our existing single-byte character locales (C, ISO8859-*, KOI8, CP1251, etc.), and one that provides support for UTF-8 encoded characters (code based on FreeBSD's implementation). Install the en_US.UTF-8 ctype locale support file, and allow the UTF-8 ctype locale to be enabled via setlocale(3) (export LC_CTYPE='en_US.UTF-8'). A lot of programs, especially from ports, will now start using UTF-8 if the UTF-8 locale is enabled. Use at your own risk, and please report any breakage. Note that ncurses-based programs cannot display UTF-8 right now, this is being worked on. To prevent install media growth, add vfprintf(3) and mbrtowc(3) to libstubs. The mbrtowc stub was copied unchanged from its old single-byte placeholder. vfprintf.c doesn't need to be copied, just put in .PATH (hint by fgsch@). Testing by myself, naddy, sthen, nicm, espie, armani, Dmitrij D. Czarkoff. ok matthieu espie millert sthen nicm deraadt
* fix some spacing issues; noted by kristapsjmc2010-07-271-7/+6
|
* Add a newline to the input we feed to cpp to get rid of its 'no newlineguenther2010-07-241-3/+3
| | | | | | | at end of file' warnings. Simplify the shell quoting to make it easier to read while we're at it "looks allright" beck@
* getopt_long.c replaced getopt.c 6+ years ago; we can retireblambert2010-07-221-7/+1
| | | | | | the REPLACE_GETOPT macro, at long last ok millert@
* Correct the #includes to avoid warnings in <rpc/svc.h>guenther2010-07-171-2/+3
| | | | ok miod@
* More delimiters that need quoting inside macros, hunted down by jmc@,schwarze2010-07-152-10/+10
| | | | who asked me to commit because he is just running out of the door.
* update our recommended hash function to sha256 and note md5 is broken.tedu2010-07-131-9/+4
| | | | ok deraadt jmc millert sobrado
* no more rmd160(1);jmc2010-07-131-3/+2
|
* Switch hppa, i386 and powerpc to gcc4. Bump libc major to handle ABI cornerkettenis2010-07-081-1/+1
| | | | cases fixed in gcc4.
* Document new unsetenv() error returns.naddy2010-07-061-2/+8
| | | | From Nicolas Legrand <nlegrand@ethelred.fr>; ok jmc@
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-033-20/+21
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* Constipate init_hash() to eliminate a warning and remove a cast that isguenther2010-07-021-4/+4
| | | | | thereby rendered superfluous ok blambert@
* sort SEE ALSO;jmc2010-07-012-6/+6
|
* getpeereid() can now be a library routine using getsockopt() withderaadt2010-07-016-22/+52
| | | | | | | SOL_SOCKET and SO_PEERCRED, only issue being that it cannot return EFAULT for a page fault. The kernel code will soon be put into compat, and then in 10 years or so tedu will delete it. ok guenther millert
* zap trailing whitespace;jmc2010-07-011-3/+3
|
* Add getsockopt SOL_SOCKET SO_PEERCRED support. This behaves similar toderaadt2010-06-301-7/+16
| | | | | | | getpeereid(2), but also supplies the remote pid. This is supplied in a 'struct sockpeercred' (unlike Linux -- they showed how little they know about real unix by calling theirs 'struct ucred'). ok guenther ajacoutot
* use a union to align the dns answer buffer until gcc4 is fixedderaadt2010-06-291-5/+8
|
* RTHREADS option is gone, now it's a sysctl. spotted by jmctedu2010-06-291-5/+4
|
* briefly document kern.rthreadstedu2010-06-291-2/+6
|
* use a union to align the dns answer buffer until gcc4 is fixedderaadt2010-06-291-5/+8
|
* Make unsetenv(NULL) and unsetenv("") give EINVAL, per POSIX. ok deraadt@naddy2010-06-291-1/+5
|
* Avoid using and end pointer since strnlen(string, -1) is legalmillert2010-06-021-4/+3
| | | | | and would otherwise result in overflowing the end pointer and cause strnlen() to return 0. OK sthen@
* Switch amd64 and sparc64 over to gcc4; bump libc major to deal with the ABIkettenis2010-05-261-2/+2
| | | | | | | corner cases that were fixed in gcc4, and changes in libgcc that we may have missed. ok kettenis@
* oops - forgot to check for trailing whitespace;jmc2010-05-261-2/+2
|
* reword the 'D' dump bit to make it clear that the malloc.out file needsthib2010-05-261-4/+5
| | | | | | | to exist before exit for malloc to dump stats in it. tweaks from jmc@ ok otto@,jmc@
* Add HISTORY section, mostly for strnlen() but include strlen() formillert2010-05-241-2/+11
| | | | completeness (verified).
* remove unused variable.chl2010-05-211-2/+1
| | | | ok millert@ tedu@
* remove unused variablechl2010-05-191-2/+1
| | | | ok nicm@
* tweak previous;jmc2010-05-194-20/+16
|
* add posix_madvise, posix_memalign, strndup, and strnlen. mostly fromtedu2010-05-1814-27/+325
| | | | | brad and millert, with hints from guenther, jmc, and otto I think. ok previous.
* Defer installing signal handlers until echo is disabled so that wemillert2010-05-141-39/+41
| | | | | | get suspended normally when not the foreground process. Fix potential infinite loop when restoring terminal settings if process is in the background when restore occurs. OK miod@
* Mark _MCOUNT_DECL as __used to prevent gcc4 from optimizing it away when itkettenis2010-05-091-2/+2
| | | | | | is only referenced from inline asm. ok jsg@
* Do not return success when the IPv6 address has a :: and 8 hex sections.claudio2010-05-061-3/+4
| | | | | | ::1:2:3:4:5:6:7:8 for example. PR 6277, fix by Jun KAWAI (kwj at vlax net) OK henning, gilles, jsing (who also reminded me to remove the now wrong comment about superfluous ::)
* Recycle unused disklabel fields in order to create a disklabel uniquejsing2010-04-231-2/+0
| | | | | | | identifier, allowing the disk to be identified without relying on the device name. ok deraadt@ krw@ beck@ marco@ todd@
* Get rid of MAXSENSORDEVICES. Gaps in sensordev lists are now handledderaadt2010-04-201-2/+7
| | | | | | | by returning ENXIO instead of ENOENT, to essentially indicate hotplug sensor that has gone away. Accessing beyond the end of the sensordev list still returns ENOENT, so that you can see there are no further devices. ok kettenis oga
* Mention that kern.somaxconn is the real upper limit to the listenmillert2010-04-141-4/+6
| | | | queue depth. OK deraadt@ kettenis@
* clarify that strptime reads, not writes, strings when handling %%.tedu2010-04-121-3/+3
| | | | ok deraadt jmc
* - nuke some unneeded Pp; from kristapsjmc2010-04-071-6/+3
| | | | - small tweak while here
* Add missing documention:guenther2010-04-031-2/+18
| | | | | | | | - fork1() flags: FORK_SIGHAND, FORK_PTRACE, and FORK_THREAD - RTHREADS kernel option - rfork() RFTHREAD flag (with a BUGS entry that it's not usable from C) ok tedu@
* fix a potential memory leak found by zinovik@schwarze2010-04-021-39/+30
| | | | | | | | | while here, make sure each error path sets YP_YPERR and make the function shorter and easier to read by using the idiom "if (error) goto fail" everywhere in the loop and by putting xdr_free in exactly one place near the end ok deraadt@
* WARNINGS -> CAVEATS, and a little neccessary cleanup;jmc2010-04-015-49/+49
|
* typoderaadt2010-04-011-2/+2
|
* document that setting the time of the machine is unsafe. explain why,deraadt2010-04-011-2/+18
| | | | | and suggest workarounds ok guenther
* describe better what KERN_PROC_ARGV and KERN_PROC_ENV return; ok jmc@otto2010-03-301-2/+9
|