Commit Graph

29 Commits

Author SHA1 Message Date
christos 54595e9946 rename dd_rewind to dd_internal so that it can be re-used to implement
telldir/seekdir/rewinddir differently. While there change the prototype
to telldir to take a non-const DIR, per:
http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
2006-05-17 20:32:19 +00:00
christos fb11ba2dc5 PR/33124: Murray Armfield: readdir_r is missing a restrict qualifier.
http://www.opengroup.org/onlinepubs/000095399/basedefs/dirent.h.html
2006-03-26 18:22:40 +00:00
christos 6d2fba90fb remove functions that we should not be exposing. 2006-01-24 19:33:35 +00:00
christos 964e09988d expose unlocked versions of readdir and telldir. 2006-01-24 13:58:58 +00:00
christos 9d2cc4eaf5 Fix opendir30 screwup and sort the compat defs for clarity. 2005-09-14 20:20:15 +00:00
christos 66412e7240 compat code reorg 2005-09-13 01:44:32 +00:00
christos 3303764533 64 bit inode changes 2005-08-19 02:04:54 +00:00
perry 19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
agc 039cc95684 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22270, verified by myself.
2003-08-07 09:44:09 +00:00
christos 0cc4f4a69e add mutex locking and dirent_r. 2003-05-28 20:04:12 +00:00
bjh21 8758baf5b6 Fix things so that _NETBSD_SOURCE correctly exposes the dirfd() and
the insides of struct _dirdesc.  Also make the existence of struct
_dirdesc visible to POSIX applications since this is less ugly than
pretending that DIR is a void *.
2003-04-29 23:08:13 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
mrg dd28a6c6dd make scandir(3)'s 3rd argument take a function that takes a *const*
struct dirent *, rather than non-const.  this makes scandir(3) the
same as the scandir implementations in libiberty and glibc, and the
select function has no need to modify the dirent.
2000-04-16 14:43:56 +00:00
kleink 6f29805ef3 Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.
2000-01-10 16:58:36 +00:00
kleink c07f17e8d9 For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above.  As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.
1999-12-22 21:26:15 +00:00
kleink 4881197c08 Reorganize name space protection. 1998-05-06 19:05:51 +00:00
fvdl 3ff9b61488 oops. Checked in wrong dirent.h version. Add missing getdents prototype
to this one.
1997-10-10 13:18:37 +00:00
fvdl 0df652060b Correct comment: getdirentries() -> getdents() 1997-10-10 02:21:02 +00:00
christos 1ed010cf0a Added missing __seekdir prototype 1997-07-13 18:01:06 +00:00
jtc 955f6c4af4 Changed to unconditionally include <sys/types.h> as required by X/Open XPG4.2. 1995-12-05 03:09:19 +00:00
jtc 362f2aad7d KERNEL -> _KERNEL 1995-03-26 20:13:37 +00:00
mycroft 1fc62d2108 Sync with CSRG. 1994-12-28 02:43:00 +00:00
cgd 4d2cbfce0a new RCS ID format. 1994-10-26 00:55:40 +00:00
mycroft 587fd4ce2b Update to 4.4-Lite version. 1994-08-29 18:11:08 +00:00
jtc dd9637d671 Struct dirent definition moved to <sys/dirent.h>. 1993-12-15 00:50:19 +00:00
jtc 7b954b21d9 Expand "u_long" & "u_short" to "unsigned long" and "unsigned short".
Some programs (like NSCA httpd) include <dirent.h> without first including
<sys/types.h> so the u_foo types aren't declared.  I don't think POSIX.1
allows us to include <sys/types.h> in <dirent.h> either.
1993-12-10 19:16:09 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
proven 4c3f702788 Removed bugs and memory leaks from the directory functions. 1993-06-04 17:00:03 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00