| 1522 | } |
| 1523 | |
| 1524 | int |
| 1525 | sys_ppoll(struct thread *td, struct ppoll_args *uap) |
| 1526 | { |
| 1527 | struct timespec ts, *tsp; |
| 1528 | sigset_t set, *ssp; |
| 1529 | int error; |
| 1530 | |
| 1531 | if (uap->ts != NULL) { |
| 1532 | error = copyin(uap->ts, &ts, sizeof(ts)); |
| 1533 | if (error) |
| 1534 | return (error); |
| 1535 | tsp = &ts; |
| 1536 | } else |
| 1537 | tsp = NULL; |
| 1538 | if (uap->set != NULL) { |
| 1539 | error = copyin(uap->set, &set, sizeof(set)); |
| 1540 | if (error) |
| 1541 | return (error); |
| 1542 | ssp = &set; |
| 1543 | } else |
| 1544 | ssp = NULL; |
| 1545 | /* |
| 1546 | * fds is still a pointer to user space. kern_poll() will |
| 1547 | * take care of copyin that array to the kernel space. |
| 1548 | */ |
| 1549 | |
| 1550 | return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); |
| 1551 | } |
| 1552 | |
| 1553 | static int |
| 1554 | pollrescan(struct thread *td) |