MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_kmq_timedreceive

Function sys_kmq_timedreceive

freebsd/kern/uipc_mqueue.c:2273–2299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2271}
2272
2273int
2274sys_kmq_timedreceive(struct thread *td, struct kmq_timedreceive_args *uap)
2275{
2276 struct mqueue *mq;
2277 struct file *fp;
2278 struct timespec *abs_timeout, ets;
2279 int error;
2280 int waitok;
2281
2282 AUDIT_ARG_FD(uap->mqd);
2283 error = getmq_read(td, uap->mqd, &fp, NULL, &mq);
2284 if (error)
2285 return (error);
2286 if (uap->abs_timeout != NULL) {
2287 error = copyin(uap->abs_timeout, &ets, sizeof(ets));
2288 if (error != 0)
2289 goto out;
2290 abs_timeout = &ets;
2291 } else
2292 abs_timeout = NULL;
2293 waitok = !(fp->f_flag & O_NONBLOCK);
2294 error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len,
2295 uap->msg_prio, waitok, abs_timeout);
2296out:
2297 fdrop(fp, td);
2298 return (error);
2299}
2300
2301int
2302sys_kmq_timedsend(struct thread *td, struct kmq_timedsend_args *uap)

Callers 1

linux_mq_timedreceiveFunction · 0.85

Calls 3

getmq_readFunction · 0.85
mqueue_receiveFunction · 0.85
copyinFunction · 0.50

Tested by

no test coverage detected