OpenBSD CVS

CVS log for src/include/dirent.h


[BACK] Up to [local] / src / include

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.35 / (download) - annotate - [select for diffs], Mon Apr 15 15:47:58 2024 UTC (4 weeks, 4 days ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.34: +4 -1 lines
Diff to previous 1.34 (colored)

Add scandirat(3); from freebsd

To be used in httpd(8) shortly to prevent toctu issues.

This makes __fdopendir internally accessible to avoid unnecessary
syscalls in scandirat(3). Suggested & diff by guenther

suggested by & OK millert
tweak & OK guenther
OK tb, jca

This rides the libc crank.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Sep 9 18:12:37 2016 UTC (7 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.33: +2 -10 lines
Diff to previous 1.33 (colored)

Move the 10 (!) defintions of NULL to their own mini header file and
update the NULL definition for C++11.  OK deraadt@ guenther@ kettenis@

Revision 1.33 / (download) - annotate - [select for diffs], Fri Dec 13 18:09:27 2013 UTC (10 years, 5 months ago) by zhuk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.32: +1 -3 lines
Diff to previous 1.32 (colored)

Zap some getdirentries() leftovers.

okay guenther@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Aug 16 08:33:20 2013 UTC (10 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.31: +4 -2 lines
Diff to previous 1.31 (colored)

Tweak the getdents() kernel prototype to use "void *"
Provide a declaration for userspace
Fix the kernel's sanity check on the buflen argument

lack of prototype pointed out by sthen@ and landry@
ok kettenis@ otto@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jun 2 16:14:59 2013 UTC (10 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.30: +4 -2 lines
Diff to previous 1.30 (colored)

XPG 4 apparently exposed d_ino and ino_t.  Also, always pull in
<sys/_types.h> for the internal types

ok matthew@

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 24 17:46:58 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.29: +1 -4 lines
Diff to previous 1.29 (colored)

I can see no reason for #ifndef _KERNEL check in a /usr/include
(ie. non-kernel) .h file

Revision 1.29 / (download) - annotate - [select for diffs], Thu Nov 29 02:15:44 2012 UTC (11 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Change scandir()'s 'select' argument from
	int (*)(struct dirent *)
to
	int (*)(const struct dirent *)
to match POSIX.

ok millert@, ports check by naddy@

Revision 1.28 / (download) - annotate - [select for diffs], Sat Mar 24 01:53:51 2012 UTC (12 years, 1 month ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.27: +5 -1 lines
Diff to previous 1.27 (colored)

Provide the old prototypes for scandir() and alphasort() for code that
requests the pre-standardized version

requested by millert@

Revision 1.27 / (download) - annotate - [select for diffs], Thu Mar 22 04:11:53 2012 UTC (12 years, 1 month ago) by matthew
Branch: MAIN
Changes since 1.26: +4 -25 lines
Diff to previous 1.26 (colored)

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 1.26 / (download) - annotate - [select for diffs], Thu Mar 22 01:44:19 2012 UTC (12 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.25: +7 -6 lines
Diff to previous 1.25 (colored)

Update alphasort() and scandir()'s argument types to match POSIX:
use "const struct dirent **" instead of "const void *".  Also, add
__restrict to readdir_r().

ok matthew@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Mar 22 01:13:40 2012 UTC (12 years, 1 month ago) by matthew
Branch: MAIN
Changes since 1.24: +4 -1 lines
Diff to previous 1.24 (colored)

Add dirfd() as a function to libc per POSIX requirement; dirfd() macro
to be pruned later when DIR is made an opaque type.

ok guenther@; prodding by brad@ for VLC and other ports

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 18 17:29:49 2011 UTC (12 years, 10 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.23: +4 -1 lines
Diff to previous 1.23 (colored)

Expose a bunch of new functionality from POSIX 2008: openat(2),
fchmodat(2), fstatat(2), mkdirat(2), mkfifoat(2), mknodat(2),
faccessat(2), fchownat(2), linkat(2), readlinkat(2), renameat(2),
symlinkat(2), unlinkat(2), utimensat(2), futimens(2), and
fdopendir(3).

"Minor" libc bump.

Tested in a bulk build by naddy@
Much help from guenther@, thib@, tedu@, oga@, and others.
ok deraadt@, naddy@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jul 14 02:16:00 2011 UTC (12 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +2 -6 lines
Diff to previous 1.22 (colored)

__opendir2, DTF_NODUP, and __DTF_READALL can die.  struct dirent
dd_flags is renamed to the placeholder position dd_unused so that
we can spot "broken software" which assumes we have Jan Simon Pendry's
union mounts (we don't have them, and won't have them ever again).
__opendir2 question spotted by matthew
verified to not break ports by sthen

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jul 3 18:51:01 2011 UTC (12 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 6 11:39:42 2011 UTC (13 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Dec 31 19:54:05 2010 UTC (13 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.19: +10 -6 lines
Diff to previous 1.19 (colored)

Standards compliance: expose dirfd with XPG7 and scandir and alphasort
with POSIX 2008

ok millert@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Oct 28 15:02:41 2010 UTC (13 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

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 1.18 / (download) - annotate - [select for diffs], Tue Jun 5 18:11:48 2007 UTC (16 years, 11 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

_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 1.17 / (download) - annotate - [select for diffs], Thu Feb 8 16:34:38 2007 UTC (17 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

g/c __DTF_READALL.  It was a flag to the internal __opendir2() but
is never set now that the unionfs support has been removed from
readdir().  OK pedro@

Revision 1.16 / (download) - annotate - [select for diffs], Sat Apr 1 18:06:59 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

- 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 1.15 / (download) - annotate - [select for diffs], Tue Dec 13 00:35:22 2005 UTC (18 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.14: +22 -15 lines
Diff to previous 1.14 (colored)

First step in include files overhaul.  Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE.  Also fix several namespace
pollution issues, including the byte order defines.  OK deraadt@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 18 18:09:42 2005 UTC (18 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

Remove remaining whiteout tentacles; OK deraadt@ miod@ weingart@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Aug 1 17:38:33 2003 UTC (20 years, 9 months ago) by avsm
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 26 19:34:17 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.11: +1 -2 lines
Diff to previous 1.11 (colored)

backout the __bounded__ attributes for a while; requested by deraadt@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jun 26 18:35:13 2003 UTC (20 years, 10 months ago) by avsm
Branch: MAIN
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored)

Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this!
deraadt@ ok

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jun 2 19:34:12 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.9: +2 -6 lines
Diff to previous 1.9 (colored)

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

Revision 1.9 / (download) - annotate - [select for diffs], Fri Oct 25 21:55:28 2002 UTC (21 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

NULL is now 0L so it is the same size as a pointer.
OK mickey@ and discussed with deraadt@

Revision 1.8 / (download) - annotate - [select for diffs], Sun Feb 17 19:42:21 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)

Revision 1.7 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:17 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.6: +11 -11 lines
Diff to previous 1.6 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Sep 17 13:13:46 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Be thorough about NULL as __null for C++.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jun 11 22:47:48 1999 UTC (24 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.4: +5 -1 lines
Diff to previous 1.4 (colored)

Define NULL to be __null for C++: better quality of implementation.
__null is a magic constant of integral type that converts to a null pointer
as should be, but warns for ambiguity when used to resolved an overload
between an integral type and a pointer type.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Nov 20 11:18:25 1998 UTC (25 years, 6 months ago) by d
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
  (more md stuff is needed for other libc/arch/*)
  (setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO

Revision 1.3 / (download) - annotate - [select for diffs], Sun Sep 21 10:45:30 1997 UTC (26 years, 8 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.2: +1 -0 lines
Diff to previous 1.2 (colored)

Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now.  Added openBSD tags.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Nov 23 17:12:11 1995 UTC (28 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +7 -0 lines
Diff to previous 1.1 (colored)

include sys/types.h as mandated by X/Open XPG 4.2; from agc@sde.uts.amdahl.com; netbsd pr#1785

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:41:12 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:41:12 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.