pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/fdm fdm: Adjust mremap(2) usage on NetBSD



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1d064bcb9a17
branches:  trunk
changeset: 331404:1d064bcb9a17
user:      leot <leot%pkgsrc.org@localhost>
date:      Mon Mar 18 10:53:40 2019 +0000

description:
fdm: Adjust mremap(2) usage on NetBSD

MREMAP_MAYMOVE flag is the default behaviour on NetBSD and by
adjusting the single mremap() call it can be used on NetBSD too
(remove CONFIGURE_ENV injection kludge).

Thanks to <joerg> and <kamil> respectively for kindly pointing out
that and suggestions! (possible regressions are mine!)

diffstat:

 mail/fdm/Makefile                 |   7 ++-----
 mail/fdm/distinfo                 |   3 ++-
 mail/fdm/patches/patch-shm-mmap.c |  18 ++++++++++++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r 9d64dc62b894 -r 1d064bcb9a17 mail/fdm/Makefile
--- a/mail/fdm/Makefile Mon Mar 18 09:11:43 2019 +0000
+++ b/mail/fdm/Makefile Mon Mar 18 10:53:40 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.13 2019/03/17 21:33:03 leot Exp $
+# $NetBSD: Makefile,v 1.14 2019/03/18 10:53:40 leot Exp $
 
 DISTNAME=      fdm-2.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=nicm/}
 
@@ -17,9 +17,6 @@
 EGDIR=                 ${PREFIX}/share/examples/fdm
 DOCDIR=                        ${PREFIX}/share/doc/fdm
 
-# Avoid mremap(2) due flags not available on NetBSD
-CONFIGURE_ENV.NetBSD+= ac_cv_func_mremap=no    
-
 CFLAGS.NetBSD+=                -D_OPENBSD_SOURCE       # needed for strtonum(3)
 
 .include "options.mk"
diff -r 9d64dc62b894 -r 1d064bcb9a17 mail/fdm/distinfo
--- a/mail/fdm/distinfo Mon Mar 18 09:11:43 2019 +0000
+++ b/mail/fdm/distinfo Mon Mar 18 10:53:40 2019 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.11 2019/02/13 11:08:02 leot Exp $
+$NetBSD: distinfo,v 1.12 2019/03/18 10:53:40 leot Exp $
 
 SHA1 (fdm-2.0.tar.gz) = 4da70cca5791457489d9e0a018706a6696609eab
 RMD160 (fdm-2.0.tar.gz) = b07dc4ee0b8de3362177d74bd935d1ae4dad961d
 SHA512 (fdm-2.0.tar.gz) = 9c321dfd200af7b7d396524a43a3ac4b569cddda0a2096122b935e9d7bdb8101f269341fae5bbd4ad8a2947312774da2d49e03eddc67c6ecbce4e1ff9488ebe2
 Size (fdm-2.0.tar.gz) = 180662 bytes
 SHA1 (patch-Makefile.am) = 2169ebc8e7c920cdf8492ee2039b410f5a6e358c
+SHA1 (patch-shm-mmap.c) = d6d961768b60e9174350dc7c6439c2d0be10ae1a
diff -r 9d64dc62b894 -r 1d064bcb9a17 mail/fdm/patches/patch-shm-mmap.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/fdm/patches/patch-shm-mmap.c Mon Mar 18 10:53:40 2019 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-shm-mmap.c,v 1.1 2019/03/18 10:53:41 leot Exp $
+
+Adjust mremap(2) usage for NetBSD.
+
+--- shm-mmap.c.orig    2019-02-12 22:08:26.000000000 +0000
++++ shm-mmap.c
+@@ -218,7 +218,11 @@ shm_resize(struct shm *shm, size_t nmemb
+               return (NULL);
+ 
+ #ifdef HAVE_MREMAP
++#if defined(__NetBSD__)
++      shm->data = mremap(shm->data, shm->size, NULL, newsize, 0);
++#else
+       shm->data = mremap(shm->data, shm->size, newsize, MREMAP_MAYMOVE);
++#endif
+ #else
+       shm->data = mmap(NULL, newsize, SHM_PROT, SHM_FLAGS, shm->fd, 0);
+ #endif



Home | Main Index | Thread Index | Old Index