Bug 201

Summary: Building openssh from CVS fails on AIX 4.2.1
Product: Portable OpenSSH Reporter: Darren Tucker <dtucker>
Component: sshdAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: -current   
Hardware: PPC   
OS: AIX   
Attachments:
Description Flags
Does this patch help? none

Description Darren Tucker 2002-04-03 12:18:13 AEST
While compiling from CVS, monitor_mm.c on AIX 4.2.1, gcc gives the following 
error:

monitor_mm.c: In function `mm_create':
monitor_mm.c:87: `MAP_FAILED' undeclared (first use in this function)
monitor_mm.c:87: (Each undeclared identifier is reported only once
monitor_mm.c:87: for each function it appears in.)
make: *** [monitor_mm.o] Error 1

This does not occur on AIX 4.3.3, where /usr/include/sys/mman.h contains 
"#define MAP_FAILED ((void *)-1)". Adding this #define to monitor_mm.c allows it 
to compile and run. I'm not sure what the proper fix is.

AIX 4.2.1 is no longer supported by IBM but some boxes are still running it.
Comment 1 Ben Lindstrom 2002-04-06 02:21:56 AEST
Created attachment 62 [details]
Does this patch help?
Comment 2 Ben Lindstrom 2002-04-06 02:23:42 AEST
FYI.. I'd like to avoid adding more to the current include.h, defines.h, etc.  
We were in the middle of a proposed rewrite to simplify the header hell that is 
plaguing us. 

If no other platforms require this, then I think we should fix it for AIX only 
and then come back to it after the header header rewrites.

- Ben
Comment 3 Darren Cole 2002-04-06 05:44:09 AEST
This breaks on HP-UX 10.26 also.  If I defined MAP_FAILED as in the attachment
for this bug I can complie HP-UX (took some info to get it to compile from bug
<http://bugzilla.mindrot.org/show_bug.cgi?id=184>)
Comment 4 Ben Lindstrom 2002-04-06 08:39:17 AEST
If we move it into (at the bottom) of includes.h will that solve it for both 
platforms?  If so I'll just handle it that way and we will have to ensure to 
remember it when we finish up the header cleanup.

- Ben
Comment 5 Darren Tucker 2002-04-06 11:05:27 AEST
Attached patch (#61) fixes the compile error on AIX 4.2.1. Putting the same 
#define at the bottom of includes.h instead also works.
Comment 6 Ben Lindstrom 2002-04-06 14:12:08 AEST
Commited to CVS tree.
Comment 7 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED