pkgsrc/audio/libmpg123/patches/patch-ad
bjs 146eaf55b5 Import libmpg123-1.5.1. This package provides the mpg123 project's
core decoder library, which the new mpg123 package will depend on.
Other software packages are beginning to write plug-ins for this
library, and so installing it seperately is worthwhile.

NOTE: I have encountered segfaults when attempting to use the jack
module, which is threaded, with mpg123 unless I linked mpg123 with
libpthread.  This may or may not apply to the library, though my
intuition is that it does not, as obviously the executable is
what calls lt_dlopen().  Thus, for now the Makefile and b3.mk of the
executable will pull in dlopen.buildlink3.mk, setting
DLOPEN_REQUIRE_PTHREADS=yes as necessary (last time I checked on
NetBSD 4.99, it was).
2008-09-07 00:56:15 +00:00

33 lines
1.1 KiB
Text

$NetBSD: patch-ad,v 1.1.1.1 2008/09/07 00:56:15 bjs Exp $
--- src/xfermem.c.orig 2008-08-29 02:43:56.000000000 -0400
+++ src/xfermem.c
@@ -37,6 +37,13 @@ void xfermem_init (txfermem **xf, size_t
#ifdef HAVE_MMAP
# ifdef MAP_ANON
+
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
+ if(madvise((void *)xf, (regsize - sizeof(txfermem)),
+ MADV_SEQUENTIAL) < 0)
+ fprintf(stderr,"madvise failed, continuing anyway...\n");
+#endif
+
if ((*xf = (txfermem *) mmap(0, regsize, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0)) == (txfermem *) -1) {
perror ("mmap()");
@@ -92,7 +99,13 @@ void xfermem_done (txfermem *xf)
if(!xf)
return;
#ifdef HAVE_MMAP
- munmap ((caddr_t) xf, xf->size + xf->metasize + sizeof(txfermem));
+ munmap ((void *) xf, xf->size + xf->metasize + sizeof(txfermem));
+
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
+ if(madvise((void *)xf, (xf->size + xf->metasize), MADV_FREE) < 0)
+ fprintf(stderr,"madvise failed, continuing anyways..\n");
+#endif
+
#else
if (shmdt((void *) xf) == -1) {
perror ("shmdt()");