mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
Fix building on x86 with older kernel headers.
Fix building on x86 when older linux headers lack __NR_fallocate define.
This commit is contained in:
parent
5ec794b4b5
commit
f9a7bd536e
@ -16,6 +16,7 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
|
|||||||
int
|
int
|
||||||
fallocate (int fd, int mode, __off_t offset, __off_t len)
|
fallocate (int fd, int mode, __off_t offset, __off_t len)
|
||||||
{
|
{
|
||||||
|
#ifdef __NR_fallocate
|
||||||
return __call_fallocate (fd, mode, offset, len);
|
return __call_fallocate (fd, mode, offset, len);
|
||||||
|
#else
|
||||||
|
__set_errno (ENOSYS);
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
|
||||||
@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
|
|||||||
int
|
int
|
||||||
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
|
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
|
||||||
{
|
{
|
||||||
|
#ifdef __NR_fallocate
|
||||||
return __call_fallocate (fd, mode, offset, len);
|
return __call_fallocate (fd, mode, offset, len);
|
||||||
|
#else
|
||||||
|
__set_errno (ENOSYS);
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user