Cleanup sync_file_range implementation

Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups
the mips code to assume __NR_sync_file_range and the powerpc one
to either assume __NR_sync_file_range2 or __NR_sync_file_range.

Checked on powerpc64le and build for mips (ABIO32, ABIN32, and ABI64).

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
	(__NR_sync_file_range2): Assume it is always defined.
	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
	(__NR_sync_file_range): Assume it is always defined.
This commit is contained in:
Adhemerval Zanella 2015-10-19 18:14:39 -02:00
parent 751709fec9
commit c2c904ffd3
3 changed files with 7 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2015-10-22 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
(__NR_sync_file_range2): Assume it is always defined.
* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
(__NR_sync_file_range): Assume it is always defined.
2015-10-22 Andreas Schwab <schwab@suse.de>
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Use

View File

@ -23,8 +23,6 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
#ifdef __NR_sync_file_range
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
@ -33,12 +31,3 @@ sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
__LONG_LONG_PAIR ((long) (to >> 32), (long) to),
flags);
}
#else
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (sync_file_range)
#endif

View File

@ -23,19 +23,8 @@
#include <sysdep-cancel.h>
#include <sys/syscall.h>
#if defined __NR_sync_file_range2
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to);
}
#else
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (sync_file_range)
#endif