History log of /openbsd-current/lib/libc/gen/telldir.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.18 12-Sep-2015 guenther

Wrap <dirent.h> so that internal calls go direct and they're all weak symbols


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.17 05-Nov-2013 schwarze

Cleanup, no functional change:
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@


# 1.16 05-Nov-2013 schwarze

Make sure seekdir(3) works even when dirp->dd_buf still contains some
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@


# 1.15 16-Aug-2013 guenther

seekdir()/rewinddir() must update the position returned by telldir()


# 1.14 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
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@


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.13 01-May-2008 otto

Be carefull not to read away the target entry when encountering
deleted files after a seekdir(); testcase produced by mbalmer@; fix
with and ok mbalmer; ok millert@


# 1.12 04-Apr-2008 okan

alter internal _readdir_unlocked() api to be less confusing, so that
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@


Revision tags: OPENBSD_4_3_BASE
# 1.11 02-Oct-2007 kurt

branches: 1.11.2;
fix a libpthread PANIC in seekdir(3) caused by a recursive mutex lock.
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@


Revision tags: OPENBSD_4_2_BASE
# 1.10 05-Jun-2007 kurt

branches: 1.10.2;
_FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, so
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@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.9 10-Apr-2006 otto

telldir/seekdir optimization, avoid scanning the complete list,
while still returning the correct index for seekdir(); telldir()
Tested by Fred Crowson and others; "put it in" deraadt@


# 1.8 01-Apr-2006 otto

- Plug huge mem leak; mostly samba was suffering.
- 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@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.7 08-Aug-2005 espie

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


# 1.6 25-Mar-2005 otto

deregister (and deauto!). ok millert@ marco@


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.5 18-May-2004 jfb

ansify function definitions and zap some `register'

ok millert@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.4 25-Jun-2003 deraadt

protos


# 1.3 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 19-Aug-1996 tholo

Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision