mirror of
				https://gitlab.com/sortix/sortix.git
				synced 2023-02-13 20:55:38 -05:00 
			
		
		
		
	Update libc system calls to follow coding conventions.
This commit is contained in:
		
							parent
							
								
									7a6b4920ce
								
							
						
					
					
						commit
						20b67f18bc
					
				
					 14 changed files with 29 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -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 \
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,11 +23,12 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysClose(fd);
 | 
			
		||||
	return sys_close(fd);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,11 +23,12 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysDup(fd);
 | 
			
		||||
	return sys_dup(fd);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,10 +23,11 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.h>
 | 
			
		||||
 | 
			
		||||
#include <fcntl.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, ...)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,9 +25,9 @@
 | 
			
		|||
#include <sys/stat.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysFStat(fd, st);
 | 
			
		||||
	return sys_fstat(fd, st);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,11 +23,12 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysFTruncate(fd, length);
 | 
			
		||||
	return sys_ftruncate(fd, length);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,9 +25,9 @@
 | 
			
		|||
#include <sys/kernelinfo.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysKernelInfo(req, resp, resplen);
 | 
			
		||||
	return sys_kernelinfo(req, resp, resplen);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,11 +23,12 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.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])
 | 
			
		||||
{
 | 
			
		||||
	return SysPipe(pipefd);
 | 
			
		||||
	return sys_pipe(pipefd);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,6 +23,7 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.h>
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,9 +25,9 @@
 | 
			
		|||
#include <sys/readdirents.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysReadDirEnts(fd, dirent, size, 1);
 | 
			
		||||
	return sys_readdirents(fd, dirent, size, 1);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
    winsize.cpp
 | 
			
		||||
    tcgetwinsize.cpp
 | 
			
		||||
    Access to terminal resolution.
 | 
			
		||||
 | 
			
		||||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.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)
 | 
			
		||||
{
 | 
			
		||||
	return SysTCGetWinSize(fd, ws);
 | 
			
		||||
	return sys_tcgetwinsize(fd, ws);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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 <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
    wctype.cpp
 | 
			
		||||
    Character types.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,6 +23,7 @@
 | 
			
		|||
*******************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <sys/syscall.h>
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										0
									
								
								utils/which.cpp
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								utils/which.cpp
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue