| 1700 | #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ |
| 1701 | defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) |
| 1702 | int |
| 1703 | freebsd7_freebsd32_msgctl(struct thread *td, |
| 1704 | struct freebsd7_freebsd32_msgctl_args *uap) |
| 1705 | { |
| 1706 | struct msqid_ds msqbuf; |
| 1707 | struct msqid_ds32_old msqbuf32; |
| 1708 | int error; |
| 1709 | |
| 1710 | if (uap->cmd == IPC_SET) { |
| 1711 | error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32)); |
| 1712 | if (error) |
| 1713 | return (error); |
| 1714 | freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); |
| 1715 | PTRIN_CP(msqbuf32, msqbuf, __msg_first); |
| 1716 | PTRIN_CP(msqbuf32, msqbuf, __msg_last); |
| 1717 | CP(msqbuf32, msqbuf, msg_cbytes); |
| 1718 | CP(msqbuf32, msqbuf, msg_qnum); |
| 1719 | CP(msqbuf32, msqbuf, msg_qbytes); |
| 1720 | CP(msqbuf32, msqbuf, msg_lspid); |
| 1721 | CP(msqbuf32, msqbuf, msg_lrpid); |
| 1722 | CP(msqbuf32, msqbuf, msg_stime); |
| 1723 | CP(msqbuf32, msqbuf, msg_rtime); |
| 1724 | CP(msqbuf32, msqbuf, msg_ctime); |
| 1725 | } |
| 1726 | error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf); |
| 1727 | if (error) |
| 1728 | return (error); |
| 1729 | if (uap->cmd == IPC_STAT) { |
| 1730 | bzero(&msqbuf32, sizeof(msqbuf32)); |
| 1731 | freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); |
| 1732 | PTROUT_CP(msqbuf, msqbuf32, __msg_first); |
| 1733 | PTROUT_CP(msqbuf, msqbuf32, __msg_last); |
| 1734 | CP(msqbuf, msqbuf32, msg_cbytes); |
| 1735 | CP(msqbuf, msqbuf32, msg_qnum); |
| 1736 | CP(msqbuf, msqbuf32, msg_qbytes); |
| 1737 | CP(msqbuf, msqbuf32, msg_lspid); |
| 1738 | CP(msqbuf, msqbuf32, msg_lrpid); |
| 1739 | CP(msqbuf, msqbuf32, msg_stime); |
| 1740 | CP(msqbuf, msqbuf32, msg_rtime); |
| 1741 | CP(msqbuf, msqbuf32, msg_ctime); |
| 1742 | error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32)); |
| 1743 | } |
| 1744 | return (error); |
| 1745 | } |
| 1746 | #endif |
| 1747 | |
| 1748 | int |
no test coverage detected