summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fts-compat.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove an unused variable: `sb' in fts_read().Tim J. Robbins2003-01-031-1/+0
| | | | Notes: svn path=/head/; revision=108621
* Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the structGarrett Wollman2002-09-211-13/+67
| | | | | | | | | | | | | | | | | | | hack, thereby allowing future extensions to the structure (e.g., for extended attributes) without rebreaking the ABI. FTSENT now contains a pointer to the parent stream, which fts_compar() can then take advantage of, avoiding the undefined behavior previously warned about. As a consequence of this change, the prototype of the comparison function passed to fts_open() has changed to reflect the required amount of constness for its use. All callers in the tree are updated to use the correct prototype. Comparison functions can now make use of the new parent pointer to access the new stream-specific private data pointer, which is intended to assist creation of reentrant library routines which use fts(3) internally. Not objected to in spirit by: -arch Notes: svn path=/head/; revision=103726
* * Remove __P and convert to ANSI prototypes.David E. O'Brien2002-02-011-43/+41
| | | | | | | | * Remove 'register'. (some functions had 7+ register functions...) * Fix SCM ID's. Notes: svn path=/head/; revision=90045
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-131-2/+0
| | | | Notes: svn path=/head/; revision=81586
* Fix another unprotected instance of chdir() by extending theKris Kennaway2001-06-011-24/+12
| | | | | | | | | | fts_safe_changedir() function and using that instead for both of the chdir()s. Partially submitted by: Todd Miller <millert@OpenBSD.org>, bde Notes: svn path=/head/; revision=77599
* When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we getKris Kennaway2001-05-301-2/+16
| | | | | | | | | | there and compare the inode and device numbers to the values we remember, to guard against the directory having been moved around in the meantime. Reported by: Nick Cleaton <nick@cleaton.net> Notes: svn path=/head/; revision=77497
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=71579
* Fix style bugs (including ones introduced from OpenBSD).Brian Feldman2000-08-161-29/+16
| | | | Notes: svn path=/head/; revision=64740
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),Jason Evans2000-01-271-12/+11
| | | | | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen Notes: svn path=/head/; revision=56698
* Add three-tier symbol naming in support of POSIX thread cancellationJason Evans2000-01-121-11/+14
| | | | | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read(). Notes: svn path=/head/; revision=55837
* Switch over to the OpenBSD fts.c, fixing lots of things.Brian Feldman1999-12-181-71/+125
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=54770
* Fix the root cause of the fts buffer overflow. This is a temporaryWarner Losh1999-09-021-5/+23
| | | | | | | | | | | | patch to stop the core dumps while others come up with a better reviewed patch which may also fix other problems. We do illegal pointer arithmetic, but it should be OK since FreeBSD only supports machines with flat address spaces. Submitted by: bde Notes: svn path=/head/; revision=50790
* Reverted to revision 1.8 as previous fix causes fts_open with with aPeter Holm1999-08-151-1/+1
| | | | | | | | | path name argument with a trailing '/' to fail. Reviewed by: phk Notes: svn path=/head/; revision=49851
* Reviewed by: phkPeter Holm1999-08-141-1/+1
| | | | | | | | | | When fts_open is used with option FTS_NOCHDIR the full path entry of type FTS_DP is returned with a trailing '/' if the final directory is empty. This fix coresponds to netbsd's __fts13.c v. 1.16 Notes: svn path=/head/; revision=49772
* Replace memory leaking instances of realloc with non-leaking reallocf.Warner Losh1998-09-161-2/+2
| | | | | | | | | | | | | | 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... Notes: svn path=/head/; revision=39327
* fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro thatPoul-Henning Kamp1998-07-031-3/+4
| | | | | | | | | | | references sp. The free needs to follow ISSET PR: 7148 Reviewed by: phk Submitted by: Ken Mayer <kmayer@freegate.com> Notes: svn path=/head/; revision=37349
* Apply fts() fix from PR#4593Peter Wemm1997-09-221-1/+1
| | | | | | | Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> Notes: svn path=/head/; revision=29718
* Merge in the safe chdir changes from Todd Miller's mods to the OpenBSDWarner Losh1997-08-291-20/+64
| | | | | | | | | | | | | | tree. Also merge in fix to NetBSD PR #1495. These represent 1.3-1.9 in the OpenBSD tree. Make minor KNF changes to new code (which is in the OpenBSD as 1.10). This avoids the symlink race problems. These patches should go into 2.2.5 before the ship if they don't break anything in -current. Reviewed by: Bruce Evans Obtained from: OpenBSD Notes: svn path=/head/; revision=28913
* Merge from Lite2:Peter Wemm1997-03-111-3/+27
| | | | | | | | filesystem include updates, duplicate group suppression, cleanups, filesystem whiteout support (unionfs), bidir popen(). Notes: svn path=/head/; revision=23668
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-7/+7
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-6/+6
| | | | Notes: svn path=/head/; revision=8870
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+971
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573