shithub: scc

Download patch

ref: 8f191a4cad7365c97247c822c482e1afda3f5b33
parent: 5f464c4f5f082f5562a9ed1eb288366ef88147ea
author: Hiltjo Posthuma <[email protected]>
date: Fri May 20 06:33:54 EDT 2022

libc: add rename() syscall for amd64 linux and i386 linux

--- a/src/libc/arch/amd64/linux/.gitignore
+++ b/src/libc/arch/amd64/linux/.gitignore
@@ -11,6 +11,7 @@
 _lseek.s
 _open.s
 _read.s
+_rename.s
 _sigreturn.s
 _sys_brk.s
 _sys_errlist.c
--- a/src/libc/arch/amd64/linux/Makefile
+++ b/src/libc/arch/amd64/linux/Makefile
@@ -19,6 +19,7 @@
 	_lseek.$O\
 	_open.$O\
 	_read.$O\
+	_rename.$O\
 	_sigreturn.$O\
 	_sys_brk.$O\
 	_unlink.$O\
--- a/src/libc/arch/amd64/linux/syscall.lst
+++ b/src/libc/arch/amd64/linux/syscall.lst
@@ -15,6 +15,7 @@
 60	_exit	1
 61	_wait4	4
 62	_kill	2
+82	_rename	2
 87	_unlink	1
 96	_gettimeofday	2
 98	_getrusage	2
--- a/src/libc/arch/i386/linux/.gitignore
+++ b/src/libc/arch/i386/linux/.gitignore
@@ -7,6 +7,7 @@
 _lseek.s
 _open.s
 _read.s
+_rename.s
 _sigaction.s
 _sys_brk.s
 _wait4.s
--- a/src/libc/arch/i386/linux/Makefile
+++ b/src/libc/arch/i386/linux/Makefile
@@ -15,6 +15,7 @@
 	_lseek.$O\
 	_open.$O\
 	_read.$O\
+	_rename.$O\
 	_sigaction.$O\
 	_sys_brk.$O\
 	_write.$O\
--- a/src/libc/arch/i386/linux/syscall.lst
+++ b/src/libc/arch/i386/linux/syscall.lst
@@ -11,6 +11,7 @@
 20	_getpid	0
 33	_access	2
 37	_kill	2
+38	_rename	2
 45	_sys_brk	1
 67	__sigaction	4
 114	_wait4	4
--- a/src/libc/objs/amd64-linux.mk
+++ b/src/libc/objs/amd64-linux.mk
@@ -16,6 +16,7 @@
 	arch/amd64/linux/_lseek.$O\
 	arch/amd64/linux/_open.$O\
 	arch/amd64/linux/_read.$O\
+	arch/amd64/linux/_rename.$O\
 	arch/amd64/linux/_sigreturn.$O\
 	arch/amd64/linux/_sys_brk.$O\
 	arch/amd64/linux/_sys_errlist.$O\