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

Function freebsd7_freebsd32_msgctl

freebsd/kern/sysv_msg.c:1702–1745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1700#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
1701 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
1702int
1703freebsd7_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
1748int

Callers 1

freebsd32_msgsysFunction · 0.85

Calls 6

freebsd32_ipcperm_old_inFunction · 0.85
kern_msgctlFunction · 0.85
bzeroFunction · 0.85
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected