#
26d4f5e9 |
| 11-Feb-2009 |
Ed Schouten <ed@FreeBSD.org> |
Add two new routines: fdevname() and fdevname_r().
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
Add two new routines: fdevname() and fdevname_r().
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
show more ...
|
#
544048ec |
| 31-Jan-2009 |
David Schultz <das@FreeBSD.org> |
Add a function attribute called `__malloc_like', which informs gcc that the annotated function returns a pointer that doesn't alias any extant pointer. This results in a 50%+ speedup in microbenchmar
Add a function attribute called `__malloc_like', which informs gcc that the annotated function returns a pointer that doesn't alias any extant pointer. This results in a 50%+ speedup in microbenchmarks such as the following:
char *cp = malloc(1), *buf = malloc(BUF); for (i = 0; i < BUF; i++) buf[i] = *cp;
In real programs, your mileage will vary. Note that gcc already performs this optimization automatically for any function called `malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is used.
show more ...
|
Revision tags: release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0 |
|
#
c0046493 |
| 22-Jul-2008 |
Andrey A. Chernov <ache@FreeBSD.org> |
Add arc4random_uniform()
Obtained from: OpenBSD
|
#
3204108b |
| 21-Jul-2008 |
Andrey A. Chernov <ache@FreeBSD.org> |
Add arc4random_buf. Style: remove arg names from arc4random_addrandom.
|
Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
2966d28c |
| 04-Jul-2007 |
Sean Farley <scf@FreeBSD.org> |
Significantly reduce the memory leak as noted in BUGS section for setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value.
Convert all calls to POSIX fr
Significantly reduce the memory leak as noted in BUGS section for setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value.
Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT.
Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv().
New regression module for tools/regression/environ to test these functions. It also can be used to test the performance.
Bump __FreeBSD_version to 700050 due to API change.
PR: kern/99826 Approved by: wes Approved by: re (kensmith)
show more ...
|
#
ba174a5e |
| 01-May-2007 |
Andrey A. Chernov <ache@FreeBSD.org> |
Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and r
Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that.
Anyone who interested in POSIX can dig out what changes and how through cvs diffs.
show more ...
|
#
86580aa6 |
| 30-Apr-2007 |
Andrey A. Chernov <ache@FreeBSD.org> |
Fix unsetenv and putenv prototypes to conform Open Group specs Issue 6 (also IEEE Std 1003.1-2001)
|
Revision tags: release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
c74dfa2f |
| 14-Mar-2006 |
Andre Oppermann <andre@FreeBSD.org> |
Import of OpenBSD's strtonum(3) which is a nicer version of strtoll(3) providing proper error checking and other improvements.
Obtained from: OpenBSD Requested by: flz (to port Open[BGP|OSPF]D) MFC
Import of OpenBSD's strtonum(3) which is a nicer version of strtoll(3) providing proper error checking and other improvements.
Obtained from: OpenBSD Requested by: flz (to port Open[BGP|OSPF]D) MFC after: 3 days
show more ...
|
#
b3d51d3a |
| 12-Jan-2006 |
Jason Evans <jasone@FreeBSD.org> |
Expose the posix_memalign() prototype, now that the function is implemented by libc.
|
#
257551c6 |
| 24-Dec-2005 |
Tom Rhodes <trhodes@FreeBSD.org> |
Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convert between a 32-bit integer and a radix-64 ASCII string. The l64a_r() function is a NetBSD addition.
PR: 51209 (based on subm
Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convert between a 32-bit integer and a radix-64 ASCII string. The l64a_r() function is a NetBSD addition.
PR: 51209 (based on submission, but very different) Reviewed by: bde, ru
show more ...
|
#
866196b6 |
| 23-Dec-2005 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add abort2() prototype
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
9d301680 |
| 12-Sep-2005 |
Stefan Farfeleder <stefanf@FreeBSD.org> |
Fix the prototypes for devname() and devname_r(), the first two argument types are supposed to be dev_t and mode_t (prefixed with __ due to namespace reasons).
|
Revision tags: release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0 |
|
#
17ebe400 |
| 09-Jan-2005 |
Tim J. Robbins <tjr@FreeBSD.org> |
Implement rpmatch(), a semi-standard interface (as found on AIX, Tru64, GNU) for determining whether a string is an affirmative or negative response to a question according to the current locale. Thi
Implement rpmatch(), a semi-standard interface (as found on AIX, Tru64, GNU) for determining whether a string is an affirmative or negative response to a question according to the current locale. This is done by matching the response against nl_langinfo(3) items YESEXPR and NOEXPR.
show more ...
|
Revision tags: release/5.3.0_cvs, release/5.3.0, release/4.10.0_cvs, release/4.10.0, release/5.2.1_cvs, release/5.2.1 |
|
#
8720578d |
| 23-Feb-2004 |
Andrey A. Chernov <ache@FreeBSD.org> |
POSIX clearly states that getsubopt() should be declared in <stdlib.h>, not in <unistd.h>
|
Revision tags: release/5.2.0_cvs, release/5.2.0 |
|
#
12eb46c8 |
| 07-Dec-2003 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Change the definition of NULL on ia64 (for LP64 compilations) from an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always
Change the definition of NULL on ia64 (for LP64 compilations) from an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always passed in registers on ia64, which by virtue of the generated code implicitly widens ints to longs and allows the use of an 32-bit integral type for 64-bit arguments. Subsequent arguments are passed onto the memory stack, which does not exhibit the same behaviour and consequently do not allow this. In practice this means that variadic functions taking pointers and given NULL (without cast) work as long as the NULL is passed in one of the first 8 arguments. A SIGSEGV is more likely the result if such would be done for stack-based arguments. This is due to the fact that the upper 4 bytes remain undefined. 2. All 64-bit platforms that FreeBSD supports, with the obvious exception of ia64, allow 32-bit integral types (specifically NULL) when 64-bit pointers are expected in variadic functions by way of how the compiler generates code. As such, code that works correctly (whether rightfully so or not) on any platform other than ia64, may fail on ia64.
To more easily allow tweaking of the definition of NULL, this commit removes the 12 definitions in the various headers and puts it in a new header that can be included whenever NULL is to be made visible.
This commit fixes GNOME, emacs, xemacs and a whole bunch of ports that I don't particularly care about at this time...
show more ...
|
Revision tags: release/4.9.0_cvs, release/4.9.0 |
|
#
0ab6a0c7 |
| 25-Jun-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Push the alloca #error warning farther down to play nicer with some out of tree local translator.
Requested by: jmallett
|
#
76a1e6ad |
| 25-Jun-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Fix a mismerge.
|
#
d7875fc3 |
| 25-Jun-2003 |
David E. O'Brien <obrien@FreeBSD.org> |
Don't blindly provide alloca() for all compilers -- it is too implementation dependent. Instead provide one for GCC & Intel's GCC copy and one for lint. Anyone using any other translator tool needs
Don't blindly provide alloca() for all compilers -- it is too implementation dependent. Instead provide one for GCC & Intel's GCC copy and one for lint. Anyone using any other translator tool needs to look closely at how that tool can handle alloca.
show more ...
|
#
9c96ff4d |
| 22-Jun-2003 |
David Malone <dwmalone@FreeBSD.org> |
Remove argument names from a function declaration.
Reviewed by: phk
|
#
529ac587 |
| 20-Jun-2003 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add devname_r(3) which takes a buffer as argument.
|
#
79806b4c |
| 15-Jun-2003 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Use __builtin_alloca() on compilers that have it. Keep the prototype for the benefit of lint and non-{GNU,Intel} compilers.
|
Revision tags: release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0 |
|
#
6a66acb5 |
| 12-Mar-2003 |
David Schultz <das@FreeBSD.org> |
Replace our ancient dtoa/strtod implementation with the gdtoa package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc
Replace our ancient dtoa/strtod implementation with the gdtoa package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc to support these routines for all kinds of ``long double''. - Update printf() to reflect the fact that dtoa works slightly differently now.
As soon as I see that nothing has blown up, I will kill src/lib/libc/stdlib/strtod.c. Soon printf() will be able to use the new routines to output long doubles without loss of precision, but numerous bugs in the existing code must be addressed first.
Reviewed by: bde (briefly), mike (mentor), obrien
show more ...
|
Revision tags: release/5.0.0_cvs, release/5.0.0 |
|
#
d3951ad1 |
| 02-Jan-2003 |
Juli Mallett <jmallett@FreeBSD.org> |
Implement POSIX grantpt(3) functionality, and add a pt_chown utility (akin to Solaris, it is in /usr/libexec) to perform the handing over of tty nodes to the user being granted the pty.
Submitted by
Implement POSIX grantpt(3) functionality, and add a pt_chown utility (akin to Solaris, it is in /usr/libexec) to perform the handing over of tty nodes to the user being granted the pty.
Submitted by: Ryan Younce <ryany@pobox.com> Reviewed by: security-officer@, standards@, mike@
show more ...
|
#
c2e55537 |
| 30-Dec-2002 |
David E. O'Brien <obrien@FreeBSD.org> |
Back out the s/int */size_t */ commit. It makes a difference on 64-bit arches, and no one really wants a 2^64 block size [yet].
|
#
d69d1519 |
| 23-Oct-2002 |
Mark Murray <markm@FreeBSD.org> |
Make the first argument of getbsize a size_t* instead of an int*, as this is what the quantity actually is. Fix an easy const while I'm here.
|