summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/readdir.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Wrap <dirent.h> so that internal calls go direct and they're all weak symbolsguenther2015-09-121-1/+2
|
* Optimization, no functional change:schwarze2014-03-101-3/+2
| | | | | | | | | | | | | | Save a cookie pointing to the very first entry in the DIR.dd_buf cache buffer and use that to speed up seekdir(3) when rewinding to that first entry. No libc bump because DIR is an opaque struct. When the optimization applies, which in particular it always does for rewinddir(3) after reading less than about 500 entries, seekdir(3) execution time drops from 100 to 0.05 milliseconds on my i386 notebook. Other cases are not slowed down. Based on an idea from and ok by guenther@.
* Nowadays, seekdir(3) doesn't call _readdir_unlocked().schwarze2013-11-061-11/+4
| | | | | | Consequently, the "skipdeleted" argument is always == 1. Remove it, effectively reverting readdir.c rev. 1.14. ok millert@ guenther@
* Remove an unnecessary (void *) castguenther2013-10-061-3/+3
|
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-3/+4
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* Make DIR a private type within libc, give it the same underlyingmatthew2012-03-221-1/+2
| | | | | | typedef regardless of __BSD_VISIBLE, and eliminate the dirfd() macro. ok guenther@
* If the internal consistency check fails, set errno so that it doesn'tguenther2012-02-041-5/+8
| | | | | | just look like end-of-directory. ok krw@ otto@ miod@
* More shrinkage, a bit for ramdisks but mostly for static binaries:guenther2009-11-181-25/+1
| | | | | | | | | | | | | | | | | - wrap with #ifndef NO_LOG_BAD_DNS_RESPONSES libc code that uses p_class() and p_type() for diagnostics, then add that define to libstub to avoid pulling in res_debug_syms.o - split rcmd() and ruserok() into separate files, as nothing uses both - split readdir_r() to its own file - split syslog_r() from syslog(), as the latter needs localtime(); many binaries no longer need to pull in all the time code after this; switch from usleep() to nanosleep() while we're at it (The profit of analysis of -Wl,-M,--cref output) Chops 888kB from /bin and /sbin on i386 ok deraadt@, miod@
* Be carefull not to read away the target entry when encounteringotto2008-05-011-5/+11
| | | | | deleted files after a seekdir(); testcase produced by mbalmer@; fix with and ok mbalmer; ok millert@
* alter internal _readdir_unlocked() api to be less confusing, so thatokan2008-04-041-15/+18
| | | | | | | | | callers may respond accordingly and correctly. this fixes an issue where readdir_r() could not decipher the difference between an error or no more entires. feedback and ok kurt@, ok millert@
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | isolate its usage to libpthread only and replace with generic non-static mutex support in the one place it is needed: - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the functions weak so that libpthread can override with its own new versions that do the locking. - remove _thread_fd_lock/unlock() weak functions from libc and adjust libpthread for the change. - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc to support non-static mutexes in libc and add libpthread and librthread implementations for them. libc can utilize non-static mutexes via the new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can support both static and non-static mutexes but currently only using them for non-static. - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe for both thread libraries by using a non-static mutex in the struct _dirdesc (typedef DIR), utilizing it in the *dir functions and remove remaining and incorrect _FD_LOCK/UNLOCK() use in libc. - add comments to both thread libraries to indicate libc depends on the current implementation of static mutex initialization. suggested by marc@ - major bump libc and libpthread due to function removal, structure change and weak symbol conversions. okay marc@, tedu@
* g/c __DTF_READALL. It was a flag to the internal __opendir2() butmillert2007-02-081-4/+2
| | | | | is never set now that the unionfs support has been removed from readdir(). OK pedro@
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* bye bye whiteoutsmillert2005-06-161-3/+1
|
* deregister (and deauto!). ok millert@ marco@otto2005-03-251-2/+2
|
* ansify function definitions and zap some `register'jfb2004-05-181-7/+3
| | | | ok millert@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* don't copy past end of record in readdir_r (ok by art)rees2001-05-171-2/+2
|
* string.h for memcpy protoderaadt1999-09-011-1/+2
|
* Add thread-safety to libc, so that libc_r will build (on i386 at least).d1998-11-201-1/+33
| | | | | | | | | | | | | All POSIX libc api now there (to P1003.1c/D10) (more md stuff is needed for other libc/arch/*) (setlogin is no longer a special syscall) Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS). Doc some re-entrant routines Add libc_r to intro(3) dig() uses some libc srcs and an extra -I was needed there. Add more md stuff to libc_r. Update includes for the pthreads api Update libc_r TODO
* Fix RCS idstholo1996-08-191-7/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+81