mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
bsd-user: Implement mkdir and mkdirat
Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2d3b7e01d6
commit
1ffbd5e7fe
2 changed files with 35 additions and 0 deletions
|
@ -429,4 +429,31 @@ static abi_long do_bsd_unlinkat(abi_long arg1, abi_long arg2,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* mkdir(2) */
|
||||
static abi_long do_bsd_mkdir(abi_long arg1, abi_long arg2)
|
||||
{
|
||||
abi_long ret;
|
||||
void *p;
|
||||
|
||||
LOCK_PATH(p, arg1);
|
||||
ret = get_errno(mkdir(p, arg2)); /* XXX path(p) */
|
||||
UNLOCK_PATH(p, arg1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* mkdirat(2) */
|
||||
static abi_long do_bsd_mkdirat(abi_long arg1, abi_long arg2,
|
||||
abi_long arg3)
|
||||
{
|
||||
abi_long ret;
|
||||
void *p;
|
||||
|
||||
LOCK_PATH(p, arg2);
|
||||
ret = get_errno(mkdirat(arg1, p, arg3));
|
||||
UNLOCK_PATH(p, arg2);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* BSD_FILE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue