* Syscall to open a message queue. */
| 2117 | * Syscall to open a message queue. |
| 2118 | */ |
| 2119 | int |
| 2120 | sys_kmq_open(struct thread *td, struct kmq_open_args *uap) |
| 2121 | { |
| 2122 | struct mq_attr attr; |
| 2123 | int flags, error; |
| 2124 | |
| 2125 | if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC) |
| 2126 | return (EINVAL); |
| 2127 | flags = FFLAGS(uap->flags); |
| 2128 | if ((flags & O_CREAT) != 0 && uap->attr != NULL) { |
| 2129 | error = copyin(uap->attr, &attr, sizeof(attr)); |
| 2130 | if (error) |
| 2131 | return (error); |
| 2132 | } |
| 2133 | return (kern_kmq_open(td, uap->path, flags, uap->mode, |
| 2134 | uap->attr != NULL ? &attr : NULL)); |
| 2135 | } |
| 2136 | |
| 2137 | /* |
| 2138 | * Syscall to unlink a message queue. |
no test coverage detected