This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Return ENOSYS if __NR_fallocate is not defined


Hi

I was getting compilations errors with linux header 2.6.23 on arm because __NR_fallocate was undefined.  fallocate syscall was wired in 2.6.24 onwards on arm.  Attached patch fixes the compilation failure. 

Thanks

-Khem

ChangeLog

2009-03-28  Khem Raj  <raj.khem@gmail.com>

	* sysdeps/unix/sysv/linux/fallocate.c (fallocate) : Return ENOSYS if __NR_fallocate is not defined.
	* sysdeps/unix/sysv/linux/fallocate64.c (__fallocate64_l64): Likewise.

Index: libc/sysdeps/unix/sysv/linux/fallocate.c
===================================================================
--- libc/sysdeps/unix/sysv/linux/fallocate.c	(revision 8181)
+++ libc/sysdeps/unix/sysv/linux/fallocate.c	(working copy)
@@ -25,7 +25,12 @@
 int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
+#ifdef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR (offset >> 31, offset),
 			 __LONG_LONG_PAIR (len >> 31, len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }
Index: libc/sysdeps/unix/sysv/linux/fallocate64.c
===================================================================
--- libc/sysdeps/unix/sysv/linux/fallocate64.c	(revision 8181)
+++ libc/sysdeps/unix/sysv/linux/fallocate64.c	(working copy)
@@ -25,9 +25,14 @@
 int
 __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
+#ifdef __NR_fallocate
   return INLINE_SYSCALL (fallocate, 6, fd, mode,
 			 __LONG_LONG_PAIR ((long int) (offset >> 32),
 					   (long int) offset),
 			 __LONG_LONG_PAIR ((long int) (len >> 32),
 					   (long int) len));
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]