|
@@ -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 */
|