Update libc system calls to follow coding conventions.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-06-12 13:12:29 +02:00
parent 7a6b4920ce
commit 20b67f18bc
14 changed files with 29 additions and 20 deletions

View File

@ -355,6 +355,7 @@ sys/socket/socketpair.o \
system.o \ system.o \
sys/time/gettimeofday.o \ sys/time/gettimeofday.o \
tcgetpgrp.o \ tcgetpgrp.o \
tcgetwinsize.o \
tcsetpgrp.o \ tcsetpgrp.o \
tfork.o \ tfork.o \
time/clock_getres.o \ time/clock_getres.o \
@ -393,7 +394,6 @@ utime.o \
vscanf.o \ vscanf.o \
wait.o \ wait.o \
waitpid.o \ waitpid.o \
winsize.o \
write.o \ write.o \
writev.o \ writev.o \

View File

@ -23,11 +23,12 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <unistd.h> #include <unistd.h>
DEFN_SYSCALL1(int, SysClose, SYSCALL_CLOSE, int); DEFN_SYSCALL1(int, sys_close, SYSCALL_CLOSE, int);
extern "C" int close(int fd) extern "C" int close(int fd)
{ {
return SysClose(fd); return sys_close(fd);
} }

View File

@ -23,11 +23,12 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <unistd.h> #include <unistd.h>
DEFN_SYSCALL1(int, SysDup, SYSCALL_DUP, int); DEFN_SYSCALL1(int, sys_dup, SYSCALL_DUP, int);
extern "C" int dup(int fd) extern "C" int dup(int fd)
{ {
return SysDup(fd); return sys_dup(fd);
} }

View File

@ -23,10 +23,11 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
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, ...) extern "C" int fcntl(int fd, int cmd, ...)
{ {
@ -34,5 +35,5 @@ extern "C" int fcntl(int fd, int cmd, ...)
va_start(ap, cmd); va_start(ap, cmd);
unsigned long arg = va_arg(ap, unsigned long); unsigned long arg = va_arg(ap, unsigned long);
va_end(ap); va_end(ap);
return SysFCntl(fd, cmd, arg); return sys_fcntl(fd, cmd, arg);
} }

View File

@ -25,9 +25,9 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syscall.h> #include <sys/syscall.h>
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) extern "C" int fstat(int fd, struct stat* st)
{ {
return SysFStat(fd, st); return sys_fstat(fd, st);
} }

View File

@ -23,11 +23,12 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <unistd.h> #include <unistd.h>
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) extern "C" int ftruncate(int fd, off_t length)
{ {
return SysFTruncate(fd, length); return sys_ftruncate(fd, length);
} }

View File

@ -25,9 +25,9 @@
#include <sys/kernelinfo.h> #include <sys/kernelinfo.h>
#include <sys/syscall.h> #include <sys/syscall.h>
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) extern "C" ssize_t kernelinfo(const char* req, char* resp, size_t resplen)
{ {
return SysKernelInfo(req, resp, resplen); return sys_kernelinfo(req, resp, resplen);
} }

View File

@ -23,11 +23,12 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <unistd.h> #include <unistd.h>
DEFN_SYSCALL1(int, SysPipe, SYSCALL_PIPE, int*); DEFN_SYSCALL1(int, sys_pipe, SYSCALL_PIPE, int*);
extern "C" int pipe(int pipefd[2]) extern "C" int pipe(int pipefd[2])
{ {
return SysPipe(pipefd); return sys_pipe(pipefd);
} }

View File

@ -23,6 +23,7 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>

View File

@ -25,9 +25,9 @@
#include <sys/readdirents.h> #include <sys/readdirents.h>
#include <sys/syscall.h> #include <sys/syscall.h>
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) 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);
} }

View File

@ -17,17 +17,18 @@
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>. along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
winsize.cpp tcgetwinsize.cpp
Access to terminal resolution. Access to terminal resolution.
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <termios.h> #include <termios.h>
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) extern "C" int tcgetwinsize(int fd, struct winsize* ws)
{ {
return SysTCGetWinSize(fd, ws); return sys_tcgetwinsize(fd, ws);
} }

View File

@ -15,6 +15,7 @@
License for more details. License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with the Sortix C Library. If not, see <http://www.gnu.org/licenses/>.
wctype.cpp wctype.cpp
Character types. Character types.

View File

@ -23,6 +23,7 @@
*******************************************************************************/ *******************************************************************************/
#include <sys/syscall.h> #include <sys/syscall.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>

0
utils/which.cpp Executable file → Normal file
View File