bsd-user: Implement link, linkat, unlink and unlinkat

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Warner Losh 2022-06-12 08:18:48 -06:00
parent ab5fd2d969
commit 2d3b7e01d6
2 changed files with 70 additions and 0 deletions

View file

@ -317,6 +317,22 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
ret = do_bsd_renameat(arg1, arg2, arg3, arg4);
break;
case TARGET_FREEBSD_NR_link: /* link(2) */
ret = do_bsd_link(arg1, arg2);
break;
case TARGET_FREEBSD_NR_linkat: /* linkat(2) */
ret = do_bsd_linkat(arg1, arg2, arg3, arg4, arg5);
break;
case TARGET_FREEBSD_NR_unlink: /* unlink(2) */
ret = do_bsd_unlink(arg1);
break;
case TARGET_FREEBSD_NR_unlinkat: /* unlinkat(2) */
ret = do_bsd_unlinkat(arg1, arg2, arg3);
break;
default:
qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num);
ret = -TARGET_ENOSYS;