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

Bug#539742: apt: FTBFS on GNU/kFreeBSD (due to mremap)



Package: apt
Severity: important
Version: 0.7.22
Tags: patch
User: glibc-bsd-devel@lists.alioth.debian.org
Usertags: kfreebsd

Hi,

the current version fails to build on GNU/kFreeBSD.

From "man mremap":
"This call is Linux-specific, and should not be used in programs intended to be portable."

Please guard usage of mremap() as shown bellow.
The MREMAP_* defines are available only on Linux architectures,
they can serve as signal of mremap() availability.

Thanks in advance

                        Petr

--- apt-pkg/contrib/mmap.cc
+++ apt-pkg/contrib/mmap.cc
@@ -317,7 +317,7 @@
    but why we should not at least try to grow it before we give up? */
 bool DynamicMMap::Grow()
 {
-#ifdef _POSIX_MAPPED_FILES
+#if defined(_POSIX_MAPPED_FILES) && defined(MREMAP_MAYMOVE) && defined(MREMAP_FIXED)
    unsigned long newSize = WorkSpace + 1024*1024;

    if(Fd != 0)




Reply to: