| 131 | } |
| 132 | |
| 133 | int |
| 134 | audit_send_trigger(unsigned int trigger) |
| 135 | { |
| 136 | struct trigger_info *ti; |
| 137 | |
| 138 | ti = malloc(sizeof *ti, M_AUDITTRIGGER, M_WAITOK); |
| 139 | mtx_lock(&audit_trigger_mtx); |
| 140 | if (!audit_isopen) { |
| 141 | /* If nobody's listening, we ain't talking. */ |
| 142 | mtx_unlock(&audit_trigger_mtx); |
| 143 | free(ti, M_AUDITTRIGGER); |
| 144 | return (ENODEV); |
| 145 | } |
| 146 | ti->trigger = trigger; |
| 147 | TAILQ_INSERT_TAIL(&trigger_list, ti, list); |
| 148 | wakeup(&trigger_list); |
| 149 | mtx_unlock(&audit_trigger_mtx); |
| 150 | return (0); |
| 151 | } |
| 152 | |
| 153 | static struct cdevsw audit_cdevsw = { |
| 154 | .d_version = D_VERSION, |
no test coverage detected