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

Function sys_event_recv

components/lwp/lwp_syscall.c:2267–2288  ·  view source on GitHub ↗

* @brief Receives an event from the specified event object. * * This system call waits for an event to be received from the specified * event object. The function blocks until the specified event bits are * set in the event object's set or the specified timeout period has * elapsed. If the event is received, the function returns the set of * bits that were set in the event object. * * @par

Source from the content-addressed store, hash-verified

2265 * @see sys_event_create(), sys_event_send()
2266 */
2267sysret_t sys_event_recv(rt_event_t event,
2268 rt_uint32_t set,
2269 rt_uint8_t opt,
2270 rt_int32_t timeout,
2271 rt_uint32_t *recved)
2272{
2273 int ret = 0;
2274 rt_uint32_t krecved;
2275
2276 if ((recved != NULL) && !lwp_user_accessable((void *)recved, sizeof(rt_uint32_t *)))
2277 {
2278 return -EFAULT;
2279 }
2280
2281 ret = rt_event_recv(event, set, opt, timeout, &krecved);
2282 if ((ret == RT_EOK) && recved)
2283 {
2284 lwp_put_to_user((void *)recved, &krecved, sizeof(rt_uint32_t *));
2285 }
2286
2287 return ret;
2288}
2289
2290/**
2291 * @brief Creates a mailbox for inter-thread or inter-process communication.

Callers

nothing calls this directly

Calls 3

lwp_user_accessableFunction · 0.85
rt_event_recvFunction · 0.85
lwp_put_to_userFunction · 0.85

Tested by

no test coverage detected