summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* 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
* While there, trim some trailing whitespace.ed2010-02-211-1/+0
|
* Add proper const keywords to sysctl(3) parameters.ed2010-02-214-25/+15
| | | | | | | | | | | | | The `name' and `newp' arguments can be marked const, because the buffers they refer to are never changed. While there, perform some other cleanups: - Remove K&R from sysctl.c. - Implement sysctlbyname() using sysctlnametomib() to prevent duplication of an undocumented kernel interface. - Fix some whitespace nits. It seems the prototypes are now in sync with NetBSD as well.
* - More style(9) fixupsgabor2010-02-201-26/+29
| | | | Approved by: delphij (mentor)
* Mention EISDIR as a possible errno.phk2010-02-171-0/+2
|
* Define TLS_MODEL for PowerPC as well. Since PowerPC uses variant I,marcel2010-02-161-0/+1
| | | | like ia64, leave it empty (default model).
* %U was macroized in mdoc(7), escape.ru2010-02-162-2/+2
|
* Unbreak ia64: tls_model("initial-exec") is invalid, because it assumesmarcel2010-02-161-11/+9
| | | | | | the static TLS model, which is fundamentally different from the dynamic TLS model. The consequence was data corruption. Limit the attribute to i386 and amd64.
* The static TLS size as given by tls_static_space includes TLS_TCB_SIZEmarcel2010-02-161-2/+2
| | | | bytes of TCB in variant I.
* s/APIS/APIs - not part of the original submission.trhodes2010-02-111-2/+2
|
* o Add support for COMPAT_IA32.marcel2010-02-111-13/+21
| | | | | | | | | | o Incorporate review comments: - Properly reference and lock the map - Take into account that the VM map can change inbetween requests - Add the fileid and fsid attributes Credits: kib@ Reviewed by: kib@
* Correct two typoes.trhodes2010-02-111-1/+1
| | | | Submitted by: Matthew Seaman <m.seaman@infracaninophile.co.uk>
* Fix PRcracauer2010-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/143350 Empty string test gone wrong. Testing this requires that you have a locale that has the sign string unset but has int_n_sign_posn set (the default locale falls through to use "()" around negative numbers which is probably another bug). I created that setup by hand and indeed without this fix negative numbers are put out as positive numbers (doesn't fall through to use "-" as default indicator). Unfixed example in nl_NL.ISO8859-1 with lc->negative_sign set to empty string: strfmon(buf, sizeof(buf), "%-8i", -42.0); ==> example2: 'EUR 42,00' 'Eu 42,00' Fixed: example2: 'EUR 42,00-' 'Eu 42,00-' This file and suggested fix are identical in at least freebsd-8. Backport might be appropriate but some expert on locales should probably have a look at us defaulting to negative numbers in parenthesis when LC_* is default. That doesn't look right and is not what other OSes are doing. PR: 143350 Submitted by: Corinna Vinschen Reviewed by: bug reporter submitted, tested by me
* - Deal with some special cases [1]gabor2010-02-091-30/+54
| | | | | | | - style(9) nits Pointed out by: jilles [1] Approved by: delphij (mentor)
* Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process canmarcel2010-02-091-1/+76
| | | | | | | | obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month
* Mark up "unsigned char".ru2010-02-044-4/+11
|
* Reinstate the ptrace patch to restore the 'gp' register after callingneel2010-02-041-0/+3
| | | | | | | | | | a function. I made a mistake in assuming that the .cprestore directive will cause the assembler to automatically restore 'gp' after the 'jalr'. The .cprestore directive does its magic only after 'jal' and 'bal' instructions - not the 'jalr'. Pointed out by: c.jayachandran@gmail.com
* -White space cleanup (missing spaces in new line)rrs2010-02-031-5/+2
| | | | | | -Remove extra tab. -Took out the duplicate code that cprestore does. All suggested by Neel.
* Also add a cross-reference to NetBSD updlastlogx().ed2010-02-031-1/+3
|
* This fixes a bug found and fixed by JC. Basicallyrrs2010-02-031-1/+13
| | | | | | | no save was being done of the ra and gp pointers before we call the __error function. Obtained from: JC (c.jayachandran@gmail.com)
* Bump .Dd, forgotten in r203393gavin2010-02-021-1/+1
| | | | | Approved by: ed (mentor, implicit) MFC after: 1 week
* The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.gavin2010-02-021-1/+1
| | | | | | | | | This bug in the man page has gone unnoticed for over 15 years! PR: docs/143461 Submitted by: Jeremy Huddleston jeremyhu apple.com Approved by: ed (mentor, implicit) MFC after: 1 week
* Implement strndup(3) using strnlen(3).ed2010-02-021-3/+1
| | | | | This makes the implementation a bit more consistent with strdup(3), which uses strlen(3).
OpenPOWER on IntegriCloud