haiku/headers/posix/dirent.h
Axel Dörfler ae372703ce Big commit: Added symlink support to the kernel.
- added needed syscalls to access symlink support from userland
- implemented lstat(), symlink(), and readlink()
- added dev_t to ktypes.h (for now - should be in a public header anyway)
- added symlink support to the "ls" command (now calls lstat() and shows the
  link target with the -l option)
- changed the sys_read_stat() call to support symlinks, and updated files
  using that function (it gets an extra argument: bool traverseLink)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-03 02:03:27 +00:00

52 lines
813 B
C

/**
* @file dirent.h
* @brief File Control functions and definitions
*/
#ifndef _DIRENT_H
#define _DIRENT_H
// ToDo: should really be <sys/types>
// This file should reside in headers/posix, not here...
// needs ino_t (int64), and dev_t (long)
#include <ktypes.h>
typedef struct dirent {
dev_t d_dev;
dev_t d_pdev;
ino_t d_ino;
ino_t d_pino;
unsigned short d_reclen;
char d_name[1];
} dirent_t;
typedef struct {
int fd;
struct dirent ent;
} DIR;
#ifndef MAXNAMLEN
# ifdef NAME_MAX
# define MAXNAMLEN NAME_MAX
# else
# define MAXNAMLEN 256
# endif
#endif
#ifdef _cplusplus
extern "C" {
#endif
DIR *opendir(const char *dirname);
struct dirent *readdir(DIR *dirp);
int closedir(DIR *dirp);
void rewinddir(DIR *dirp);
#ifdef _cplusplus
}
#endif
#endif /* _DIRENT_H */