summaryrefslogtreecommitdiff
path: root/src/user/lib/include/unistd.h
diff options
context:
space:
mode:
authordzwdz2023-08-14 18:51:07 +0200
committerdzwdz2023-08-14 18:51:07 +0200
commit642b5fb0007b64c77d186fcb018d571152ee1d47 (patch)
tree1c466461f3602d306be309a053edae558ef2568e /src/user/lib/include/unistd.h
parent8050069c57b729c18c19b1a03ab6e4bf63b4735e (diff)
reorganization: first steps
Diffstat (limited to 'src/user/lib/include/unistd.h')
-rw-r--r--src/user/lib/include/unistd.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/user/lib/include/unistd.h b/src/user/lib/include/unistd.h
deleted file mode 100644
index 005e79c..0000000
--- a/src/user/lib/include/unistd.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-#include <camellia/types.h> // TODO only needed because of hid_t
-#include <sys/types.h>
-#include <getopt.h>
-
-// TODO custom stdint.h, ssize_t doesn't belong here
-typedef long long ssize_t;
-
-extern char **environ;
-
-int fork(void);
-pid_t vfork(void);
-int close(hid_t h);
-_Noreturn void _exit(int);
-
-ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize);
-int link(const char *path1, const char *path2);
-int unlink(const char *path);
-int symlink(const char *path1, const char *path2);
-int isatty(int fd);
-
-int execv(const char *path, char *const argv[]);
-int execve(const char *path, char *const argv[], char *const envp[]);
-
-int chdir(const char *path);
-char *getcwd(char *buf, size_t size);
-
-uid_t getuid(void);
-uid_t geteuid(void);
-gid_t getgid(void);
-gid_t getegid(void);
-
-int chown(const char *path, uid_t owner, gid_t group);
-
-int setpgid(pid_t pid, pid_t pgid);
-pid_t tcgetpgrp(int fd);
-int tcsetpgrp(int fd, pid_t pgrp);
-pid_t getpgrp(void);
-pid_t getpid(void);
-pid_t getppid(void);
-
-int getgroups(int size, gid_t list[]);
-
-ssize_t read(int fd, void *buf, size_t count);
-ssize_t write(int fd, const void *buf, size_t count);
-int pipe(int pipefd[2]);
-int dup2(int oldfd, int newfd);
-
-/* Converts a relative path to an absolute one, simplifying it if possible.
- * If in == NULL - return the length of cwd. Doesn't include the trailing slash,
- * except for the root dir. Includes the null byte.
- * If size isn't enough to fit the path, returns the amount of bytes needed to fit
- * it, including the null byte.
- *
- * Note that some errors are only detected if *out != NULL, so you must check the return
- * value twice.
- * @return 0 on failure, length of the path otherwise */
-size_t absolutepath(char *out, const char *in, size_t size);
-
-// TODO put in an internal libc header
-void __setinitialcwd(const char *c);
-
-void intr_set(void (*fn)(void));
-void intr_default(void);