summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* These warnings are only relevant on NetBSD it seems. They don't seemWarner Losh2009-02-192-6/+0
| | | | | | | to be relevant to FreeBSD at all. Notes: svn path=/head/; revision=188827
* These symbols don't belong here. Remove them. Since mips hasn't hadWarner Losh2009-02-191-4/+0
| | | | | | | | | a release, I think there's no impact here... Reviewed by: cognet@ Notes: svn path=/head/; revision=188823
* Properly invalidate highest pts number when calling setttyent().Ed Schouten2009-02-121-5/+4
| | | | | | | | | | | | When calling setttyent() after calling endttyent(), pts_valid will never be set to 1, because the readdir()-loop will likely never vind a pts that has a higher number than before. Simplify the code by removing pts_valid. We'll just set maxpts to -1 when we don't have a valid count yet. Notes: svn path=/head/; revision=188536
* Make ttyslot(3) work with pts(4) devices.Ed Schouten2009-02-121-6/+5
| | | | | | | | | | It seems ttyslot() calls rindex(), to strip the device name to the last slash, but this is obviously invalid. /dev/pts/0 should be stripped until pts/0. Because /etc/ttys only supports TTY names in /dev/, just strip this piece of the pathname. Notes: svn path=/head/; revision=188534
* Add two new routines: fdevname() and fdevname_r().Ed Schouten2009-02-116-20/+88
| | | | | | | | | | | | | | | | | A more elegant way of obtaining a name of a character device by its file descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid file descriptor implies a file descriptor is visible in /dev, it will always resolve a valid device name. I'm adding a more friendly wrapper for this ioctl, called fdevname(). It is a lot easier to use than devname() and also has better error handling. When a device name cannot be resolved, it will just return NULL instead of a generated device name that makes no sense. Discussed with: kib Notes: svn path=/head/; revision=188497
* Shutup warning for DNAME RR.Hajimu UMEMOTO2009-02-082-2/+3
| | | | | | | | | PR: bin/127591 Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv> MFC after: 1 week Notes: svn path=/head/; revision=188316
* Fix language on atol(3) manpage. Add a COMPATIBILITY sectionGiorgos Keramidas2009-02-081-3/+32
| | | | | | | | | | | | | stating that in FreeBSD the atol() and atoll() functions affect errno in the same way as strtol() and stroll(). PR: docs/126487 Submitted by: edwin Reviewed by: trhodes, gabor MFC after: 1 week Notes: svn path=/head/; revision=188305
* Make sure the comparison is done with an unsigned char.Warner Losh2009-02-071-1/+1
| | | | Notes: svn path=/head/; revision=188295
* Standardize the various prison_foo_ip[46] functions and prison_if toJamie Gritton2009-02-051-2/+2
| | | | | | | | | | | | | | | | | | return zero on success and an error code otherwise. The possible errors are EADDRNOTAVAIL if an address being checked for doesn't match the prison, and EAFNOSUPPORT if the prison doesn't have any addresses in that address family. For most callers of these functions, use the returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or EINVAL. Always include a jailed() check in these functions, where a non-jailed cred always returns success (and makes no changes). Remove the explicit jailed() checks that preceded many of the function calls. Approved by: bz (mentor) Notes: svn path=/head/; revision=188144
* Fix the functions to match prototypes. The K&R definitions differWarner Losh2009-02-033-3/+3
| | | | | | | from the ANSI-C prototype due to the 'int promotion' rule. Notes: svn path=/head/; revision=188098
* - ANSIfy function definitionsDaniel Gerzo2009-02-0333-110/+41
| | | | | | | | | - use nul when we are looking for a terminating character where appropriate Approved by: imp Notes: svn path=/head/; revision=188080
* Provide a type for the argument.Roman Divacky2009-02-021-1/+1
| | | | | | | Approved by: kib (mentor) Notes: svn path=/head/; revision=188031
* - Remove superfluous commentGabor Kovesdan2009-01-301-2/+0
| | | | | | | | PR: docs/129400 Submitted by: Gavin Atkinson <gavin@freebsd.org> Notes: svn path=/head/; revision=187918
* Update the description of KERN_PROC.Tom Rhodes2009-01-281-5/+3
| | | | | | | | PR: 100242 Reviewed by: jhb Notes: svn path=/head/; revision=187824
* Better wording for clearing EOF indicator.Tom Rhodes2009-01-281-0/+4
| | | | | | | Submitted by: keramida and jhb Notes: svn path=/head/; revision=187823
* Remove another comment about clearing EOF indicator.Tom Rhodes2009-01-281-4/+1
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=187817
* Update the manpage to reflect r145172.David Schultz2009-01-281-2/+1
| | | | Notes: svn path=/head/; revision=187809
* Remove comment about clearerr() being the only method of clearingTom Rhodes2009-01-281-3/+1
| | | | | | | | | | | | the EOF indicator, fseek() may also be used for this. Bump document date. PR: 76333 Submitted by: Yoshihiko Sarumaru <mistral@imasy.or.jp> Notes: svn path=/head/; revision=187805
* - Fix grammar. [1]Xin LI2009-01-261-3/+3
| | | | | | | | | | | - Use the correct term 'long mode'. [2] - style(9) for return value. [3] Submitted by: Ben Kaduk <minimarmot gmail com> [1], obrien [2], scf [3] Notes: svn path=/head/; revision=187707
* Rewrite of MI strlen(3) in a way that can better utilize modern hardware byXin LI2009-01-251-15/+78
| | | | | | | | | | | | reducing branches and doing word-sized operation. The idea is taken from J.T. Conklin's x86_64 optimized version of strlen(3) for NetBSD, and reimplemented in C by me. Discussed on: -arch@ Notes: svn path=/head/; revision=187700
* Add support for multibyte thousands_sep encodings, e.g., U+066C.David Schultz2009-01-223-173/+225
| | | | | | | | | | | The integer thousands' separator code is rewritten in order to avoid having to preallocate a buffer for the largest possible digit string with the most possible instances of the longest possible multibyte thousands' separator. The new version inserts thousands' separators for integers using the same code as floating point. Notes: svn path=/head/; revision=187582
* - Add support for multibyte decimal_point encodings, e.g., U+066B.David Schultz2009-01-192-23/+49
| | | | | | | | A forthcoming gdtoa import is needed to make this fully work. - Improve the way "nan(...)" is parsed. Notes: svn path=/head/; revision=187422
* Add support for multibyte decimal_point encodings, e.g., U+066B.David Schultz2009-01-192-23/+35
| | | | Notes: svn path=/head/; revision=187421
* When f[w]printf() is called on an unbuffered file like stdout, itDavid Schultz2009-01-172-14/+23
| | | | | | | | | | | | | | | | | | | sets up a fake buffered FILE and then effectively calls itself recursively. Unfortunately, gcc doesn't know how to do tail call elimination in this case, and actually makes things worse by inlining __sbprintf(). This means that f[w]printf() to stderr was allocating about 5k of stack on 64-bit platforms, much of which was never used. I've reorganized things to eliminate the waste. In addition to saving some stack space, this improves performance in my tests by anywhere from 5% to 17% (depending on the test) when -fstack-protector is enabled. I found no statistically significant performance difference when stack protection is turned off. (The tests redirected stderr to /dev/null.) Notes: svn path=/head/; revision=187369
* Simplify printf's inlined output buffering routines. On amd64, thisDavid Schultz2009-01-171-18/+18
| | | | | | | reduces the code size by about 10% and improves performance slightly. Notes: svn path=/head/; revision=187354
* Change dstp to be const and remove bogus cast.Roman Divacky2009-01-151-2/+3
| | | | | | | | Submitted by: christoph.mallon at gmx.de Approved by: kib (mentor) Notes: svn path=/head/; revision=187312
* Introduce a local variable and use it instead of passed in parameterRoman Divacky2009-01-155-6/+16
| | | | | | | | | | | to get rid of restrict qualifier discarding. This lets libc compile cleanly in gnu99 mode. Suggested by: kib, christoph.mallon at gmx.de Approved by: kib (mentor) Notes: svn path=/head/; revision=187302
* Reduce code duplication by moving functions that are identical in bothDavid Schultz2009-01-153-427/+216
| | | | | | | | vfprintf.c and vfwprintf.c (except for char/wchar_t differences) to a common header file. Notes: svn path=/head/; revision=187284
* Convert the insidious macros that handle printf()'s buffering intoDavid Schultz2009-01-153-86/+204
| | | | | | | | | | | | | | slightly less evil inline functions, and move the buffering state into a struct. This will make it possible for helper routines to produce output for printf() directly, making it possible to untangle the code somewhat. In wprintf(), use the same buffering mechanism to reduce diffs to printf(). This has the side-effect of causing wprintf() to catch write errors that it previously ignored. Notes: svn path=/head/; revision=187277
* Document that ffsll(3) and flsll(3) functions first appeared inKonstantin Belousov2009-01-131-1/+1
| | | | | | | | | | FreeBSD 7.1 Submitted by: Jan Henrik Sylvester <me janh de> MFC after: 3 days Notes: svn path=/head/; revision=187147
* - add missing includeDaniel Gerzo2009-01-121-2/+3
| | | | | | | | | | | - fix struct memeber's name [1] PR: docs/130413 [1] Submitted by: Thomas Mueller <tmueller@sysgo.com> [1] MFC after: 3 days Notes: svn path=/head/; revision=187098
* o Language improvements from OpenBSD;Xin LI2009-01-121-17/+17
| | | | | | | | | o Use an ISC-style license as did by the author. Obtained from: OpenBSD Notes: svn path=/head/; revision=187091
* o ANSIfy.Xin LI2009-01-121-29/+12
| | | | | | | | | o Use ISC style copyright as did by the author. Obtained from: OpenBSD Notes: svn path=/head/; revision=187090
* Sort MLINKS.Ruslan Ermilov2009-01-091-21/+32
| | | | Notes: svn path=/head/; revision=186957
* Set the error indicator on an attempt to write to a read-only stream.David Schultz2009-01-081-0/+1
| | | | | | | | PR: 127335 MFC after: 2 weeks Notes: svn path=/head/; revision=186887
* Document the special loopback address behaviour of jails.Bjoern A. Zeeb2009-01-061-1/+7
| | | | | | | | | | PR: kern/103464 Submitted by: brueffer (correct markup) Reviewed by: brueffer MFC after: 2 weeks Notes: svn path=/head/; revision=186834
* - forgot to bump a dateDaniel Gerzo2009-01-061-1/+1
| | | | Notes: svn path=/head/; revision=186819
* catch up wtih r175955 by ume:Daniel Gerzo2009-01-061-53/+2
| | | | | | | - the support of AI_ALL and AI_V4MAPPED has been completely removed. Notes: svn path=/head/; revision=186817
* Note that the protocol argument can be set to 0.Tom Rhodes2009-01-051-1/+6
| | | | | | | | PR: 127890 Reviewed by: rwatson Notes: svn path=/head/; revision=186769
* Document that kldunloadf can return EINVAL.Tom Rhodes2008-12-251-1/+5
| | | | | | | PR: 125639 Notes: svn path=/head/; revision=186489
* Add support for the FPA floating-point format on ARM. TheMarcel Moolenaar2008-12-233-3/+23
| | | | | | | | | | | | FPA floating-point format is identical to the VFP format, but is always stored in big-endian. Introduce _IEEE_WORD_ORDER to describe the byte-order of the FP representation. Obtained from: Juniper Networks, Inc Notes: svn path=/head/; revision=186461
* Add an ENVIRONMENT section to note that the RSH variable can be set toMurray Stokely2008-12-141-0/+7
| | | | | | | | | | | override the use of the rsh(1) program in rcmd(3). PR: docs/51133 Obtained from: NetBSD, partially MFC after: 3 weeks Notes: svn path=/head/; revision=186095
* Merge the resolver part of BIND 9.4.3 into HEAD.Hajimu UMEMOTO2008-12-147-28/+182
| | | | | | | | | | | | | It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com> Notes: svn path=/head/; revision=186090
* Consolidate some variable initializations. No substantive change.David Schultz2008-12-112-13/+13
| | | | Notes: svn path=/head/; revision=185904
* Move the xprintf hook to where it belongs; it shouldn't be in theDavid Schultz2008-12-101-6/+4
| | | | | | | middle of vfprintf's variable declarations. Notes: svn path=/head/; revision=185825
* o Use full month name in .Dd macro.Maxim Konovalov2008-12-091-1/+1
| | | | Notes: svn path=/head/; revision=185789
* Import the strndup(3) function.Konstantin Belousov2008-12-064-3/+75
| | | | | | | | | | | Copyright attribution is kept the same as in original NetBSD source. Submitted by: Florian Smeets <flo kasimir com> Obtained from: NetBSD MFC after: 2 weeks Notes: svn path=/head/; revision=185690
* Order the str*.c files mostly alphabetical.Konstantin Belousov2008-12-061-3/+3
| | | | | | | | Submitted by: Florian Smeets <flo kasimir com> MFC after: 2 weeks Notes: svn path=/head/; revision=185689
* Add an easier example.Pawel Jakub Dawidek2008-12-051-1/+16
| | | | | | | Reviewed by: trasz Notes: svn path=/head/; revision=185641
* The times(3) function returns the number of CLK_TCKs since theGiorgos Keramidas2008-12-011-4/+9
| | | | | | | | | | | startup time of FreeBSD, not since the UNIX Epoch. PR: docs/122359 Submitted by: Viktor &#352;tujber MFC after: 1 week Notes: svn path=/head/; revision=185519