Skip to content

Commit

Permalink
bsd-user: Add stubs for vadvise(), sbrk() and sstk()
Browse files Browse the repository at this point in the history
The above system calls are not supported by qemu.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-24-kariem.taha2.7@gmail.com>
  • Loading branch information
bsdimp committed Oct 3, 2023
1 parent 4e00b7d commit dfa1d91
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bsd-user/bsd-mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,22 @@ static inline abi_long do_bsd_shmdt(abi_ulong shmaddr)
return ret;
}

static inline abi_long do_bsd_vadvise(void)
{
/* See sys_ovadvise() in vm_unix.c */
return -TARGET_EINVAL;
}

static inline abi_long do_bsd_sbrk(void)
{
/* see sys_sbrk() in vm_mmap.c */
return -TARGET_EOPNOTSUPP;
}

static inline abi_long do_bsd_sstk(void)
{
/* see sys_sstk() in vm_mmap.c */
return -TARGET_EOPNOTSUPP;
}

#endif /* BSD_USER_BSD_MEM_H */
12 changes: 12 additions & 0 deletions bsd-user/freebsd/os-syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
ret = do_bsd_shmdt(arg1);
break;

case TARGET_FREEBSD_NR_freebsd11_vadvise:
ret = do_bsd_vadvise();
break;

case TARGET_FREEBSD_NR_sbrk:
ret = do_bsd_sbrk();
break;

case TARGET_FREEBSD_NR_sstk:
ret = do_bsd_sstk();
break;

/*
* Misc
*/
Expand Down

0 comments on commit dfa1d91

Please sign in to comment.