MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freebsd32_msgctl

Function freebsd32_msgctl

freebsd/kern/sysv_msg.c:1748–1789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1746#endif
1747
1748int
1749freebsd32_msgctl(struct thread *td, struct freebsd32_msgctl_args *uap)
1750{
1751 struct msqid_ds msqbuf;
1752 struct msqid_ds32 msqbuf32;
1753 int error;
1754
1755 if (uap->cmd == IPC_SET) {
1756 error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32));
1757 if (error)
1758 return (error);
1759 freebsd32_ipcperm_in(&msqbuf32.msg_perm, &msqbuf.msg_perm);
1760 PTRIN_CP(msqbuf32, msqbuf, __msg_first);
1761 PTRIN_CP(msqbuf32, msqbuf, __msg_last);
1762 CP(msqbuf32, msqbuf, msg_cbytes);
1763 CP(msqbuf32, msqbuf, msg_qnum);
1764 CP(msqbuf32, msqbuf, msg_qbytes);
1765 CP(msqbuf32, msqbuf, msg_lspid);
1766 CP(msqbuf32, msqbuf, msg_lrpid);
1767 CP(msqbuf32, msqbuf, msg_stime);
1768 CP(msqbuf32, msqbuf, msg_rtime);
1769 CP(msqbuf32, msqbuf, msg_ctime);
1770 }
1771 error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf);
1772 if (error)
1773 return (error);
1774 if (uap->cmd == IPC_STAT) {
1775 freebsd32_ipcperm_out(&msqbuf.msg_perm, &msqbuf32.msg_perm);
1776 PTROUT_CP(msqbuf, msqbuf32, __msg_first);
1777 PTROUT_CP(msqbuf, msqbuf32, __msg_last);
1778 CP(msqbuf, msqbuf32, msg_cbytes);
1779 CP(msqbuf, msqbuf32, msg_qnum);
1780 CP(msqbuf, msqbuf32, msg_qbytes);
1781 CP(msqbuf, msqbuf32, msg_lspid);
1782 CP(msqbuf, msqbuf32, msg_lrpid);
1783 CP(msqbuf, msqbuf32, msg_stime);
1784 CP(msqbuf, msqbuf32, msg_rtime);
1785 CP(msqbuf, msqbuf32, msg_ctime);
1786 error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32));
1787 }
1788 return (error);
1789}
1790
1791int
1792freebsd32_msgsnd(struct thread *td, struct freebsd32_msgsnd_args *uap)

Callers

nothing calls this directly

Calls 5

freebsd32_ipcperm_inFunction · 0.85
kern_msgctlFunction · 0.85
freebsd32_ipcperm_outFunction · 0.85
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected