From 1f2902ecfd872e0157c7c89e5fd6c0f8ebc357ac Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 23 Sep 2013 21:58:46 +0200 Subject: [PATCH] Make system call functions static. --- sortix/alarm.cpp | 1 + sortix/process.cpp | 15 ++++++++------- sortix/scheduler.cpp | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sortix/alarm.cpp b/sortix/alarm.cpp index ce09f3dd..b3a1275f 100644 --- a/sortix/alarm.cpp +++ b/sortix/alarm.cpp @@ -45,6 +45,7 @@ static void alarm_handler(Clock* /*clock*/, Timer* /*timer*/, void* user) process->DeliverSignal(SIGALRM); } +static int sys_alarmns(const struct timespec* user_delay, struct timespec* user_odelay) { Process* process = CurrentProcess(); diff --git a/sortix/process.cpp b/sortix/process.cpp index 7965fb37..c545da52 100644 --- a/sortix/process.cpp +++ b/sortix/process.cpp @@ -493,7 +493,7 @@ pid_t Process::Wait(pid_t thepid, int* status, int options) return thepid; } -pid_t sys_waitpid(pid_t pid, int* status, int options) +static pid_t sys_waitpid(pid_t pid, int* status, int options) { return CurrentProcess()->Wait(pid, status, options); } @@ -513,7 +513,7 @@ void Process::Exit(int status) t->DeliverSignal(SIGKILL); } -int sys_exit(int status) +static int sys_exit(int status) { CurrentProcess()->Exit(status); return 0; @@ -841,6 +841,7 @@ Ref Process::Open(ioctx_t* ctx, const char* path, int flags, mode_t return dir->open(ctx, path, flags, mode); } +static int sys_execve(const char* _filename, char* const _argv[], char* const _envp[]) { char* filename; @@ -930,7 +931,7 @@ cleanup_done: return result; } -pid_t sys_tfork(int flags, tforkregs_t* regs) +static pid_t sys_tfork(int flags, tforkregs_t* regs) { if ( Signal::IsPending() ) return errno = EINTR, -1; @@ -970,7 +971,7 @@ pid_t sys_tfork(int flags, tforkregs_t* regs) return clone->pid; } -pid_t sys_getpid() +static pid_t sys_getpid() { return CurrentProcess()->pid; } @@ -983,7 +984,7 @@ pid_t Process::GetParentProcessId() return parent->pid; } -pid_t sys_getppid() +static pid_t sys_getppid() { return CurrentProcess()->GetParentProcessId(); } @@ -1190,12 +1191,12 @@ static void* sys_sbrk(intptr_t increment) return (void*) (heap_segment->addr + heap_segment->size); } -size_t sys_getpagesize() +static size_t sys_getpagesize() { return Page::Size(); } -mode_t sys_umask(mode_t newmask) +static mode_t sys_umask(mode_t newmask) { Process* process = CurrentProcess(); ScopedLock lock(&process->idlock); diff --git a/sortix/scheduler.cpp b/sortix/scheduler.cpp index a60ca56f..713e1cc2 100644 --- a/sortix/scheduler.cpp +++ b/sortix/scheduler.cpp @@ -279,7 +279,7 @@ static void SleepUntil(struct timespec wakeat) } // TODO: This function has been obsoleted by the clock_nanosleep system call. -int sys_sleep(size_t secs) +static int sys_sleep(size_t secs) { struct timespec delay = timespec_make(secs, 0); struct timespec now = Time::Get(CLOCK_BOOT); @@ -288,7 +288,7 @@ int sys_sleep(size_t secs) } // TODO: This function has been obsoleted by the clock_nanosleep system call. -int sys_usleep(size_t usecs) +static int sys_usleep(size_t usecs) { size_t secs = usecs / 1000000; size_t nsecs = (usecs % 1000000) * 1000;