Files
oldlinux-files/Ref-docs/syscalls/syscalls_73.html
2024-02-19 00:21:47 -05:00

71 lines
2.4 KiB
HTML

<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - ipc</TITLE>
<P>Go to the <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">previous</A>, <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">next</A> section.<P>
<H2><A NAME="SEC73" HREF="syscalls_toc.html#SEC73" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC73">ipc</A></H2>
<P>
<H3>SYSNOPSIS</H3>
<P>
<CODE>int sys_ipc (uint <VAR>call</VAR>, int <VAR>first</VAR>, int <VAR>second</VAR>,
int <VAR>third</VAR>, void *<VAR>ptr</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>call</VAR>: [in] the ipc call to perform.
<P>
<VAR>first</VAR>, <VAR>second</VAR>, <VAR>third</VAR>: parameters. Depend on
<VAR>call</VAR>.
<P>
<VAR>ptr</VAR>: [in] pointer to a buffer.
<P>
<H3>DESCRIPTION</H3>
<P>
This is an in kernel wrapper for other ipc calls. <VAR>call</VAR> can take
the following values:
<P>
<DL COMPACT>
<DT><CODE>SEMOP</CODE>
<DD><CODE>sys_semop(first, (struct sembuf *)ptr, second);</CODE>
<P>
<DT><CODE>SEMGET</CODE>
<DD><CODE>sys_semget (first, second, third);</CODE>
<P>
<DT><CODE>SEMCTL</CODE>
<DD><CODE>sys_semctl (first, second, third, ptr);</CODE>
<P>
<DT><CODE>MSGSND</CODE>
<DD><CODE>sys_msgsnd (first, (struct msgbuf *) ptr, second, third);</CODE>
<P>
<DT><CODE>MSGRCV</CODE>
<DD>This one is a little tricky...
<P>
<CODE>struct ipc_kludge tmp;</CODE>
<CODE>if (!ptr) return -EINVAL;</CODE>
<P>
<CODE>memcpy_fromfs (&#38;tmp,(struct ipc_kludge *) ptr, sizeof (tmp));</CODE>
<P>
<CODE>return sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third);</CODE>
<P>
<DT><CODE>MSGGET</CODE>
<DD><CODE>sys_msgget ((key_t) first, second);</CODE>
<P>
<DT><CODE>MSGCTL</CODE>
<DD><CODE>sys_msgctl (first, second, (struct msqid_ds *) ptr);</CODE>
<P>
<DT><CODE>SHMAT</CODE>
<DD><CODE>sys_shmat (first, (char *) ptr, second, (ulong *) third);</CODE>
<P>
<DT><CODE>SHMDT</CODE>
<DD><CODE>sys_shmdt ((char *)ptr);</CODE>
<P>
<DT><CODE>SHMGET</CODE>
<DD><CODE>sys_shmget (first, second, third);</CODE>
<P>
<DT><CODE>SHMCTL</CODE>
<DD><CODE>sys_shmctl (first, second, (struct shmid_ds *) ptr);</CODE>
</DL>
<P>
<P>Go to the <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">previous</A>, <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">next</A> section.<P>