* Get message queue by giving file slot */
| 2171 | * Get message queue by giving file slot |
| 2172 | */ |
| 2173 | static int |
| 2174 | _getmq(struct thread *td, int fd, cap_rights_t *rightsp, _fgetf func, |
| 2175 | struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq) |
| 2176 | { |
| 2177 | struct mqfs_node *pn; |
| 2178 | int error; |
| 2179 | |
| 2180 | error = func(td, fd, rightsp, fpp); |
| 2181 | if (error) |
| 2182 | return (error); |
| 2183 | if (&mqueueops != (*fpp)->f_ops) { |
| 2184 | fdrop(*fpp, td); |
| 2185 | return (EBADF); |
| 2186 | } |
| 2187 | pn = (*fpp)->f_data; |
| 2188 | if (ppn) |
| 2189 | *ppn = pn; |
| 2190 | if (pmq) |
| 2191 | *pmq = pn->mn_data; |
| 2192 | return (0); |
| 2193 | } |
| 2194 | |
| 2195 | static __inline int |
| 2196 | getmq(struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, |
no outgoing calls
no test coverage detected