Bug 224130

Summary: unistd.h defines _syscall macros using undefined MAX_ERRNO
Product: [Fedora] Fedora Reporter: Mark Wielaard <mjw>
Component: kernelAssignee: David Woodhouse <dwmw2>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: cebbert, davej, jonstanley, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-08 04:28:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 427887    

Description Mark Wielaard 2007-01-24 11:04:55 UTC
Description of problem:

/usr/include/asm-x86_64/unistd.h defines the _syscall6 macros using
__syscall_return which is defined as follows:

#define __syscall_return(type, res) \
do { \
        if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \
                errno = -(res); \
                res = -1; \
        } \
        return (type) (res); \
} while (0)

MAX_ERRNO is not defined, nor is there any definition found in any other public
header. This means that programs that have to use the _syscall macros directly
because they cannot use the glibc syscall() function now cannot compile anymore
unless they define MAX_ERRNO themselves (looking at the kernel sources it seems
the correct definition on x86_64 is 4095, which was also the value used pre 2.6.19).

Version-Release number of selected component (if applicable):

Name   : kernel-headers
Arch   : x86_64
Version: 2.6.19
Release: 1.2895.fc6

Comment 1 Pete Zaitcev 2007-01-24 16:37:17 UTC
You must not include anything from asm/ or linux/ into a user mode program.

You can use the definition as a basis to write your own.

Comment 2 Mark Wielaard 2007-01-24 19:44:55 UTC
This is related to this upstream Frysk bug btw:
http://sourceware.org/bugzilla/show_bug.cgi?id=3912

Comment 3 David Woodhouse 2007-02-03 21:29:33 UTC
The bogus _syscallX macros were removed from the 2.6.18 kernel but the x86_64
maintainer sneaked them back in to 2.6.19. We should remove them again -- they
are removed again from upstream.

Comment 4 Jon Stanley 2008-01-08 01:50:10 UTC
(This is a mass-update to all current FC6 kernel bugs in NEW state)

Hello,

I'm reviewing this bug list as part of the kernel bug triage project, an attempt
to isolate current bugs in the Fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

I am CC'ing myself to this bug, however this version of Fedora is no longer
maintained.

Please attempt to reproduce this bug with a current version of Fedora (presently
Fedora 8). If the bug no longer exists, please close the bug or I'll do so in a
few days if there is no further information lodged.

Thanks for using Fedora!

Comment 5 Jon Stanley 2008-02-08 04:28:24 UTC
Per the previous comment in this bug, I am closing it as INSUFFICIENT_DATA,
since no information has been lodged for over 30 days.

Please re-open this bug or file a new one if you can provide the requested data,
and thanks for filing the original report!