diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-04-01 18:07:00 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-04-01 18:07:00 +0000 |
commit | d950d807013483ae1fd7fa7c540c321f6dad80c2 (patch) | |
tree | 331b1110f8ad3122a0449028357d2bd2d32959e6 /include/dirent.h | |
parent | f92e8b844490c2117a8a2549bb4e957337b7dd03 (diff) |
- 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@
Diffstat (limited to 'include/dirent.h')
-rw-r--r-- | include/dirent.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/dirent.h b/include/dirent.h index 05e5c83cd61..6360ab89147 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dirent.h,v 1.15 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: dirent.h,v 1.16 2006/04/01 18:06:59 otto Exp $ */ /* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */ /*- @@ -59,6 +59,7 @@ /* definitions for library routines operating on directories. */ #define DIRBLKSIZ 1024 +struct _telldir; /* structure describing an open directory. */ typedef struct _dirdesc { int dd_fd; /* file descriptor associated with directory */ @@ -69,6 +70,7 @@ typedef struct _dirdesc { long dd_seek; /* magic cookie returned by getdirentries */ long dd_rewind; /* magic cookie for rewinding */ int dd_flags; /* flags for readdir */ + struct _telldir *dd_td; /* telldir position recording */ } DIR; #define dirfd(dirp) ((dirp)->dd_fd) @@ -106,7 +108,7 @@ int getdirentries(int, char *, int, long *) __attribute__ ((__bounded__(__string__,2,3))); #endif /* __BSD_VISIBLE */ #if __XPG_VISIBLE -long telldir(const DIR *); +long telldir(DIR *); void seekdir(DIR *, long); #endif #if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE >= 500 |