[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 27/32] Implement do_freebsd_realpathat syscall
From: |
Karim Taha |
Subject: |
[PATCH v3 27/32] Implement do_freebsd_realpathat syscall |
Date: |
Sun, 13 Aug 2023 10:41:48 +0200 |
From: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/freebsd/os-stat.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/bsd-user/freebsd/os-stat.h b/bsd-user/freebsd/os-stat.h
index e31b2aab9e..b20e270774 100644
--- a/bsd-user/freebsd/os-stat.h
+++ b/bsd-user/freebsd/os-stat.h
@@ -634,4 +634,30 @@ static inline abi_long do_freebsd_fcntl(abi_long arg1,
abi_long arg2,
return ret;
}
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1300080
+extern int __realpathat(int fd, const char *path, char *buf, size_t size,
+ int flags);
+/* https://svnweb.freebsd.org/base?view=revision&revision=358172 */
+/* no man page */
+static inline abi_long do_freebsd_realpathat(abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ abi_long ret;
+ void *p, *b;
+
+ LOCK_PATH(p, arg2);
+ b = lock_user(VERIFY_WRITE, arg3, arg4, 0);
+ if (b == NULL) {
+ UNLOCK_PATH(p, arg2);
+ return -TARGET_EFAULT;
+ }
+
+ ret = get_errno(__realpathat(arg1, p, b, arg4, arg5));
+ UNLOCK_PATH(p, arg2);
+ unlock_user(b, arg3, ret);
+
+ return ret;
+}
+#endif
+
#endif /* BSD_USER_FREEBSD_OS_STAT_H */
--
2.40.0
- [PATCH v3 17/32] Implement stat related syscalls, (continued)
- [PATCH v3 17/32] Implement stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 18/32] Implement stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 19/32] Implement stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 20/32] Implement stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 21/32] Implement stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 22/32] Implement freebsd11 stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 25/32] Implement freebsd11 stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 26/32] Implement freebsd11 stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 23/32] Implement freebsd11 stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 24/32] Implement freebsd11 stat related syscalls, Karim Taha, 2023/08/13
- [PATCH v3 27/32] Implement do_freebsd_realpathat syscall,
Karim Taha <=
- [PATCH v3 28/32] Add os-stat.c to the build, Karim Taha, 2023/08/13
- [PATCH v3 29/32] Add glue to call the following syscalls to the freebsd_syscall function:, Karim Taha, 2023/08/13
- [PATCH v3 30/32] Add glue to call the following syscalls to the freebsd_syscall function:, Karim Taha, 2023/08/13
- [PATCH v3 31/32] Add glue to call the following syscalls to the freebsd_syscall function:, Karim Taha, 2023/08/13
- [PATCH v3 32/32] Add glue to call the following syscalls to the freebsd_syscall function:, Karim Taha, 2023/08/13
- Re: [PATCH v3 00/32] Implement the stat system calls for FreeBSD., Warner Losh, 2023/08/20
- Re: [PATCH v3 00/32] Implement the stat system calls for FreeBSD., Markus Armbruster, 2023/08/21