Revision tags: release/2.1.5_cvs |
|
#
51295a4d |
| 12-Jul-1996 |
Jordan K. Hubbard <jkh@FreeBSD.org> |
General -Wall warning cleanup, part I. Submitted-By: Kent Vander Velden <graphix@iastate.edu>
|
Revision tags: release/2.1.0_cvs |
|
#
e78bad23 |
| 20-Jun-1995 |
Jeffrey Hsu <hsu@FreeBSD.org> |
Don't cast void functions to void. Obtained from: NetBSD commit by jtc on June 16, 1995.
|
Revision tags: release/2.0.5_cvs |
|
#
16be3810 |
| 07-Feb-1995 |
David Greenman <dg@FreeBSD.org> |
Backed out Keith Bostic's getcwd/$PWD hack. It is causing things to break all over the place.
|
#
03cfe806 |
| 04-Feb-1995 |
Poul-Henning Kamp <phk@FreeBSD.org> |
A cute hack to speed up things by Keith: if getenv("PWD") is the same inode as ".", then just return that. I added a check so it must start with a '/'.
Reviewed by: phk Submitted by: bostic@cs.ber
A cute hack to speed up things by Keith: if getenv("PWD") is the same inode as ".", then just return that. I added a check so it must start with a '/'.
Reviewed by: phk Submitted by: bostic@cs.berkeley.edu (Keith Bostic)
show more ...
|
#
b01f0b7d |
| 12-Dec-1994 |
Bruce Evans <bde@FreeBSD.org> |
Obtained from: 1.1.5
getcwd() has two off-by-one bugs in FreeBSD-2.0:
1. getcwd(buf, size) fails when the size is just large enough. 2. getcwd(buf + 1, 1) incorrectly succeeds when the current dire
Obtained from: 1.1.5
getcwd() has two off-by-one bugs in FreeBSD-2.0:
1. getcwd(buf, size) fails when the size is just large enough. 2. getcwd(buf + 1, 1) incorrectly succeeds when the current directory is "/". buf[0] and buf[2] are clobbered.
(I modified Bruce's original patch to return the proper error code [ERANGE] in the case of #2, but otherwise... -DG)
This program demonstrates the bug:
--- #include <stdlib.h> #include <string.h> #include <stdio.h> #include <unistd.h>
int main(void) { char buf[5]; int errors;
errors = 0; if (chdir("/tmp") != 0) { perror("chdir"); abort(); } if (getcwd(buf, 5) == NULL) { perror("oops, getcwd failed for buffer size = size required"); ++errors; } if (chdir("/") != 0) { perror("chdir"); abort(); } buf[0] = 0; buf[2] = 1; if (getcwd(buf + 1, 1) != NULL) { fprintf(stderr, "oops, getcwd succeeded for buffer size = one too small\n"); ++errors; } if (buf[0] != 0) { fprintf(stderr, "oops, getcwd scribbled on memory before start of buffer\n"); ++errors; } if (buf[2] != 1) { fprintf(stderr, "oops, getcwd scribbled on memory after end of buffer\n"); ++errors; } exit(errors == 0 ? 0 : 1); }
show more ...
|
Revision tags: release/2.0, release/1.1.5.1_cvs |
|
#
58f0484f |
| 27-May-1994 |
Rodney W. Grimes <rgrimes@FreeBSD.org> |
BSD 4.4 Lite Lib Sources
|
Revision tags: release/8.0.0_cvs, release/8.0.0 |
|
#
874108ae |
| 12-Nov-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
MFC @199204
|
#
680db495 |
| 13-Oct-2009 |
Jilles Tjoelker <jilles@FreeBSD.org> |
Make getcwd(3) faster, simpler and more compliant using *at syscalls.
It is no longer necessary to construct long paths consisting of repeated "../" which may be slow to process and may exceed PATH_
Make getcwd(3) faster, simpler and more compliant using *at syscalls.
It is no longer necessary to construct long paths consisting of repeated "../" which may be slow to process and may exceed PATH_MAX.
show more ...
|
Revision tags: release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0, release/6.2.0_cvs, release/6.2.0 |
|
#
c879ae35 |
| 09-Jan-2007 |
Warner Losh <imp@FreeBSD.org> |
Per Regents of the University of Calfornia letter, remove advertising clause.
# If I've done so improperly on a file, please let me know.
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0 |
|
#
323d07b4 |
| 18-Sep-2005 |
Andrey A. Chernov <ache@FreeBSD.org> |
Just by allocating size*2 bytes we can't be sure that new size will be enough, so change two if (size not enough) { reallocf(size*2); } into while (size not enough) { reallocf(size*2); }
|
#
b9fb13f5 |
| 15-Sep-2005 |
Andrey A. Chernov <ache@FreeBSD.org> |
Cosmetic fixes to prev. commit. Change first MAXPATHLEN to more standard PATH_MAX Change second MAXPATHLEN to 1024 (it is temp buffer not related) Change comment to reflect that.
Suggested by: bde
|
#
dedaf3ca |
| 14-Sep-2005 |
Andrey A. Chernov <ache@FreeBSD.org> |
Remove any hardcoded assumptions about malloc's way of allocating, just use MAXPATHLEN. It prevents potential buffer overflow with other malloc implementations. (this change based on submitted patch)
Remove any hardcoded assumptions about malloc's way of allocating, just use MAXPATHLEN. It prevents potential buffer overflow with other malloc implementations. (this change based on submitted patch)
PR: 86135 Submitted by: Trevor Blackwell <tlb@tlb.org>
show more ...
|
Revision tags: release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0, 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, release/5.2.0_cvs, release/5.2.0 |
|
#
4539e95a |
| 29-Oct-2003 |
Tim J. Robbins <tjr@FreeBSD.org> |
Remove incomplete support for running FreeBSD userland on old NetBSD kernels lacking the issetugid() and utrace() syscalls.
|
Revision tags: release/4.9.0_cvs, release/4.9.0, release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0, release/5.0.0_cvs, release/5.0.0 |
|
#
098b8611 |
| 10-Jan-2003 |
Tim J. Robbins <tjr@FreeBSD.org> |
Avoid a memory leak by using reallocf() instead of realloc().
|
#
73e8989d |
| 10-Jan-2003 |
Tim J. Robbins <tjr@FreeBSD.org> |
Prototype __getcwd() to avoid a warning.
|
Revision tags: release/4.7.0_cvs |
|
#
a10a751f |
| 19-Aug-2002 |
Juli Mallett <jmallett@FreeBSD.org> |
s/trailing NULL/trailing NUL/
|
Revision tags: release/4.6.2_cvs, release/4.6.2, release/4.6.1, release/4.6.0_cvs, release/4.5.0_cvs, release/4.4.0_cvs |
|
#
22626efa |
| 01-Feb-2002 |
David E. O'Brien <obrien@FreeBSD.org> |
* Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's.
|
Revision tags: release/4.3.0_cvs, release/4.3.0 |
|
#
d201fe46 |
| 24-Jan-2001 |
Daniel Eischen <deischen@FreeBSD.org> |
Remove _THREAD_SAFE and make libc thread-safe by default by adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will
Remove _THREAD_SAFE and make libc thread-safe by default by adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in.
Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo
Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo.
Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible.
Remove uneeded includes of <errno.h> from a few files.
Add $FreeBSD$ to a few files in order to pass commitprep.
Approved by: -arch
show more ...
|
Revision tags: release/4.2.0, release/4.1.1_cvs |
|
#
7aa1d9cd |
| 05-Sep-2000 |
Peter Wemm <peter@FreeBSD.org> |
Remove the SIGSYS handler and wrapper around the __getcwd() syscall. It was kinda silly since the sigaction() syscall that it used to setup the handler is more recent than __getcwd(), therefore it wa
Remove the SIGSYS handler and wrapper around the __getcwd() syscall. It was kinda silly since the sigaction() syscall that it used to setup the handler is more recent than __getcwd(), therefore it was useless as the wrapper would have died before even getting as far as __getcwd(2).
Reminded by: bde
show more ...
|
Revision tags: release/4.1.0, release/3.5.0_cvs, release/4.0.0_cvs, release/3.4.0_cvs |
|
#
4c9d9fc6 |
| 28-Sep-1999 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Explicitly use sigemptyset to clear a sigset_t. Explicit initialization of sa_flags allows us to lose the bzero.
$FreeBSD$ tag added.
|
Revision tags: release/3.3.0_cvs, release/3.2.0, release/3.1.0, release/3.0.0, release/2.2.8 |
|
#
e8420087 |
| 16-Sep-1998 |
Warner Losh <imp@FreeBSD.org> |
Replace memory leaking instances of realloc with non-leaking reallocf. In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is gua
Replace memory leaking instances of realloc with non-leaking reallocf. In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing.
I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
show more ...
|
Revision tags: release/2.2.7 |
|
#
efda3710 |
| 15-May-1998 |
John Birrell <jb@FreeBSD.org> |
NetBSD doesn't have a __getcwd syscall, so set have__getcwd to `no' when building libc with NetBSD syscalls.
|
Revision tags: release/2.2.6 |
|
#
4773010d |
| 15-Jan-1998 |
Stephen McKay <mckay@FreeBSD.org> |
Return the correct errno from getcwd() even if free() or closedir() overwrites it. This actually showed up when running under an old kernel when free() called the madvise() stub which set errno, cau
Return the correct errno from getcwd() even if free() or closedir() overwrites it. This actually showed up when running under an old kernel when free() called the madvise() stub which set errno, causing getcwd() to return EOPNOTSUPP instead of ERANGE.
show more ...
|
Revision tags: release/2.2.5_cvs |
|
#
b7ecb08a |
| 16-Sep-1997 |
Peter Wemm <peter@FreeBSD.org> |
Put a system call not present checking wrapper around the call to __getcwd(). I've got this libc code running on one of my machines at the moment without the __getcwd() syscall being present.
|
#
36dff600 |
| 15-Sep-1997 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Fix yet a minor stylistic nit from Bruce (Doesn't he have more important things to do ?? :-)
Prepare for the likely case of a change in kernel algorithm.
|