| 1869 | }; |
| 1870 | #endif |
| 1871 | int |
| 1872 | freebsd7_msgctl(struct thread *td, struct freebsd7_msgctl_args *uap) |
| 1873 | { |
| 1874 | struct msqid_ds_old msqold; |
| 1875 | struct msqid_ds msqbuf; |
| 1876 | int error; |
| 1877 | |
| 1878 | DPRINTF(("call to freebsd7_msgctl(%d, %d, %p)\n", uap->msqid, uap->cmd, |
| 1879 | uap->buf)); |
| 1880 | if (uap->cmd == IPC_SET) { |
| 1881 | error = copyin(uap->buf, &msqold, sizeof(msqold)); |
| 1882 | if (error) |
| 1883 | return (error); |
| 1884 | ipcperm_old2new(&msqold.msg_perm, &msqbuf.msg_perm); |
| 1885 | CP(msqold, msqbuf, __msg_first); |
| 1886 | CP(msqold, msqbuf, __msg_last); |
| 1887 | CP(msqold, msqbuf, msg_cbytes); |
| 1888 | CP(msqold, msqbuf, msg_qnum); |
| 1889 | CP(msqold, msqbuf, msg_qbytes); |
| 1890 | CP(msqold, msqbuf, msg_lspid); |
| 1891 | CP(msqold, msqbuf, msg_lrpid); |
| 1892 | CP(msqold, msqbuf, msg_stime); |
| 1893 | CP(msqold, msqbuf, msg_rtime); |
| 1894 | CP(msqold, msqbuf, msg_ctime); |
| 1895 | } |
| 1896 | error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf); |
| 1897 | if (error) |
| 1898 | return (error); |
| 1899 | if (uap->cmd == IPC_STAT) { |
| 1900 | bzero(&msqold, sizeof(msqold)); |
| 1901 | ipcperm_new2old(&msqbuf.msg_perm, &msqold.msg_perm); |
| 1902 | CP(msqbuf, msqold, __msg_first); |
| 1903 | CP(msqbuf, msqold, __msg_last); |
| 1904 | CP(msqbuf, msqold, msg_cbytes); |
| 1905 | CP(msqbuf, msqold, msg_qnum); |
| 1906 | CP(msqbuf, msqold, msg_qbytes); |
| 1907 | CP(msqbuf, msqold, msg_lspid); |
| 1908 | CP(msqbuf, msqold, msg_lrpid); |
| 1909 | CP(msqbuf, msqold, msg_stime); |
| 1910 | CP(msqbuf, msqold, msg_rtime); |
| 1911 | CP(msqbuf, msqold, msg_ctime); |
| 1912 | error = copyout(&msqold, uap->buf, sizeof(struct msqid_ds_old)); |
| 1913 | } |
| 1914 | return (error); |
| 1915 | } |
| 1916 | |
| 1917 | #undef CP |
| 1918 |
nothing calls this directly
no test coverage detected