haiku/headers/private/kernel/unistd.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

70 lines
1.3 KiB
C
Executable File

/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
/**
* @file unistd.h
* @brief Miscellaneous macro's and functions
*/
#ifndef _UNISTD_H
#define _UNISTD_H
/**
* @defgroup Unistd unistd.h
* @brief Miscellaneous macro's and functions
* @ingroup OpenBeOS_POSIX
* @{
*/
#include <ktypes.h>
#ifdef __cplusplus
extern "C" {
#endif
int close(int);
int dup(int);
int dup2(int, int);
ssize_t read(int, void *, size_t);
ssize_t write(int, const void *, size_t);
int getopt(int, char * const *, const char *);
extern char *optarg; /* getopt(3) external variables */
extern int opterr;
extern int optind;
extern int optopt;
extern int optreset;
extern char **environ;
int readlink(const char *path, char *buffer, size_t bufferSize);
int symlink(const char *path, const char *toPath);
off_t lseek(int, off_t, int);
ssize_t read(int, void *, size_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t write(int, void const*, size_t);
ssize_t pwrite(int, void const*, size_t, off_t);
unsigned sleep(unsigned);
int usleep(unsigned);
int getdtablesize(void);
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/** @} */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif