diff --git a/fs/dir.c b/fs/dir.c index 4c5c1508..4798bd12 100644 --- a/fs/dir.c +++ b/fs/dir.c @@ -34,8 +34,6 @@ struct linux_dirent64_ { char name[]; } __attribute__((packed)); -#define MAX_RECLEN sizeof(struct linux_dirent64_) + NAME_MAX + - size_t fill_dirent_32(void *dirent_data, ino_t inode, off_t_ offset, const char *name, int type) { struct linux_dirent_ *dirent = dirent_data; dirent->inode = inode; diff --git a/kernel/calls.c b/kernel/calls.c index 7a645422..73fdf5ac 100644 --- a/kernel/calls.c +++ b/kernel/calls.c @@ -98,6 +98,9 @@ syscall_t syscall_table[] = { [147] = (syscall_t) sys_getsid, [148] = (syscall_t) sys_fsync, // fdatasync [150] = (syscall_t) sys_mlock, + [155] = (syscall_t) sys_sched_getparam, + [156] = (syscall_t) sys_sched_setscheduler, + [157] = (syscall_t) sys_sched_getscheduler, [158] = (syscall_t) sys_sched_yield, [162] = (syscall_t) sys_nanosleep, [163] = (syscall_t) sys_mremap, diff --git a/kernel/resource.c b/kernel/resource.c index d46a4681..12de6726 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -217,6 +217,7 @@ int_t sys_sched_setaffinity(pid_t_ UNUSED(pid), dword_t UNUSED(cpusetsize), addr // meh return 0; } + int_t sys_getpriority(int_t which, pid_t_ who) { STRACE("getpriority(%d, %d)", which, who); return 20; @@ -225,3 +226,25 @@ int_t sys_setpriority(int_t which, pid_t_ who, int_t prio) { STRACE("setpriority(%d, %d, %d)", which, who, prio); return 0; } + +// realtime scheduling stubs +int_t sys_sched_getparam(pid_t_ UNUSED(pid), addr_t param_addr) { + int_t sched_priority = 0; + if (user_put(param_addr, sched_priority)) + return _EFAULT; + return 0; +} +#define SCHED_OTHER_ 0 +int_t sys_sched_getscheduler(pid_t_ UNUSED(pid)) { + return SCHED_OTHER_; +} +int_t sys_sched_setscheduler(pid_t_ UNUSED(pid), int_t policy, addr_t param_addr) { + if (policy != SCHED_OTHER_) + return _EINVAL; + int_t sched_priority; + if (user_get(param_addr, sched_priority)) + return _EFAULT; + if (sched_priority != 0) + return _EINVAL; + return 0; +} diff --git a/kernel/resource.h b/kernel/resource.h index 856d7d19..f2818a6b 100644 --- a/kernel/resource.h +++ b/kernel/resource.h @@ -71,4 +71,8 @@ int_t sys_sched_setaffinity(pid_t_ pid, dword_t cpusetsize, addr_t cpuset_addr); int_t sys_getpriority(int_t which, pid_t_ who); int_t sys_setpriority(int_t which, pid_t_ who, int_t prio); +int_t sys_sched_getparam(pid_t_ pid, addr_t param_addr); +int_t sys_sched_getscheduler(pid_t_ UNUSED(pid)); +int_t sys_sched_setscheduler(pid_t_ UNUSED(pid), int_t policy, addr_t param_addr); + #endif