diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2023-09-25 21:26:52 +0300 |
|---|---|---|
| committer | Warner Losh <imp@bsdimp.com> | 2023-10-03 17:14:06 -0600 |
| commit | 182ea728e06a09e6ceaa9d62a279e883459d36dd (patch) | |
| tree | 4cf39cad3726ba45f38384410194fde327853eff /bsd-user/freebsd/os-misc.h | |
| parent | 0c3529888a427cefe248227423f7a89c8f665fab (diff) | |
| download | focaccia-qemu-182ea728e06a09e6ceaa9d62a279e883459d36dd.tar.gz focaccia-qemu-182ea728e06a09e6ceaa9d62a279e883459d36dd.zip | |
bsd-user: Implement shm_rename(2) system call
Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20230925182709.4834-7-kariem.taha2.7@gmail.com>
Diffstat (limited to 'bsd-user/freebsd/os-misc.h')
| -rw-r--r-- | bsd-user/freebsd/os-misc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bsd-user/freebsd/os-misc.h b/bsd-user/freebsd/os-misc.h index d5e8b5484c..71145764a4 100644 --- a/bsd-user/freebsd/os-misc.h +++ b/bsd-user/freebsd/os-misc.h @@ -70,5 +70,29 @@ static inline abi_long do_freebsd_shm_open2(abi_ulong pathptr, abi_ulong flags, } #endif /* __FreeBSD_version >= 1300048 */ +#if defined(__FreeBSD_version) && __FreeBSD_version >= 1300049 +/* shm_rename(2) */ +static inline abi_long do_freebsd_shm_rename(abi_ulong fromptr, abi_ulong toptr, + abi_ulong flags) +{ + int ret; + void *ufrom, *uto; + + ufrom = lock_user_string(fromptr); + if (ufrom == NULL) { + return -TARGET_EFAULT; + } + uto = lock_user_string(toptr); + if (uto == NULL) { + unlock_user(ufrom, fromptr, 0); + return -TARGET_EFAULT; + } + ret = get_errno(shm_rename(ufrom, uto, flags)); + unlock_user(ufrom, fromptr, 0); + unlock_user(uto, toptr, 0); + + return ret; +} +#endif /* __FreeBSD_version >= 1300049 */ #endif /* OS_MISC_H */ |