]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bsd-user: Implement undelete
authorWarner Losh <imp@bsdimp.com>
Thu, 16 Jun 2022 14:07:52 +0000 (08:07 -0600)
committerWarner Losh <imp@bsdimp.com>
Sat, 2 Jul 2022 13:52:48 +0000 (07:52 -0600)
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
bsd-user/bsd-file.h
bsd-user/freebsd/os-syscall.c

index 065f576dfe8d0687d985e18c69fbc5f878a0b277..108a50618505dae5f6f06233a377f1108077c488 100644 (file)
@@ -926,4 +926,17 @@ static abi_long do_bsd_fpathconf(abi_long arg1, abi_long arg2)
     return get_errno(fpathconf(arg1, arg2));
 }
 
+/* undelete(2) */
+static abi_long do_bsd_undelete(abi_long arg1)
+{
+    abi_long ret;
+    void *p;
+
+    LOCK_PATH(p, arg1);
+    ret = get_errno(undelete(p)); /* XXX path(p)? */
+    UNLOCK_PATH(p, arg1);
+
+    return ret;
+}
+
 #endif /* BSD_FILE_H */
index 7de4c40bb1650d9469672709600dea69fbdccc7d..57996cad8aeef73d6e73bd8366fb2b483a63c152 100644 (file)
@@ -487,6 +487,10 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
         ret = do_bsd_fpathconf(arg1, arg2);
         break;
 
+    case TARGET_FREEBSD_NR_undelete: /* undelete(2) */
+        ret = do_bsd_undelete(arg1);
+        break;
+
     default:
         qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num);
         ret = -TARGET_ENOSYS;