shithub: scc

Download patch

ref: adad9f272e4784ea0bf10da9b291d60ee7e25e45
parent: dbb8b774527a030a3b83b8a422234755fc928ed3
author: Hiltjo Posthuma <hiltjo@codemadness.org>
date: Thu Mar 31 16:09:12 EDT 2022

libc: OpenBSD: link in _gettimeofday syscall

Small test program:

int
main(void)
{
	time_t t = time(NULL);
	printf("%lld\n", t);

	return 0;
}

--- a/src/libc/arch/amd64/openbsd/.gitignore
+++ b/src/libc/arch/amd64/openbsd/.gitignore
@@ -2,6 +2,7 @@
 _close.s
 _exit.s
 _getpid.s
+_gettimeofday.s
 _kill.s
 _lseek.s
 _open.s
--- a/src/libc/arch/amd64/openbsd/Makefile
+++ b/src/libc/arch/amd64/openbsd/Makefile
@@ -9,6 +9,7 @@
 	_close.$O\
 	_exit.$O\
 	_getpid.$O\
+	_gettimeofday.$O\
 	_kill.$O\
 	_lseek.$O\
 	_open.$O\
--- a/src/libc/arch/amd64/openbsd/syscall.lst
+++ b/src/libc/arch/amd64/openbsd/syscall.lst
@@ -8,5 +8,6 @@
 17	_brk	1
 20	_getpid	0
 46	_sigaction	3
+67	_gettimeofday	2
 122	_kill	2
 198	_lseek	3
--- a/src/libc/objs/amd64-openbsd.mk
+++ b/src/libc/objs/amd64-openbsd.mk
@@ -6,6 +6,7 @@
 	arch/amd64/openbsd/_close.$O\
 	arch/amd64/openbsd/_exit.$O\
 	arch/amd64/openbsd/_getpid.$O\
+	arch/amd64/openbsd/_gettimeofday.$O\
 	arch/amd64/openbsd/_kill.$O\
 	arch/amd64/openbsd/_lseek.$O\
 	arch/amd64/openbsd/_open.$O\