summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* mdoc: order prologue macros consistently by Dd/Dt/Osuqs2010-04-1413-13/+13
| | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors)
* mdoc: don't abuse Bo/Pc to get what looks like an intervaluqs2010-04-141-1/+1
| | | | | | | | | Be explicit and use the general bracketing form plus symbols which are to be interpreted mathematically in this case. Complaint by: mdocml Reviewed by: ru Approved by: philip, ed (mentors)
* mdoc: remove .Pp where not neededuqs2010-04-145-12/+0
| | | | | | | This trips up mdocml and can simply go away. Reviewed by: ru Approved by: philip, ed (mentors)
* Align the declaration for sa_sigaction with POSIX.kib2010-04-131-2/+2
| | | | MFC after: 3 days
* Add #endif missed in r206490.marius2010-04-111-0/+1
|
* While SPARC V9 allows tininess to be detected either before or aftermarius2010-04-111-0/+3
| | | | | | | | | | | rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tininess is detected before rounding therefore rounding up to the smallest normalized number should set the underflow flag. This change is needed for using SoftFloat on sparc64 for reference purposes. PR: 144900 Submitted by: Peter Jeremy
* Use the stored length value instead of calculating it by strlen().ume2010-04-061-8/+6
|
* I feel this wording of the history is more clear.obrien2010-04-052-9/+6
| | | | ANSIfy vasprintf() while I'm here.
* libc/db/hash: cap auto-tuned block size with a value that actually worksavg2010-04-052-1/+3
| | | | | | | | | | | | | This fix mostly matters after r206129 that made it possible for st_blksize to be greater than 4K. For this reason, this change should be MFC-ed before r206129. Also, it seems that all FreeBSD uitlities that use db(3) hash databases and create new databases in files, specify their own block size value and thus do not depend on block size autotuning. PR: bin/144446 Submitted by: Peter Jeremy <peterjeremy@acm.org> MFC after: 5 days
* hash.3: fix a factual mistake in the man pageavg2010-04-051-1/+1
| | | | | | PR: bin/144446 Submitted by: Peter Jeremy <peterjeremy@acm.org> MFC after: 3 days
* Add capability to use a db version of services. It is enabled byume2010-04-042-1/+204
| | | | | | specifying `db' as source of service in /etc/nsswitch.conf. MFC after: 2 weeks
* Reduce duplicate code.ume2010-04-041-59/+33
| | | | MFC after: 2 weeks
* Treat '+' as special only when in compat mode, and simplifyume2010-04-041-22/+19
| | | | | | the logic bit. MFC after: 2 weeks
* Stop adding trailing '\n'. The servent_unpack() doesn't expectume2010-04-041-10/+3
| | | | | | lines terminated with '\n'. MFC after: 2 weeks
* Add prototype for libc internal interfaces.delphij2010-03-312-0/+4
|
* Add prototypes for libc private interfaces.delphij2010-03-311-5/+9
| | | | | | While I'm there, apply __unused whenever appropriate. Reviewed by: md5(1)
* Make acl_to_text_np(3) not crash on long group or user names in NFSv4 ACLs.trasz2010-03-281-7/+4
| | | | | PR: amd64/145091 MFC after: 2 weeks
* Don't forget to bump the date in the man page.ed2010-03-281-1/+1
|
* Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.ed2010-03-281-11/+17
| | | | | | | | | | | | | | | A nice thing about POSIX 2008 is that it finally standardizes a way to obtain file access/modification/change times in sub-second precision, namely using struct timespec, which we already have for a very long time. Unfortunately POSIX uses different names. This commit adds compatibility macros, so existing code should still build properly. Also change all source code in the kernel to work without any of the compatibility macros. This makes it all a less ambiguous. I am also renaming st_birthtime to st_birthtim, even though it was a local extension anyway. It seems Cygwin also has a st_birthtim.
* - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.gahr2010-03-242-3/+3
| | | | | Approved by: cognet MFC after: 1 week
* Reject attempts to create a MAP_ANON mapping with a non-zero offset.jhb2010-03-231-1/+6
| | | | | | PR: kern/71258 Submitted by: Alexander Best MFC after: 2 weeks
* Let opendir() use O_DIRECTORY.ed2010-03-211-2/+2
| | | | | I am not removing the fstat() calls here, since we cannot yet assume people will always run kernels that respect O_DIRECTORY.
* Actually make O_DIRECTORY work.ed2010-03-211-0/+12
| | | | | | According to POSIX open() must return ENOTDIR when the path name does not refer to a path name. Change vn_open() to respect this flag. This also simplifies the Linuxolator a bit.
* Avoid aliasing which leads to incorrect results when compiling with themarius2010-03-211-12/+11
| | | | | | | | default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* - While SPARC V9 allows tininess to be detected either before or aftermarius2010-03-201-5/+10
| | | | | | | | | | | | | rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tinyness is detected before rounding, therefore rounding up to the smallest normalised number should set the underflow flag. - If an infinite result is rounded down, the result should have an exponent 1 less than the value for infinity. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* Division should take both arguments' signs into account when themarius2010-03-201-7/+9
| | | | | | | | the dividend is infinity or zero and the divisor is not the same. PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* FPU_DEBUG requires <stdio.h>.marius2010-03-203-1/+12
| | | | | | PR: 144900 Submitted by: Peter Jeremy MFC after: 3 days
* Ensure that __fpu_ftox() both returns the high bits and res[1] containsmarius2010-03-201-5/+7
| | | | | | | | the low bits also in the default case. PR: 144900 Obtained from: OpenBSD MFC after: 3 days
* - Remove a bogus forward declaration.marius2010-03-202-7/+3
| | | | - Fix whitespace.
* Comment a fine point, so it does not get lost when people borrow codephk2010-03-151-0/+4
| | | | from FreeBSD for other purposes.
* Correct bugs fixed but not merged from my own tree.delphij2010-03-131-2/+3
| | | | | Pointy hat to: delphij MFC after: 1 month
* Follow up commit to reindent the code.delphij2010-03-121-13/+13
| | | | MFC after: 1 month
* Two optimizations to MI strlen(3) inspired by David S. Miller'sdelphij2010-03-121-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blog posting [1]. - Use word-sized test for unaligned pointer before working the hard way. Memory page boundary is always integral multiple of a word alignment boundary. Therefore, if we can access memory referenced by pointer p, then (p & ~word mask) must be also accessible. - Better utilization of multi-issue processor's ability of concurrency. The previous implementation utilized a formular that must be executed sequentially. However, the ~, & and - operations can actually be caculated at the same time when the operand were different and unrelated. The original Hacker's Delight formular also offered consistent performance regardless whether the input would contain characters with their highest-bit set, as it catches real nul characters only. These two optimizations has shown further improvements over the previous implementation on microbenchmarks on i386 and amd64 CPU including Pentium 4, Core Duo 2 and i7. [1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1 MFC after: 1 month
* Fix several typos in macros or macro misusage.uqs2010-03-121-0/+1
| | | | | | Found by: make manlint Reviewed by: ru Approved by: philip (mentor)
* - Use an initializer macro to initialize fields in 'fake' FILE objects usedjhb2010-03-1112-39/+22
| | | | | | | | | | | | by *sprintf(), etc. - Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE objects. This is currently a nop on FreeBSD, but is import for other platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply zero. PR: threads/141198 Reported by: Jeremy Huddleston @ Apple MFC after: 2 weeks
* Fix a bug in the previous change: remove function-local definition ofjhb2010-03-111-1/+0
| | | | | | | tcp_key and udp_key that shadows the global definition. PR: threads/144558 Submitted by: Sam Robb
* Fix a typo in r204974 so that FTYPE_LNG matches the initialisers ofmarius2010-03-111-1/+1
| | | | | | the opmask array. Pointed out by: Peter Jeremy
* - The OPSZ macro actually only does the right thing for int32 and int64marius2010-03-102-29/+21
| | | | | | | | | | | | | | | | | operands but not for double and extended double ones. Instead of trying to fix the macro just nuke it and unroll the loops in the correct way though as extended double operands turn out to be the only special case. - For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded after setting type accordingly as it's generally decoded using the low 2 bits as the type, which are 0 for these three instructions. - Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be re-decoded using not only the operand mask appropriate for int64 but also the correct register number encoding. - Use const where appropriate. - Wrap long lines. Submitted by: Peter Jeremy (partly) MFC after: 3 days
* Use thr_once() with once_t controls to initialize various thread_key_tjhb2010-03-108-64/+81
| | | | | | | | | | | | objects used to provide per-thread storage in the RPC code. Almost all of these used double-checking with a dedicated mutex (tsd_lock) to do this before. However, that is not always safe with more relaxed memory orders. There were also other bugs, such as one in __rpc_createrr() that caused a new key to be allocated each time __rpc_createrr() was invoked. PR: threads/144558 Reported by: Sam Robb samrobb of averesystems com (key leak) MFC after: 1 week
* Switch to our preferred license text.joel2010-03-071-8/+8
| | | | Approved by: jedgar
* Use our standard license text. No more voices in the authors head. :-)joel2010-03-049-72/+72
| | | | Approved by: trasz
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-031-7/+0
| | | | | | their software. Obtained from: NetBSD
* In reallocf(3), free the memory only when size != 0. Otherwise, when thejh2010-03-031-1/+8
| | | | | | | | System V compatibility option (malloc "V" flag) is in effect a zero sized reallocf() could cause a double free. PR: bin/141753 Submitted by: Dan Lukes
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-024-28/+0
| | | | | | their software. Obtained from: NetBSD
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-025-35/+0
| | | | | | their software. Obtained from: NetBSD
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-026-42/+0
| | | | | | their software. Obtained from: NetBSD
* Rewrite red-black trees to do lazy balance fixup. This improvesjasone2010-02-282-772/+837
| | | | insert/remove speed by ~30%.
* In _gettemp(), check that the length of the path doesn't exceedjh2010-02-281-0/+4
| | | | | | | | MAXPATHLEN. Otherwise the path name (or part of it) may not fit to carrybuf causing a buffer overflow. PR: bin/140228 Suggested by: jilles
* Split the contributed code from libc/stdtime from lib/libc/stdtimeedwin2010-02-2610-3621/+5
| | | | to contrib/tzcode/stdtime.
* Make pause(3) implementation not depended on the legacy sigcompat.ckib2010-02-251-1/+7
| | | | | | | interfaces. Do not block rt signals during and after pause(3) calls. Use private libc namespace to call proper methods. MFC after: 1 week
OpenPOWER on IntegriCloud