mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 10:26:59 +00:00
Introduce process lifecycle and POSIX-like features: add parent_pid, pgid, exited/exit_status, signal state and handlers, waitpid/reap, and an exec-replace function. Refactor file descriptor handling to use fd_kind/fd_flags with reference-counted file refs and in-process pipes; implement open/read/write/close/seek/tell/size/dup/dup2/pipe/fcntl semantics and O_* flags. Add syscall handlers for exec, waitpid, kill/signal, sigaction, sigprocmask, sigpending, meminfo/ticks and map many SYSTEM_CMD_* constants; deliver signals from the syscall path. Cleanup/terminate logic updated to free resources correctly and initialize kernel/user processes with new state. Misc: minor syscall/table renames (wallpaper), helper utilities (process_close_fd_inner, process_init_signal_state) and paging/stack handling for exec.
28 lines
528 B
C
28 lines
528 B
C
#ifndef BOREDOS_LIBC_FCNTL_H
|
|
#define BOREDOS_LIBC_FCNTL_H
|
|
|
|
#include "sys/types.h"
|
|
|
|
#define O_RDONLY 0x0000
|
|
#define O_WRONLY 0x0001
|
|
#define O_RDWR 0x0002
|
|
#define O_ACCMODE 0x0003
|
|
#define O_CREAT 0x0040
|
|
#define O_EXCL 0x0080
|
|
#define O_TRUNC 0x0200
|
|
#define O_APPEND 0x0400
|
|
#define O_NONBLOCK 0x0800
|
|
|
|
#define F_GETFL 3
|
|
#define F_SETFL 4
|
|
|
|
#define FD_CLOEXEC 1
|
|
|
|
int open(const char *pathname, int flags, ...);
|
|
int fcntl(int fd, int cmd, ...);
|
|
int dup(int oldfd);
|
|
int dup2(int oldfd, int newfd);
|
|
int pipe(int pipefd[2]);
|
|
|
|
#endif
|