From 20b67f18bcbdcbe2df35a7a2601d7b82ce89d768 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 12 Jun 2013 13:12:29 +0200 Subject: [PATCH] Update libc system calls to follow coding conventions. --- libc/Makefile | 2 +- libc/close.cpp | 5 +++-- libc/dup.cpp | 5 +++-- libc/fcntl.cpp | 5 +++-- libc/fstat.cpp | 4 ++-- libc/ftruncate.cpp | 5 +++-- libc/kernelinfo.cpp | 4 ++-- libc/pipe.cpp | 5 +++-- libc/read.cpp | 1 + libc/readdirents.cpp | 4 ++-- libc/{winsize.cpp => tcgetwinsize.cpp} | 7 ++++--- libc/wctype.cpp | 1 + libc/write.cpp | 1 + utils/which.cpp | 0 14 files changed, 29 insertions(+), 20 deletions(-) rename libc/{winsize.cpp => tcgetwinsize.cpp} (88%) mode change 100755 => 100644 utils/which.cpp diff --git a/libc/Makefile b/libc/Makefile index d126ef57..aeadc4a6 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -355,6 +355,7 @@ sys/socket/socketpair.o \ system.o \ sys/time/gettimeofday.o \ tcgetpgrp.o \ +tcgetwinsize.o \ tcsetpgrp.o \ tfork.o \ time/clock_getres.o \ @@ -393,7 +394,6 @@ utime.o \ vscanf.o \ wait.o \ waitpid.o \ -winsize.o \ write.o \ writev.o \ diff --git a/libc/close.cpp b/libc/close.cpp index 2fdeae54..501f26a1 100644 --- a/libc/close.cpp +++ b/libc/close.cpp @@ -23,11 +23,12 @@ *******************************************************************************/ #include + #include -DEFN_SYSCALL1(int, SysClose, SYSCALL_CLOSE, int); +DEFN_SYSCALL1(int, sys_close, SYSCALL_CLOSE, int); extern "C" int close(int fd) { - return SysClose(fd); + return sys_close(fd); } diff --git a/libc/dup.cpp b/libc/dup.cpp index 82e4ed73..070380f4 100644 --- a/libc/dup.cpp +++ b/libc/dup.cpp @@ -23,11 +23,12 @@ *******************************************************************************/ #include + #include -DEFN_SYSCALL1(int, SysDup, SYSCALL_DUP, int); +DEFN_SYSCALL1(int, sys_dup, SYSCALL_DUP, int); extern "C" int dup(int fd) { - return SysDup(fd); + return sys_dup(fd); } diff --git a/libc/fcntl.cpp b/libc/fcntl.cpp index e9de38c8..64cafc83 100644 --- a/libc/fcntl.cpp +++ b/libc/fcntl.cpp @@ -23,10 +23,11 @@ *******************************************************************************/ #include + #include #include -DEFN_SYSCALL3(int, SysFCntl, SYSCALL_FCNTL, int, int, unsigned long); +DEFN_SYSCALL3(int, sys_fcntl, SYSCALL_FCNTL, int, int, unsigned long); extern "C" int fcntl(int fd, int cmd, ...) { @@ -34,5 +35,5 @@ extern "C" int fcntl(int fd, int cmd, ...) va_start(ap, cmd); unsigned long arg = va_arg(ap, unsigned long); va_end(ap); - return SysFCntl(fd, cmd, arg); + return sys_fcntl(fd, cmd, arg); } diff --git a/libc/fstat.cpp b/libc/fstat.cpp index 72cd423d..c1d2d77a 100644 --- a/libc/fstat.cpp +++ b/libc/fstat.cpp @@ -25,9 +25,9 @@ #include #include -DEFN_SYSCALL2(int, SysFStat, SYSCALL_FSTAT, int, struct stat*); +DEFN_SYSCALL2(int, sys_fstat, SYSCALL_FSTAT, int, struct stat*); extern "C" int fstat(int fd, struct stat* st) { - return SysFStat(fd, st); + return sys_fstat(fd, st); } diff --git a/libc/ftruncate.cpp b/libc/ftruncate.cpp index bbd2c1b6..1c1c75df 100644 --- a/libc/ftruncate.cpp +++ b/libc/ftruncate.cpp @@ -23,11 +23,12 @@ *******************************************************************************/ #include + #include -DEFN_SYSCALL2(int, SysFTruncate, SYSCALL_FTRUNCATE, int, off_t); +DEFN_SYSCALL2(int, sys_ftruncate, SYSCALL_FTRUNCATE, int, off_t); extern "C" int ftruncate(int fd, off_t length) { - return SysFTruncate(fd, length); + return sys_ftruncate(fd, length); } diff --git a/libc/kernelinfo.cpp b/libc/kernelinfo.cpp index be81e234..72387390 100644 --- a/libc/kernelinfo.cpp +++ b/libc/kernelinfo.cpp @@ -25,9 +25,9 @@ #include #include -DEFN_SYSCALL3(ssize_t, SysKernelInfo, SYSCALL_KERNELINFO, const char*, char*, size_t); +DEFN_SYSCALL3(ssize_t, sys_kernelinfo, SYSCALL_KERNELINFO, const char*, char*, size_t); extern "C" ssize_t kernelinfo(const char* req, char* resp, size_t resplen) { - return SysKernelInfo(req, resp, resplen); + return sys_kernelinfo(req, resp, resplen); } diff --git a/libc/pipe.cpp b/libc/pipe.cpp index 360ddd78..00f69c1d 100644 --- a/libc/pipe.cpp +++ b/libc/pipe.cpp @@ -23,11 +23,12 @@ *******************************************************************************/ #include + #include -DEFN_SYSCALL1(int, SysPipe, SYSCALL_PIPE, int*); +DEFN_SYSCALL1(int, sys_pipe, SYSCALL_PIPE, int*); extern "C" int pipe(int pipefd[2]) { - return SysPipe(pipefd); + return sys_pipe(pipefd); } diff --git a/libc/read.cpp b/libc/read.cpp index 38c9ba6e..41a47f38 100644 --- a/libc/read.cpp +++ b/libc/read.cpp @@ -23,6 +23,7 @@ *******************************************************************************/ #include + #include #include diff --git a/libc/readdirents.cpp b/libc/readdirents.cpp index a7b2da26..bf559de6 100644 --- a/libc/readdirents.cpp +++ b/libc/readdirents.cpp @@ -25,9 +25,9 @@ #include #include -DEFN_SYSCALL4(ssize_t, SysReadDirEnts, SYSCALL_READDIRENTS, int, struct kernel_dirent*, size_t, size_t); +DEFN_SYSCALL4(ssize_t, sys_readdirents, SYSCALL_READDIRENTS, int, struct kernel_dirent*, size_t, size_t); extern "C" ssize_t readdirents(int fd, struct kernel_dirent* dirent, size_t size) { - return SysReadDirEnts(fd, dirent, size, 1); + return sys_readdirents(fd, dirent, size, 1); } diff --git a/libc/winsize.cpp b/libc/tcgetwinsize.cpp similarity index 88% rename from libc/winsize.cpp rename to libc/tcgetwinsize.cpp index 03274af6..5e37354a 100644 --- a/libc/winsize.cpp +++ b/libc/tcgetwinsize.cpp @@ -17,17 +17,18 @@ You should have received a copy of the GNU Lesser General Public License along with the Sortix C Library. If not, see . - winsize.cpp + tcgetwinsize.cpp Access to terminal resolution. *******************************************************************************/ #include + #include -DEFN_SYSCALL2(int, SysTCGetWinSize, SYSCALL_TCGETWINSIZE, int, struct winsize*); +DEFN_SYSCALL2(int, sys_tcgetwinsize, SYSCALL_TCGETWINSIZE, int, struct winsize*); extern "C" int tcgetwinsize(int fd, struct winsize* ws) { - return SysTCGetWinSize(fd, ws); + return sys_tcgetwinsize(fd, ws); } diff --git a/libc/wctype.cpp b/libc/wctype.cpp index 10c17204..10f1fe64 100644 --- a/libc/wctype.cpp +++ b/libc/wctype.cpp @@ -15,6 +15,7 @@ License for more details. You should have received a copy of the GNU Lesser General Public License + along with the Sortix C Library. If not, see . wctype.cpp Character types. diff --git a/libc/write.cpp b/libc/write.cpp index dd126423..e9e59fd9 100644 --- a/libc/write.cpp +++ b/libc/write.cpp @@ -23,6 +23,7 @@ *******************************************************************************/ #include + #include #include diff --git a/utils/which.cpp b/utils/which.cpp old mode 100755 new mode 100644