Back to index

glibc  2.9
Functions
pread.c File Reference
#include <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>

Go to the source code of this file.

Functions

ssize_t __libc_pread (int fd, void *buf, size_t count, off_t offset)

Function Documentation

ssize_t __libc_pread ( int  fd,
void *  buf,
size_t  count,
off_t  offset 
)

Definition at line 30 of file pread.c.

{
  ssize_t result;

  if (SINGLE_THREAD_P)
    {
      /* In the ARM EABI, 64-bit values are aligned to even/odd register
        pairs for syscalls.  */
      result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
                            __LONG_LONG_PAIR (offset >> 31, offset));

      return result;
    }

  int oldtype = LIBC_CANCEL_ASYNC ();

  /* In the ARM EABI, 64-bit values are aligned to even/odd register
     pairs for syscalls.  */
  result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
                        __LONG_LONG_PAIR (offset >> 31, offset));

  LIBC_CANCEL_RESET (oldtype);

  return result;
}