* Audit pipe poll. */
| 980 | * Audit pipe poll. |
| 981 | */ |
| 982 | static int |
| 983 | audit_pipe_poll(struct cdev *dev, int events, struct thread *td) |
| 984 | { |
| 985 | struct audit_pipe *ap; |
| 986 | int error, revents; |
| 987 | |
| 988 | revents = 0; |
| 989 | error = devfs_get_cdevpriv((void **)&ap); |
| 990 | if (error != 0) |
| 991 | return (error); |
| 992 | if (events & (POLLIN | POLLRDNORM)) { |
| 993 | AUDIT_PIPE_LOCK(ap); |
| 994 | if (TAILQ_FIRST(&ap->ap_queue) != NULL) |
| 995 | revents |= events & (POLLIN | POLLRDNORM); |
| 996 | else |
| 997 | selrecord(td, &ap->ap_selinfo); |
| 998 | AUDIT_PIPE_UNLOCK(ap); |
| 999 | } |
| 1000 | return (revents); |
| 1001 | } |
| 1002 | |
| 1003 | /* |
| 1004 | * Audit pipe kqfilter. |
nothing calls this directly
no test coverage detected