MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _fetch_robust_entry

Function _fetch_robust_entry

components/lwp/lwp_futex.c:1030–1050  ·  view source on GitHub ↗

* @brief Fetches a robust futex list entry from user space * * @param[out] entry Pointer to store the retrieved robust list entry * @param[in] head Pointer to the head of the robust list in user space * @param[out] is_pi Pointer to store the PI flag status * * @return Operation status * - 0 on success * - EFAULT if user space access fails * * @note This helper function sa

Source from the content-addressed store, hash-verified

1028 * from user space and extracts the PI (Priority Inheritance) flag.
1029 */
1030rt_inline int _fetch_robust_entry(struct robust_list **entry,
1031 struct robust_list **head, rt_bool_t *is_pi)
1032{
1033 unsigned long uentry;
1034
1035 if (!lwp_user_accessable((void *)head, sizeof(*head)))
1036 {
1037 return -EFAULT;
1038 }
1039
1040 if (lwp_get_from_user(&uentry, (void *)head, sizeof(*head)) !=
1041 sizeof(*head))
1042 {
1043 return -EFAULT;
1044 }
1045
1046 *entry = (void *)(uentry & ~1UL);
1047 *is_pi = uentry & 1;
1048
1049 return 0;
1050}
1051
1052/**
1053 * @brief Handles futex cleanup when a thread dies

Callers 1

Calls 2

lwp_user_accessableFunction · 0.85
lwp_get_from_userFunction · 0.85

Tested by

no test coverage detected