Browse Source

bsd-user: Implement System V semaphore calls

Wire up semget(2) and semop(2) syscalls to get System V semaphore
implementation, as well the undocumented __semctl used to implement the
bits of the interface in libc.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
master
Stacey Son 2 months ago
committed by Warner Losh
parent
commit
4019112cf1
  1. 16
      bsd-user/freebsd/os-syscall.c

16
bsd-user/freebsd/os-syscall.c

@ -36,6 +36,7 @@
#include "bsd-file.h"
#include "bsd-mem.h"
#include "bsd-proc.h"
#include "bsd-misc.h"
/* BSD dependent syscall shims */
#include "os-stat.h"
@ -878,6 +879,21 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
ret = do_bsd_shmdt(arg1);
break;
/*
* System V Semaphores
*/
case TARGET_FREEBSD_NR_semget: /* semget(2) */
ret = do_bsd_semget(arg1, arg2, arg3);
break;
case TARGET_FREEBSD_NR_semop: /* semop(2) */
ret = do_bsd_semop(arg1, arg2, arg3);
break;
case TARGET_FREEBSD_NR___semctl: { /* __semctl() undocumented */
ret = do_bsd___semctl(arg1, arg2, arg3, arg4);
break;
}
case TARGET_FREEBSD_NR_freebsd11_vadvise:
ret = do_bsd_vadvise();
break;

Loading…
Cancel
Save