-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
On 2021-12-23, a new syscall for mmap was introduced:
49 STD NOLOCK { void *sys_mmap(void *addr, size_t len, int prot, \
int flags, int fd, off_t pos); }
At the same time, the existing mmap syscall was renamed from sys_mmap to sys_pad_mmap (since it contains a now-obsolete argument for padding).
See sys/kern/syscalls.master:
openbsd/src@1d60349#diff-e8c6a075c6e1240e27216779540b66f3db43b14a3b3615c2ecb7a111faa54504
On 2023-02-11, the original mmap syscall was retired entirely:
With the release of OpenBSD 7.3 on 2023-04-10, any go program that uses mmap on OpenBSD will crash with SIGSYS.
For example, here's a snippet from kdump of a failing run of gotosocial:
83839 gotosocial CALL (via syscall) #197 (obsolete pad_mmap)()
83839 gotosocial PSIG SIGSYS caught handler=0x4682c0 mask=0<>
83839 gotosocial RET #197 (obsolete pad_mmap) -1 errno 78 Function not implemented
This is a bug both in this project and in modernc.org/libc. Here, the constant unix.SYS_MMAP needs to be changed from 197 to 49. I'll also file a bug in that project for them to switch both the number and how they're invoking syscall.