don't typedef run_t if _ANSI_SOURCE defined
[unix-history] / usr / src / include / dirent.h
... / ...
CommitLineData
1/*-
2 * Copyright (c) 1989 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * @(#)dirent.h 5.19 (Berkeley) %G%
8 */
9
10#ifndef _DIRENT_H_
11#define _DIRENT_H_
12
13/*
14 * The kernel defines the format of directory entries returned by
15 * the getdirentries(2) system call.
16 */
17#include <sys/dirent.h>
18
19#ifdef _POSIX_SOURCE
20typedef void * DIR;
21#else
22
23#define d_ino d_fileno /* backward compatibility */
24
25/* definitions for library routines operating on directories. */
26#define DIRBLKSIZ 1024
27
28/* structure describing an open directory. */
29typedef struct _dirdesc {
30 int dd_fd; /* file descriptor associated with directory */
31 long dd_loc; /* offset in current buffer */
32 long dd_size; /* amount of data returned by getdirentries */
33 char *dd_buf; /* data buffer */
34 int dd_len; /* size of data buffer */
35 long dd_seek; /* magic cookie returned by getdirentries */
36} DIR;
37
38#define dirfd(dirp) ((dirp)->dd_fd)
39
40#ifndef NULL
41#define NULL 0
42#endif
43
44#endif /* _POSIX_SOURCE */
45
46#ifndef KERNEL
47
48#include <sys/cdefs.h>
49
50__BEGIN_DECLS
51DIR *opendir __P((const char *));
52struct dirent *readdir __P((DIR *));
53void rewinddir __P((DIR *));
54int closedir __P((DIR *));
55#ifndef _POSIX_SOURCE
56long telldir __P((const DIR *));
57void seekdir __P((DIR *, long));
58int scandir __P((const char *, struct dirent ***,
59 int (*)(struct dirent *), int (*)(const void *, const void *)));
60int alphasort __P((const void *, const void *));
61int getdirentries __P((int, char *, int, long *));
62#endif /* not POSIX */
63__END_DECLS
64
65#endif /* !KERNEL */
66
67#endif /* !_DIRENT_H_ */