blob: 03e8e99666cf1c4664e19419235bc15a65d677f4 [file] [log] [blame]
/*
* unistd.h
*/
#ifndef _UNISTD_H
#define _UNISTD_H
#include <klibc/extern.h>
#include <klibc/compiler.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/select.h>
#include <asm/page.h>
__extern char **environ;
__extern __noreturn _exit(int);
__extern pid_t fork(void);
__extern pid_t vfork(void);
__extern pid_t getpid(void);
__extern int setpgid(pid_t, pid_t);
__extern pid_t getppid(void);
__extern pid_t getpgrp(void);
__extern int setpgrp(void);
__extern pid_t setsid(void);
__extern pid_t getsid(pid_t);
__extern int execv(const char *, char * const *);
__extern int execvp(const char *, char * const *);
__extern int execve(const char *, char * const *, char * const *);
__extern int execvpe(const char *, char * const *, char * const *);
__extern int execl(const char *, const char *, ...);
__extern int execlp(const char *, const char *, ...);
__extern int execle(const char *, const char *, ...);
__extern int execlpe(const char *, const char *, ...);
__extern int setuid(uid_t);
__extern uid_t getuid(void);
__extern int seteuid(uid_t);
__extern uid_t geteuid(void);
__extern int setgid(gid_t);
__extern gid_t getgid(void);
__extern int setegid(gid_t);
__extern gid_t getegid(void);
__extern int getgroups(int, gid_t *);
__extern int setgroups(size_t, const gid_t *);
__extern int setreuid(uid_t, uid_t);
__extern int setregid(gid_t, gid_t);
__extern int setresuid(uid_t, uid_t, uid_t);
__extern int setresgid(gid_t, gid_t, gid_t);
__extern int getfsuid(uid_t);
__extern int setfsuid(uid_t);
__extern int access(const char *, int);
__extern int link(const char *, const char *);
__extern int unlink(const char *);
__extern int chdir(const char *);
__extern int chmod(const char *, mode_t);
__extern int fchmod(int, mode_t);
__extern int mkdir(const char *, mode_t);
__extern int rmdir(const char *);
__extern int pipe(int *);
__extern int chroot(const char *);
__extern int symlink(const char *, const char *);
__extern int readlink(const char *, char *, size_t);
__extern int chown(const char *, uid_t, gid_t);
__extern int fchown(int, uid_t, gid_t);
__extern int lchown(const char *, uid_t, gid_t);
__extern char *getcwd(char *, size_t);
__extern int sync(void);
__extern ssize_t read(int, void *, size_t);
__extern ssize_t write(int, const void *, size_t);
#ifndef __IN_SYS_COMMON
__extern int open(const char *, int, ...);
#endif
__extern int close(int);
__extern off_t lseek(int, off_t, int);
__extern loff_t llseek(int, loff_t, int);
__extern int dup(int);
__extern int dup2(int, int);
__extern int fcntl(int, int, long);
__extern int ioctl(int, int, void *);
__extern int flock(int, int);
__extern int fsync(int);
__extern int fdatasync(int);
__extern int ftruncate(int, off_t);
__extern int pause(void);
__extern unsigned int alarm(unsigned int);
__extern unsigned int sleep(unsigned int);
__extern void usleep(unsigned long);
__extern int gethostname(char *, size_t);
__extern int sethostname(const char *, size_t);
__extern int getdomainname(char *, size_t);
__extern int setdomainname(const char *, size_t);
__extern void *__brk(void *);
__extern int brk(void *);
__extern void *sbrk(ptrdiff_t);
__extern int getopt(int, char * const *, const char *);
__extern char *optarg;
__extern int optind, opterr, optopt;
__extern int isatty(int);
/* Standard file descriptor numbers. */
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
static inline int getpagesize(void)
{
return PAGE_SIZE;
}
#endif /* _UNISTD_H */