From d35020ed00b1cb649ccd73ba4f5e918a5cc5363a Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 12 Jun 2022 09:31:18 -0600 Subject: bsd-user: Implement acct and sync Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'bsd-user/bsd-file.h') diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index fda3689460..b2dca58612 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -526,4 +526,27 @@ static abi_long do_bsd_ftruncate(void *cpu_env, abi_long arg1, return get_errno(ftruncate(arg1, target_arg64(arg2, arg3))); } +/* acct(2) */ +static abi_long do_bsd_acct(abi_long arg1) +{ + abi_long ret; + void *p; + + if (arg1 == 0) { + ret = get_errno(acct(NULL)); + } else { + LOCK_PATH(p, arg1); + ret = get_errno(acct(path(p))); + UNLOCK_PATH(p, arg1); + } + return ret; +} + +/* sync(2) */ +static abi_long do_bsd_sync(void) +{ + sync(); + return 0; +} + #endif /* BSD_FILE_H */ -- cgit v1.2.3