Skip to content

Commit

Permalink
function if it is not defined. Add some necessary casts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Apr 9, 2009
1 parent f9fe75e commit 24030b0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2009-04-09 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/preadv.c: Avoid prototype for static
function if it is not defined.
function if it is not defined. Add some necessary casts.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

* sysdeps/unix/sysv/linux/kernel-features.h: SPARC and IA64 also
Expand Down
17 changes: 13 additions & 4 deletions sysdeps/unix/sysv/linux/preadv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
#include <sys/syscall.h>
#include <kernel-features.h>

#ifdef __x86_64__
#define __NR_preadv 295
#elif defined __i386__
#define __NR_preadv 333
#endif


#ifndef PREADV
# define PREADV preadv
# define PREADV_REPLACEMENT __atomic_preadv_replacement
Expand All @@ -53,14 +60,16 @@ PREADV (fd, vector, count, offset)
ssize_t result;

if (SINGLE_THREAD_P)
result = INLINE_SYSCALL (preadv, 5, fd, vector, count, offset >> 32,
offset & 0xffffffff);
result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
(off_t) ((off64_t) offset >> 32),
(off_t) (offset & 0xffffffff));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();

result = INLINE_SYSCALL (preadv, 5, fd, vector, count, offset >> 32,
offset & 0xffffffff);
result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
(off_t) ((off64_t) offset >> 32),
(off_t) (offset & 0xffffffff));

LIBC_CANCEL_RESET (oldtype);
}
Expand Down
17 changes: 13 additions & 4 deletions sysdeps/unix/sysv/linux/pwritev.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
#include <sys/syscall.h>
#include <kernel-features.h>

#ifdef __x86_64__
#define __NR_pwritev 296
#elif defined __i386__
#define __NR_pwritev 334
#endif


#ifndef PWRITEV
# define PWRITEV pwritev
# define PWRITEV_REPLACEMENT __atomic_pwritev_replacement
Expand All @@ -53,14 +60,16 @@ PWRITEV (fd, vector, count, offset)
ssize_t result;

if (SINGLE_THREAD_P)
result = INLINE_SYSCALL (pwritev, 5, fd, vector, count, offset >> 32,
offset & 0xffffffff);
result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
(off_t) ((off64_t) offset >> 32),
(off_t) (offset & 0xffffffff));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();

result = INLINE_SYSCALL (pwritev, 5, fd, vector, count, offset >> 32,
offset & 0xffffffff);
result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
(off_t) ((off64_t) offset >> 32),
(off_t) (offset & 0xffffffff));

LIBC_CANCEL_RESET (oldtype);
}
Expand Down

0 comments on commit 24030b0

Please sign in to comment.