* _syscall2 vs MAX_ERRNO
@ 2007-01-23 11:51 Mark Wielaard
2007-01-23 14:38 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2007-01-23 11:51 UTC (permalink / raw)
To: frysk
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
Hi,
On new (FC6) x86_64 (2.6.19 kernel) systems when you try to import
linux/unistd.h to get a definition of _syscall2 it is defined in terms
that use MAX_ERRNO. Unfortunately this constant isn't anywhere defined
in a user visible header as far as I can tell. So for now I have
installed the following patch to get things compiling again.
2007-01-23 Mark Wielaard <mark@klomp.org>
* include/linux.syscall.h: Define MAX_ERRNO if not yet defined.
Hints and tips for a real solution appreciated.
Cheers,
Mark
[-- Attachment #2: Type: text/x-patch, Size: 666 bytes --]
? max_errno.patch
Index: include/linux.syscall.h
===================================================================
RCS file: /cvs/frysk/frysk-imports/include/linux.syscall.h,v
retrieving revision 1.4
diff -u -r1.4 linux.syscall.h
--- include/linux.syscall.h 4 Sep 2006 13:06:57 -0000 1.4
+++ include/linux.syscall.h 23 Jan 2007 11:42:30 -0000
@@ -43,6 +43,13 @@
#include <errno.h>
#include <linux/unistd.h>
+/* If linux/unistd.h defines _syscall2 then it might refer to MAX_ERRNO
+ * which might not be defined anywhere (at least it does so on x86_64).
+ */
+#ifndef MAX_ERRNO
+#define MAX_ERRNO 4095
+#endif
+
/* Declares syscall() */
#include <unistd.h>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: _syscall2 vs MAX_ERRNO
2007-01-23 11:51 _syscall2 vs MAX_ERRNO Mark Wielaard
@ 2007-01-23 14:38 ` Andrew Cagney
2007-01-23 18:17 ` Roland McGrath
2007-01-24 11:28 ` Mark Wielaard
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Cagney @ 2007-01-23 14:38 UTC (permalink / raw)
To: Mark Wielaard; +Cc: frysk
Mark,
This gets weird. The syscall macros were removed which is why
include/linux.syscall.h contains simple versions. Sounds like they are
back!?! The tkill man page, on fc6, notes:
_syscall2(int, tkill, int, tid, int, sig)
/* Using syscall(2) may be preferable; see intro(2) */
from you're notes, this doesn't work. I'd file a bug both with frysk
and with the relevant distro. Otherwize, yea, that file is a kludge anyway.
Andrew
Mark Wielaard wrote:
> Hi,
>
> On new (FC6) x86_64 (2.6.19 kernel) systems when you try to import
> linux/unistd.h to get a definition of _syscall2 it is defined in terms
> that use MAX_ERRNO. Unfortunately this constant isn't anywhere defined
> in a user visible header as far as I can tell. So for now I have
> installed the following patch to get things compiling again.
>
> 2007-01-23 Mark Wielaard <mark@klomp.org>
>
> * include/linux.syscall.h: Define MAX_ERRNO if not yet defined.
>
> Hints and tips for a real solution appreciated.
>
> Cheers,
>
> Mark
>
> ------------------------------------------------------------------------
>
> ? max_errno.patch
> Index: include/linux.syscall.h
> ===================================================================
> RCS file: /cvs/frysk/frysk-imports/include/linux.syscall.h,v
> retrieving revision 1.4
> diff -u -r1.4 linux.syscall.h
> --- include/linux.syscall.h 4 Sep 2006 13:06:57 -0000 1.4
> +++ include/linux.syscall.h 23 Jan 2007 11:42:30 -0000
> @@ -43,6 +43,13 @@
> #include <errno.h>
> #include <linux/unistd.h>
>
> +/* If linux/unistd.h defines _syscall2 then it might refer to MAX_ERRNO
> + * which might not be defined anywhere (at least it does so on x86_64).
> + */
> +#ifndef MAX_ERRNO
> +#define MAX_ERRNO 4095
> +#endif
> +
> /* Declares syscall() */
> #include <unistd.h>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: _syscall2 vs MAX_ERRNO
2007-01-23 14:38 ` Andrew Cagney
@ 2007-01-23 18:17 ` Roland McGrath
2007-01-24 11:28 ` Mark Wielaard
1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2007-01-23 18:17 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Mark Wielaard, frysk
Don't use those macros. Use the syscall function.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: _syscall2 vs MAX_ERRNO
2007-01-23 14:38 ` Andrew Cagney
2007-01-23 18:17 ` Roland McGrath
@ 2007-01-24 11:28 ` Mark Wielaard
1 sibling, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2007-01-24 11:28 UTC (permalink / raw)
To: Andrew Cagney; +Cc: frysk
On Tue, 2007-01-23 at 09:38 -0500, Andrew Cagney wrote:
> Mark,
>
> This gets weird. The syscall macros were removed which is why
> include/linux.syscall.h contains simple versions. Sounds like they are
> back!?! The tkill man page, on fc6, notes:
>
> _syscall2(int, tkill, int, tid, int, sig)
> /* Using syscall(2) may be preferable; see intro(2) */
>
> from you're notes, this doesn't work. I'd file a bug both with frysk
> and with the relevant distro. Otherwize, yea, that file is a kludge anyway.
This is now frysk bug #3912. And upstream
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224130
Cheers,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-01-24 11:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 11:51 _syscall2 vs MAX_ERRNO Mark Wielaard
2007-01-23 14:38 ` Andrew Cagney
2007-01-23 18:17 ` Roland McGrath
2007-01-24 11:28 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).