Back to index

glibc  2.9
Functions
msg.h File Reference
#include <sysvipc/sys/msg.h>

Go to the source code of this file.

Functions

ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg)
int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)

Function Documentation

ssize_t __libc_msgrcv ( int  msqid,
void *  msgp,
size_t  msgsz,
long int  msgtyp,
int  msgflg 
)

Definition at line 39 of file msgrcv.c.

{
  /* The problem here is that Linux' calling convention only allows up to
     fives parameters to a system call.  */
  struct ipc_kludge tmp;

  tmp.msgp = CHECK_N (msgp, msgsz);
  tmp.msgtyp = msgtyp;

  if (SINGLE_THREAD_P)
    return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
                        __ptrvalue (&tmp));

  int oldtype = LIBC_CANCEL_ASYNC ();

  ssize_t result = INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
                               __ptrvalue (&tmp));

   LIBC_CANCEL_RESET (oldtype);

  return result;
}
int __libc_msgsnd ( int  msqid,
const void *  msgp,
size_t  msgsz,
int  msgflg 
)

Definition at line 30 of file msgsnd.c.

{
  if (SINGLE_THREAD_P)
    return INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
                        msgflg, (void *) CHECK_N (msgp, msgsz));

  int oldtype = LIBC_CANCEL_ASYNC ();

  int result = INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
                            msgflg, (void *) CHECK_N (msgp, msgsz));

  LIBC_CANCEL_RESET (oldtype);

  return result;
}