History log of /openbsd-current/lib/libc/gen/telldir.h
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.10 27-Aug-2015 guenther

Use static and __{BEGIN,ENV}_HIDDEN_DECLS to hide a bunch of internal
symbols that are not longer exported. (This improves the generated code.)

ok deraadt@


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.9 10-Mar-2014 schwarze

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


Revision tags: OPENBSD_5_5_BASE
# 1.8 12-Nov-2013 deraadt

put the _readdir_unlocked() prototype in an obvious place


# 1.7 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.6 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_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.5 22-Mar-2012 matthew

Make DIR a private type within libc, give it the same underlying
typedef regardless of __BSD_VISIBLE, and eliminate the dirfd() macro.

ok guenther@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.4 28-Oct-2010 millert

Change basep parameter of getdirentries() to be off_t *, not long *
so it works correctly with large offsets (and matches other systems).
This requires adding a new getdirentries syscall, with the old one
renamed to ogetdirentries. All in-tree consumers of getdirentries()
have been updated. Bump libc and libpthread major numbers.
OK and with deraadt@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.3 12-Oct-2007 chl

fix typo in _telldir_unlocked function prototype, to avoid warning.
while there, put all function prototypes in header file.

ok kurt@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.2 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.1 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@