Patchwork [libbacktrace] Fix build on hpux10

login
register
mail settings
Submitter John David Anglin
Date Dec. 9, 2012, 6:49 p.m.
Message ID <20121209184914.GA20230@hiauly1.hia.nrc.ca>
Download mbox | patch
Permalink /patch/204771/
State New
Headers show

Comments

John David Anglin - Dec. 9, 2012, 6:49 p.m.
HP-UX 10 doesn't define MAP_FAILED.  Patch fixes build.  Tested on
hppa1.1-hp-hpux10.20 and hppa2.0w-hp-hpux11.11.

OK for trunk?

Dave
Ian Taylor - Dec. 12, 2012, 1:52 a.m.
On Sun, Dec 9, 2012 at 10:49 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>
> 2012-12-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
>
>         * mmapio.c: Define MAP_FAILED if not defined.

This is OK.

Thanks.

Ian

Patch

Index: mmapio.c
===================================================================
--- mmapio.c	(revision 194272)
+++ mmapio.c	(working copy)
@@ -40,6 +40,10 @@ 
 #include "backtrace.h"
 #include "internal.h"
 
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
 /* This file implements file views and memory allocation when mmap is
    available.  */