mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
* string/endian.h (__LONG_LONG_PAIR): New macro.
* sysdeps/unix/sysv/linux/ftruncate64.c: Use it. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. * string/endian.h (__LONG_LONG_PAIR): New macro. * sysdeps/unix/sysv/linux/ftruncate64.c: Use it. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise.
This commit is contained in:
parent
cf90163d41
commit
ca1cde9e3e
14
ChangeLog
14
ChangeLog
@ -8,6 +8,20 @@
|
|||||||
|
|
||||||
2000-07-06 Greg McGary <greg@mcgary.org>
|
2000-07-06 Greg McGary <greg@mcgary.org>
|
||||||
|
|
||||||
|
* string/endian.h (__LONG_LONG_PAIR): New macro.
|
||||||
|
* sysdeps/unix/sysv/linux/ftruncate64.c: Use it.
|
||||||
|
* sysdeps/unix/sysv/linux/pread.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/pread64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/truncate64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_SYSCALL): Fix LHS.
|
* sysdeps/unix/sysv/linux/sys/ptrace.h (PT_SYSCALL): Fix LHS.
|
||||||
|
|
||||||
2000-07-06 Andreas Jaeger <aj@suse.de>
|
2000-07-06 Andreas Jaeger <aj@suse.de>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
|
/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -47,4 +47,10 @@
|
|||||||
# define BYTE_ORDER __BYTE_ORDER
|
# define BYTE_ORDER __BYTE_ORDER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
# define __LONG_LONG_PAIR(HI, LO) LO, HI
|
||||||
|
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
# define __LONG_LONG_PAIR(HI, LO) HI, LO
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* endian.h */
|
#endif /* endian.h */
|
||||||
|
@ -49,11 +49,8 @@ ftruncate64 (int fd, off64_t length)
|
|||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
#endif
|
#endif
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
int result = INLINE_SYSCALL (ftruncate64, 3, fd,
|
||||||
int result = INLINE_SYSCALL (ftruncate64, 3, fd, low, high);
|
__LONG_LONG_PAIR (high, low));
|
||||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
int result = INLINE_SYSCALL (ftruncate64, 3, fd, high, low);
|
|
||||||
#endif
|
|
||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
if (result != -1 || errno != ENOSYS)
|
if (result != -1 || errno != ENOSYS)
|
||||||
#endif
|
#endif
|
||||||
|
@ -50,13 +50,8 @@ ftruncate64 (int fd, off64_t length)
|
|||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
#endif
|
#endif
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0,
|
||||||
/* Use a fill argument to pass low, high in an aligned pair of
|
__LONG_LONG_PAIR (high, low));
|
||||||
arguments (here 2/3). */
|
|
||||||
int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, low, high);
|
|
||||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, high, low);
|
|
||||||
#endif
|
|
||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
if (result != -1 || errno != ENOSYS)
|
if (result != -1 || errno != ENOSYS)
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
@ -46,11 +47,8 @@ __libc_pread (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if defined(__MIPSEB__)
|
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
|
||||||
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, 0, offset);
|
__LONG_LONG_PAIR (0, offset));
|
||||||
# elif defined(__MIPSEL__)
|
|
||||||
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, offset, 0);
|
|
||||||
# endif
|
|
||||||
# if __ASSUME_PREAD_SYSCALL == 0
|
# if __ASSUME_PREAD_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
@ -47,14 +48,9 @@ __libc_pread64 (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if defined(__MIPSEB__)
|
|
||||||
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, (off_t) (offset >> 32),
|
|
||||||
(off_t) (offset & 0xffffffff));
|
|
||||||
# elif defined(__MIPSEL__)
|
|
||||||
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
|
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
|
||||||
(off_t) (offset & 0xffffffff),
|
__LONG_LONG_PAIR ((off_t) (offset >> 32),
|
||||||
(off_t) (offset >> 32));
|
(off_t) (offset & 0xffffffff)));
|
||||||
# endif
|
|
||||||
# if __ASSUME_PREAD_SYSCALL == 0
|
# if __ASSUME_PREAD_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
@ -45,11 +46,8 @@ __libc_pwrite (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if defined(__MIPSEB__)
|
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
|
||||||
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, 0, offset);
|
__LONG_LONG_PAIR (0, offset));
|
||||||
# elif defined(__MIPSEL__)
|
|
||||||
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, offset, 0);
|
|
||||||
# endif
|
|
||||||
# if __ASSUME_PWRITE_SYSCALL == 0
|
# if __ASSUME_PWRITE_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
@ -45,15 +46,9 @@ __libc_pwrite64 (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if defined(__MIPSEB__)
|
|
||||||
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, (off_t) (offset >> 32),
|
|
||||||
(off_t) (offset & 0xffffffff));
|
|
||||||
# elif defined(__MIPSEL__)
|
|
||||||
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
|
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
|
||||||
(off_t) (offset & 0xffffffff),
|
__LONG_LONG_PAIR ((off_t) (offset >> 32),
|
||||||
(off_t) (offset >> 32));
|
(off_t) (offset & 0xffffffff)));
|
||||||
# endif
|
|
||||||
|
|
||||||
# if __ASSUME_PWRITE_SYSCALL == 0
|
# if __ASSUME_PWRITE_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -50,14 +50,8 @@ truncate64 (const char *path, off64_t length)
|
|||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
#endif
|
#endif
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
int result = INLINE_SYSCALL (truncate64, 3, path, 0,
|
||||||
/* Use a fill argument to pass low, high in an aligned pair of
|
__LONG_LONG_PAIR (high, low));
|
||||||
arguments (here 2/3). */
|
|
||||||
int result = INLINE_SYSCALL (truncate64, 3, path, 0, low, high);
|
|
||||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
int result = INLINE_SYSCALL (truncate64, 3, path, 0, high, low);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
if (result != -1 || errno != ENOSYS)
|
if (result != -1 || errno != ENOSYS)
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,11 +48,8 @@ __libc_pread (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
result = INLINE_SYSCALL (pread, 5, fd, buf, count,
|
||||||
result = INLINE_SYSCALL (pread, 5, fd, buf, count, offset, 0);
|
__LONG_LONG_PAIR (0, offset));
|
||||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pread, 5, fd, buf, count, 0, offset);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if __ASSUME_PREAD_SYSCALL == 0
|
# if __ASSUME_PREAD_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
|
@ -47,15 +47,9 @@ __libc_pread64 (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pread, 5, fd, buf, count,
|
result = INLINE_SYSCALL (pread, 5, fd, buf, count,
|
||||||
(off_t) (offset & 0xffffffff),
|
__LONG_LONG_PAIR ((off_t) (offset >> 32),
|
||||||
(off_t) (offset >> 32));
|
(off_t) (offset & 0xffffffff)));
|
||||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pread, 5, fd, buf, count,
|
|
||||||
(off_t) (offset >> 32),
|
|
||||||
(off_t) (offset & 0xffffffff));
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if __ASSUME_PREAD_SYSCALL == 0
|
# if __ASSUME_PREAD_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
|
@ -48,11 +48,8 @@ __libc_pwrite (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
|
||||||
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, offset, 0);
|
__LONG_LONG_PAIR (0, offset));
|
||||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, 0, offset);
|
|
||||||
# endif
|
|
||||||
# if __ASSUME_PWRITE_SYSCALL == 0
|
# if __ASSUME_PWRITE_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -47,15 +47,9 @@ __libc_pwrite64 (fd, buf, count, offset)
|
|||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
/* First try the syscall. */
|
/* First try the syscall. */
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
|
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
|
||||||
(off_t) (offset & 0xffffffff),
|
__LONG_LONG_PAIR ((off_t) (offset >> 32),
|
||||||
(off_t) (offset >> 32));
|
(off_t) (offset & 0xffffffff)));
|
||||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
|
|
||||||
(off_t) (offset >> 32),
|
|
||||||
(off_t) (offset & 0xffffffff));
|
|
||||||
# endif
|
|
||||||
# if __ASSUME_PWRITE_SYSCALL == 0
|
# if __ASSUME_PWRITE_SYSCALL == 0
|
||||||
if (result == -1 && errno == ENOSYS)
|
if (result == -1 && errno == ENOSYS)
|
||||||
/* No system call available. Use the emulation. */
|
/* No system call available. Use the emulation. */
|
||||||
|
@ -49,11 +49,8 @@ truncate64 (const char *path, off64_t length)
|
|||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
#endif
|
#endif
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
int result = INLINE_SYSCALL (truncate64, 3, path,
|
||||||
int result = INLINE_SYSCALL (truncate64, 3, path, low, high);
|
__LONG_LONG_PAIR (high, low));
|
||||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
int result = INLINE_SYSCALL (truncate64, 3, path, high, low);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
#ifndef __ASSUME_TRUNCATE64_SYSCALL
|
||||||
if (result != -1 || errno != ENOSYS)
|
if (result != -1 || errno != ENOSYS)
|
||||||
|
Loading…
Reference in New Issue
Block a user