Back to index

glibc  2.9
Classes | Functions
msgrcv.c File Reference
#include <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>

Go to the source code of this file.


struct  ipc_kludge


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

Class Documentation

struct ipc_kludge

Definition at line 31 of file msgrcv.c.

Class Members
void *__unbounded msgp
long int msgtyp

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;

    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;