2018-03-16 16:40:23 +03:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-12 05:15:40 +03:00
|
|
|
#include <_cheader.h>
|
2018-03-16 16:40:23 +03:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2018-10-12 05:15:40 +03:00
|
|
|
_Begin_C_Header
|
|
|
|
|
2018-03-16 16:40:23 +03:00
|
|
|
extern char **environ;
|
|
|
|
|
|
|
|
extern pid_t getpid(void);
|
2018-06-25 10:28:13 +03:00
|
|
|
extern pid_t getppid(void);
|
2018-03-16 16:40:23 +03:00
|
|
|
|
|
|
|
extern int close(int fd);
|
|
|
|
|
|
|
|
extern pid_t fork(void);
|
|
|
|
|
|
|
|
extern int execl(const char *path, const char *arg, ...);
|
|
|
|
extern int execlp(const char *file, const char *arg, ...);
|
|
|
|
extern int execle(const char *path, const char *arg, ...);
|
|
|
|
extern int execv(const char *path, char *const argv[]);
|
|
|
|
extern int execvp(const char *file, char *const argv[]);
|
|
|
|
extern int execvpe(const char *file, char *const argv[], char *const envp[]);
|
2018-06-29 04:42:56 +03:00
|
|
|
extern int execve(const char *name, char * const argv[], char * const envp[]);
|
2018-03-16 16:40:23 +03:00
|
|
|
extern void _exit(int status);
|
|
|
|
|
2018-05-10 16:33:32 +03:00
|
|
|
extern int setuid(uid_t uid);
|
|
|
|
|
2018-03-16 16:40:23 +03:00
|
|
|
extern uid_t getuid(void);
|
|
|
|
extern uid_t geteuid(void);
|
2018-05-02 06:20:06 +03:00
|
|
|
extern gid_t getgid(void);
|
|
|
|
extern gid_t getegid(void);
|
2018-03-16 16:40:23 +03:00
|
|
|
extern char * getcwd(char *buf, size_t size);
|
|
|
|
extern int pipe(int pipefd[2]);
|
|
|
|
extern int dup(int oldfd);
|
|
|
|
extern int dup2(int oldfd, int newfd);
|
|
|
|
|
|
|
|
extern pid_t tcgetpgrp(int fd);
|
|
|
|
extern int tcsetpgrp(int fd, pid_t pgrp);
|
|
|
|
|
|
|
|
extern ssize_t write(int fd, const void * buf, size_t count);
|
|
|
|
extern ssize_t read(int fd, void * buf, size_t count);
|
|
|
|
|
2018-05-21 15:45:18 +03:00
|
|
|
extern int symlink(const char *target, const char *linkpath);
|
2018-03-16 16:40:23 +03:00
|
|
|
extern ssize_t readlink(const char *pathname, char *buf, size_t bufsiz);
|
|
|
|
|
|
|
|
extern int chdir(const char *path);
|
2018-06-25 10:28:13 +03:00
|
|
|
//extern int fchdir(int fd);
|
2018-03-16 16:40:23 +03:00
|
|
|
extern int isatty(int fd);
|
|
|
|
|
2018-05-10 16:33:32 +03:00
|
|
|
extern unsigned int sleep(unsigned int seconds);
|
2018-03-16 16:40:23 +03:00
|
|
|
extern int usleep(useconds_t usec);
|
|
|
|
extern off_t lseek(int fd, off_t offset, int whence);
|
|
|
|
|
2018-04-17 14:03:19 +03:00
|
|
|
extern int access(const char * pathname, int mode);
|
|
|
|
|
2018-05-02 12:58:47 +03:00
|
|
|
extern int getopt(int argc, char * const argv[], const char * optstring);
|
|
|
|
|
|
|
|
extern char * optarg;
|
|
|
|
extern int optind, opterr, optopt;
|
2018-03-16 16:40:23 +03:00
|
|
|
|
2018-06-25 06:11:33 +03:00
|
|
|
extern int unlink(const char * pathname);
|
|
|
|
|
2018-06-25 10:28:13 +03:00
|
|
|
/* Unimplemented stubs */
|
|
|
|
struct utimbuf {
|
|
|
|
time_t actime;
|
|
|
|
time_t modtime;
|
|
|
|
};
|
|
|
|
extern char * ttyname(int fd);
|
|
|
|
extern int utime(const char *filename, const struct utimbuf *times);
|
|
|
|
extern int rmdir(const char *pathname); /* TODO rm probably just works */
|
2018-07-18 06:37:21 +03:00
|
|
|
extern int chown(const char * pathname, uid_t owner, gid_t group);
|
2018-10-09 14:35:53 +03:00
|
|
|
extern char * getlogin(void);
|
2018-06-25 10:28:13 +03:00
|
|
|
|
2018-03-16 16:40:23 +03:00
|
|
|
#define STDIN_FILENO 0
|
|
|
|
#define STDOUT_FILENO 1
|
|
|
|
#define STDERR_FILENO 2
|
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
2018-08-01 21:40:43 +03:00
|
|
|
|
|
|
|
extern int gethostname(char * name, size_t len);
|
|
|
|
extern int sethostname(const char * name, size_t len);
|
2018-10-12 05:15:40 +03:00
|
|
|
|
2018-10-26 14:34:15 +03:00
|
|
|
extern pid_t setsid(void);
|
|
|
|
extern int setpgid(pid_t, pid_t);
|
|
|
|
|
2018-10-12 05:15:40 +03:00
|
|
|
_End_C_Header
|