summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/telldir.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
|
* Cleanup, no functional change:schwarze2013-11-051-26/+2
| | | | | | | | 1. avoid code duplication in rewinddir() by calling seekdir() directly 2. move __seekdir() into seekdir() and _telldir_unlocked() into telldir() Both functions were called from nowhere else. 3. remove some unused #include directives and one unused function prototype ok otto@ millert@
* Make sure seekdir(3) works even when dirp->dd_buf still contains someschwarze2013-11-051-1/+2
| | | | | | | | | | | | | pending entries: At the time of the lseek(2), also invalidate the buffer in order to force getdents(2) during the next readdir(3). Because this throws away buffered data that could still be used in some cases, this is not particularly efficient, but at least it works; i will suggest optimizations soon. Bug found when investigating perl-5.18.1/t/op/threads-dirh.t that was reported broken by Andrew Fresh <andrew at afresh1 dot com>. ok guenther@ deraadt@
* seekdir()/rewinddir() must update the position returned by telldir()guenther2013-08-161-2/+2
|
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-48/+3
| | | | | | | | | | | | | | | | | | | | 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@
* Be carefull not to read away the target entry when encounteringotto2008-05-011-3/+3
| | | | | 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-3/+3
| | | | | | | | | 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@
* fix a libpthread PANIC in seekdir(3) caused by a recursive mutex lock.kurt2007-10-021-8/+17
| | | | | | remove the recursive lock in __seekdir() and ensure all callers properly lock dd_lock prior to calling. reported and tested by bernd@ okay marc@ tedu@
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* telldir/seekdir optimization, avoid scanning the complete list,otto2006-04-101-4/+10
| | | | | while still returning the correct index for seekdir(); telldir() Tested by Fred Crowson and others; "put it in" deraadt@
* - Plug huge mem leak; mostly samba was suffering.otto2006-04-011-54/+28
| | | | | | | | | | | - Fix semantics: seekdir(pos); telldir() shoud return pos. The code that implements this will be made faster in a later commit. - We loose documented behaviour (after closedir() the telldir() positions are not valid anymore). This was never in Posix, and most other systems have nothing like it. Diff originally from Paul Thorn, rewritten by me using some FreeBSD code. "slap it in" deraadt@
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* deregister (and deauto!). ok millert@ marco@otto2005-03-251-5/+5
|
* ansify function definitions and zap some `register'jfb2004-05-181-6/+3
| | | | ok millert@
* protosderaadt2003-06-251-1/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Fix RCS idstholo1996-08-191-7/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+134