13 #define MQ_PRIO_MAX _MQ_PRIO_MAX
15 #define STDIN_FILENO 0
16 #define STDOUT_FILENO 1
17 #define STDERR_FILENO 2
26 unsigned int sleep(
unsigned int seconds);
34 int usleep(useconds_t usec);
61 int dup2(
int oldfd,
int newfd);
70 int pipe(
int pipefd[2]);
101 int execve(
const char *pathname,
char *
const argv[],
char *
const envp[]);
110 int execvp(
const char *
file,
char *
const argv[]);
120 ssize_t
read(
int fd,
void *buf,
size_t count);
130 ssize_t
write(
int fd,
const void *buf,
size_t count);
141 off_t
lseek(
int fd,
long offset,
int whence);
165 char *
getcwd(
char *buf,
size_t size);
172 int chdir(
const char *path);
179 int unlink(
const char *pathname);
186 int rmdir(
const char *pathname);
189 #define _SC_ARG_MAX 0
190 #define _SC_CLK_TCK 2
191 #define _SC_OPEN_MAX 4
192 #define _SC_PAGESIZE 8
201 #define sysconf _sysconf
224 int access(
const char *pathname,
int mode);
291 int link(
const char *oldpath,
const char *newpath);
299 int symlink(
const char *target,
const char *linkpath);
310 int readlink(
const char *pathname,
char *buf,
size_t bufsiz);
328 int ttyname_r(
int fd,
char *buf,
size_t buflen);
336 int chroot(
const char *path);
346 int chown(
const char *pathname, uid_t owner, gid_t
group);
356 int lchown(
const char *pathname, uid_t owner, gid_t
group);
pid_t vfork(void)
Create a child process. Tenok runs every task from the image it booted and has no way to make another...
Definition: task.c:62
int seteuid(uid_t uid)
Become the effective user of the given identifier, the way setuid() does.
Definition: pwd.c:93
int chdir(const char *path)
Change working directory.
Definition: file.c:274
int dup2(int oldfd, int newfd)
Perform the same task as dup(), but use the file descriptor number specified by newfd.
Definition: file.c:97
int lchown(const char *pathname, uid_t owner, gid_t group)
Replace the owner of a file without following a symbolic link. Tenok has no symbolic link,...
Definition: pwd.c:120
int fchdir(int fd)
Change the working directory to the one the descriptor names. Tenok keeps no way back from a descript...
Definition: wrapper.c:433
int dup(int oldfd)
Create a copy of the file descriptor oldfd, using the lowest-numbered unused file descriptor for the ...
Definition: file.c:68
uid_t getuid(void)
Report the user a task runs as, which on Tenok is always root.
Definition: pwd.c:49
int setgid(gid_t gid)
Join the group of the given identifier. Tenok has the one group, so only that one can be joined.
Definition: pwd.c:83
char * getcwd(char *buf, size_t size)
Get current working directory.
Definition: file.c:246
int execve(const char *pathname, char *const argv[], char *const envp[])
Replace the running program with the one the pathname names. No file of Tenok is in a format the syst...
Definition: task.c:87
int pipe(int pipefd[2])
Create a pipe, a stream that is written to through one descriptor and read from through the other.
Definition: file.c:107
pid_t setsid(void)
Start a session. Tenok has the one console and no sessions to give it out to.
Definition: task.c:77
int isatty(int fd)
Tell whether a descriptor refers to a terminal.
Definition: file.c:444
int rmdir(const char *pathname)
Delete a directory, which must be empty.
Definition: file.c:341
gid_t getgid(void)
Report the group a task runs as, which on Tenok is always root.
Definition: pwd.c:59
unsigned int sleep(unsigned int seconds)
To cause the calling thread to sleep either until the number of real-time seconds specified in second...
Definition: sched.c:44
int chown(const char *pathname, uid_t owner, gid_t group)
Replace the owner of a file. Tenok has one user, so only a request that names it can be granted.
Definition: pwd.c:103
off_t lseek(int fd, long offset, int whence)
Reposition the file offset of the open file description associated with the file descriptor fd.
Definition: file.c:163
int symlink(const char *target, const char *linkpath)
Make a name that stands for another. Tenok has no symbolic link.
Definition: wrapper.c:415
int ttyname_r(int fd, char *buf, size_t buflen)
Name the terminal the descriptor is open on. Tenok keeps no way back from a descriptor to the name it...
Definition: wrapper.c:440
int execvp(const char *file, char *const argv[])
Replace the running program with the one found by searching PATH for the file, the way execve() does.
Definition: task.c:93
#define sysconf
Report a value of the system that is decided when it is built.
Definition: unistd.h:201
int setuid(uid_t uid)
Become the user of the given identifier. Tenok runs as the one user it has, so only that one can be b...
Definition: pwd.c:73
pid_t fork(void)
Create a child process, the way vfork() does not either.
Definition: task.c:68
int access(const char *pathname, int mode)
Check whether the calling task can reach a file the way it asks.
Definition: file.c:411
int getgroups(int size, gid_t list[])
Report the supplementary groups of the task. Tenok has one group and root is in it,...
Definition: pwd.c:126
int link(const char *oldpath, const char *newpath)
Give a file a second name. Tenok gives a file one name.
Definition: wrapper.c:408
int close(int fd)
Close a file descriptor, so that it no longer refers to any file and may be reused.
Definition: file.c:53
ssize_t write(int fd, const void *buf, size_t count)
Write up to count bytes from the buffer starting at buf to the file referred to by the file descripto...
Definition: file.c:132
int usleep(useconds_t usec)
Suspend execution of the calling thread for a given time in microseconds.
Definition: sched.c:64
pid_t getpid(void)
Return the ID of the calling task.
Definition: task.c:25
pid_t getppid(void)
Return the ID of the task that started the calling one. Every task of Tenok is started by the one tha...
Definition: task.c:39
int readlink(const char *pathname, char *buf, size_t bufsiz)
Read what a symbolic link stands for. Nothing a path of Tenok names is one.
Definition: wrapper.c:422
int setegid(gid_t gid)
Join the effective group of the given identifier, the way setgid() does.
Definition: pwd.c:98
ssize_t read(int fd, void *buf, size_t count)
Attempt to read up to count bytes from file descriptor fd into the buffer starting at buf.
Definition: file.c:117
int unlink(const char *pathname)
Delete a name from the file system.
Definition: file.c:351
int chroot(const char *path)
Make the given directory the root. The root of Tenok is the whole of what it mounted,...
Definition: wrapper.c:450