summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perl.h4
-rw-r--r--perlio.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/perl.h b/perl.h
index 5fa0da3f3e..e7c0c5abe7 100644
--- a/perl.h
+++ b/perl.h
@@ -1180,6 +1180,10 @@ EXTERN_C char *crypt(const char *, const char *);
EXTERN_C char **environ;
#endif
+#if defined(__OpenBSD__) && defined(__cplusplus)
+EXTERN_C char **environ;
+#endif
+
#if defined(__CYGWIN__) && defined(__cplusplus)
EXTERN_C char *crypt(const char *, const char *);
#endif
diff --git a/perlio.c b/perlio.c
index 0b202de80b..2236c509ba 100644
--- a/perlio.c
+++ b/perlio.c
@@ -4627,7 +4627,7 @@ PerlIOMmap_map(pTHX_ PerlIO *f)
}
posn = (b->posn / PL_mmap_page_size) * PL_mmap_page_size;
len = st.st_size - posn;
- m->mptr = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, posn);
+ m->mptr = (Mmap_t)mmap(NULL, len, PROT_READ, MAP_SHARED, fd, posn);
if (m->mptr && m->mptr != (Mmap_t) - 1) {
#if 0 && defined(HAS_MADVISE) && defined(MADV_SEQUENTIAL)
madvise(m->mptr, len, MADV_SEQUENTIAL);