diff options
author | 2012-03-22 04:11:53 +0000 | |
---|---|---|
committer | 2012-03-22 04:11:53 +0000 | |
commit | e55576ca586feb852d7d9044bd637f0e55131029 (patch) | |
tree | 7d257fd2705586c2ba8713c384afea5af8f4954e /lib/libc | |
parent | Hide behind #if 0 the sched_*() functions that we don't have yet (diff) | |
download | wireguard-openbsd-e55576ca586feb852d7d9044bd637f0e55131029.tar.xz wireguard-openbsd-e55576ca586feb852d7d9044bd637f0e55131029.zip |
Make DIR a private type within libc, give it the same underlying
typedef regardless of __BSD_VISIBLE, and eliminate the dirfd() macro.
ok guenther@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/dirfd.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/readdir.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/readdir_r.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/scandir.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/telldir.h | 16 |
5 files changed, 23 insertions, 5 deletions
diff --git a/lib/libc/gen/dirfd.c b/lib/libc/gen/dirfd.c index 5e3123c0fdc..3188a7cf5a7 100644 --- a/lib/libc/gen/dirfd.c +++ b/lib/libc/gen/dirfd.c @@ -4,9 +4,10 @@ */ #include <dirent.h> +#include "telldir.h" int -(dirfd)(DIR *dirp) +dirfd(DIR *dirp) { return (dirp->dd_fd); } diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index bbf178b0c42..eb9216219cb 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readdir.c,v 1.16 2012/02/04 23:02:40 guenther Exp $ */ +/* $OpenBSD: readdir.c,v 1.17 2012/03/22 04:11:53 matthew Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -30,6 +30,7 @@ #include <dirent.h> #include <errno.h> +#include "telldir.h" #include "thread_private.h" /* diff --git a/lib/libc/gen/readdir_r.c b/lib/libc/gen/readdir_r.c index 04a7fdc953f..f32d08a7044 100644 --- a/lib/libc/gen/readdir_r.c +++ b/lib/libc/gen/readdir_r.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readdir_r.c,v 1.1 2009/11/18 07:43:22 guenther Exp $ */ +/* $OpenBSD: readdir_r.c,v 1.2 2012/03/22 04:11:53 matthew Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +32,7 @@ #include <dirent.h> #include <string.h> #include <errno.h> +#include "telldir.h" #include "thread_private.h" int diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index b2b08a64c82..cbd7148f28b 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scandir.c,v 1.13 2012/03/22 01:44:19 guenther Exp $ */ +/* $OpenBSD: scandir.c,v 1.14 2012/03/22 04:11:53 matthew Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -42,6 +42,7 @@ #include <limits.h> #include <stdlib.h> #include <string.h> +#include "telldir.h" /* * The DIRSIZ macro is the minimum record length which will hold the directory diff --git a/lib/libc/gen/telldir.h b/lib/libc/gen/telldir.h index 0101db5c216..7209278a648 100644 --- a/lib/libc/gen/telldir.h +++ b/lib/libc/gen/telldir.h @@ -1,4 +1,4 @@ -/* $OpenBSD: telldir.h,v 1.4 2010/10/28 15:02:41 millert Exp $ */ +/* $OpenBSD: telldir.h,v 1.5 2012/03/22 04:11:53 matthew Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -58,6 +58,20 @@ struct _telldir { long td_last; /* last tell/seekdir */ }; +/* structure describing an open directory. */ +struct _dirdesc { + int dd_fd; /* file descriptor associated with directory */ + long dd_loc; /* offset in current buffer */ + long dd_size; /* amount of data returned by getdirentries */ + char *dd_buf; /* data buffer */ + int dd_len; /* size of data buffer */ + off_t dd_seek; /* magic cookie returned by getdirentries */ + off_t dd_rewind; /* magic cookie for rewinding */ + int dd_unused; /* was flags for readdir */ + struct _telldir *dd_td; /* telldir position recording */ + void *dd_lock; /* mutex to protect struct */ +}; + long _telldir_unlocked(DIR *); void __seekdir(DIR *, long); |