14 const char* argv[] = {
"/bin/shell", command,
NULL};
21 fd_t wait =
openf(
"/proc/%d/wait", shell);
#define MAX_PATH
Maximum length of filepaths.
uint64_t close(fd_t fd)
System call for closing files.
fd_t openf(const char *_RESTRICT format,...)
Wrapper for opening files with a formatted path.
uint64_t read(fd_t fd, void *buffer, uint64_t count)
System call for reading from files.
pid_t spawn(const char **argv, const spawn_fd_t *fds, const char *cwd, spawn_attr_t *attr)
System call for creating child processes.
#define SPAWN_FD_END
Spawn fds termination constant.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ fd_t
A file descriptor.
__UINT64_TYPE__ pid_t
Process Identifier.
Stucture used to duplicate fds in spawn().
fd_t child
The destination file descriptor in the child.
int system(const char *command)