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

Function freebsd7_msgctl

freebsd/kern/sysv_msg.c:1871–1915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1869};
1870#endif
1871int
1872freebsd7_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

Callers

nothing calls this directly

Calls 6

ipcperm_old2newFunction · 0.85
kern_msgctlFunction · 0.85
bzeroFunction · 0.85
ipcperm_new2oldFunction · 0.85
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected