| 2271 | } |
| 2272 | |
| 2273 | int |
| 2274 | sys_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); |
| 2296 | out: |
| 2297 | fdrop(fp, td); |
| 2298 | return (error); |
| 2299 | } |
| 2300 | |
| 2301 | int |
| 2302 | sys_kmq_timedsend(struct thread *td, struct kmq_timedsend_args *uap) |
no test coverage detected