diff --git a/include/fcntl.h b/include/fcntl.h index d251f65..57fe5e0 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -29,6 +29,12 @@ extern int creat(char const *__path, mode_t __mode); /* Open file and return a file descriptor, -1 on error. */ extern int open(char const *__path, int __flags, ... /* mode_t __mode */); +#define F_DUPFD 0 +#define F_GETFD 1 +#define F_SETFD 2 + +extern int fcntl(int fd, int op, ...); + #ifdef __cplusplus } #endif diff --git a/include/sys/stat.h b/include/sys/stat.h index fc2ca0a..2cbe226 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -77,6 +77,8 @@ extern int stat(char const * __restrict__ __pathname, extern int chmod(char const *__pathname, mode_t mode); +extern int fstat(int __fd, struct stat *__buf); + #ifdef __cplusplus } #endif diff --git a/include/unistd.h b/include/unistd.h index 886fa4f..6926615 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -45,6 +45,10 @@ extern char *getcwd(char *__buf, size_t __size); extern int chdir(char const *__path); +extern int isatty(int __fd); + +extern int dup(int __fd); + /* Exit immediately, bypassing exit handlers or signal handlers. */ __attribute__((noreturn)) extern void _exit(int __status); @@ -52,8 +56,6 @@ extern void _exit(int __status); /* Kernel-style functions supported only by Vhex. */ -#ifdef __SUPPORT_VHEX_KERNEL - //--- // Process part ///--- @@ -86,8 +88,6 @@ extern int setpgid(pid_t __pid, pid_t __pgid); /* Get the value of the system variable NAME. */ extern long int sysconf(int __name); -#endif /*__SUPPORT_VHEX_KERNEL*/ - #ifdef __cplusplus } #endif