This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk 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]

linux.syscall.h vs errno


Hi,

On my fc6 machine I got some compilation errors since linux.syscall.h
includes linux/asm/unistd.h which defines _syscall with a macro that
uses errno. Since errno.h is never explicitly included this makes the
compile fail when these macros are used. The following adds a #include
<errno.h> to linux.syscall.h to make everything compile again.

2006-09-04  Mark Wielaard  <mark@klomp.org>

        * include/linux.syscall.h: include errno.h.

Also tested on fc5 (x86_64). But unfortunately on fc6 the testsuite is
still not in a good state and I did manage to lock up the kernel on that
machine again (2.6.17-1.2611.fc6) so I am not 100% sure it works
perfectly. Please yell and scream if it does break things in unexpected
ways.

Cheers,

Mark

diff -u -r1.3 linux.syscall.h
--- frysk-imports/include/linux.syscall.h       23 Jun 2006 20:59:00 -0000     1.3
+++ frysk-imports/include/linux.syscall.h       4 Sep 2006 13:03:03 -0000
@@ -37,8 +37,10 @@
 // version and license this file solely under the GPL without
 // exception.

-/* Declares __NR_*.  Moreover it might define _syscall2 and such, so it is
- * safer to make sure it gets included first. */
+/* linux/unistd.h declares __NR_*.  Moreover it might define _syscall2 and
+ * such, so it is safer to make sure it gets included first.  Might refer
+ * to errno variable, so better also include that. */
+#include <errno.h>
 #include <linux/unistd.h>

 /* Declares syscall() */



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