mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +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.
48 lines
975 B
C
48 lines
975 B
C
#ifndef BOREDOS_LIBC_SYS_STAT_H
|
|
#define BOREDOS_LIBC_SYS_STAT_H
|
|
|
|
#include "types.h"
|
|
|
|
typedef long time_t;
|
|
|
|
struct stat {
|
|
unsigned long st_dev;
|
|
unsigned long st_ino;
|
|
mode_t st_mode;
|
|
unsigned long st_nlink;
|
|
uid_t st_uid;
|
|
gid_t st_gid;
|
|
unsigned long st_rdev;
|
|
int st_size;
|
|
long st_blksize;
|
|
long st_blocks;
|
|
time_t st_atime;
|
|
time_t st_mtime;
|
|
time_t st_ctime;
|
|
};
|
|
|
|
#define S_IFMT 0170000
|
|
#define S_IFIFO 0010000
|
|
#define S_IFCHR 0020000
|
|
#define S_IFDIR 0040000
|
|
#define S_IFREG 0100000
|
|
|
|
#define S_IRUSR 0400
|
|
#define S_IWUSR 0200
|
|
#define S_IXUSR 0100
|
|
#define S_IRGRP 0040
|
|
#define S_IWGRP 0020
|
|
#define S_IXGRP 0010
|
|
#define S_IROTH 0004
|
|
#define S_IWOTH 0002
|
|
#define S_IXOTH 0001
|
|
|
|
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
|
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
|
|
|
int stat(const char *pathname, struct stat *statbuf);
|
|
int fstat(int fd, struct stat *statbuf);
|
|
int mkdir(const char *pathname, int mode);
|
|
|
|
#endif
|