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

Bug#901699: marked as done (libc6-dev: #include <sys/mman.h> doesn't import MAP_ANONYMOUS but man 2 mmap says it does, causing builds to break)



Your message dated Sun, 17 Jun 2018 10:06:55 +0200
with message-id <20180617080655.t5pmguez2u4ig7nj@var.youpi.perso.aquilenet.fr>
and subject line Re: Bug#901699: libc6-dev: #include <sys/mman.h> doesn't import MAP_ANONYMOUS but man 2 mmap says it does, causing builds to break
has caused the Debian Bug report #901699,
regarding libc6-dev: #include <sys/mman.h> doesn't import MAP_ANONYMOUS but man 2 mmap says it does, causing builds to break
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
901699: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901699
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6-dev
Version: 2.24-11+deb9u1
Severity: normal

Dear Maintainer,

#include <sys/mman.h>
#include "myplatform.h"

void *slaballoc()
{
    void *slab = mmap(... MAP_ANONYMOUS ...);
}

does not build due to MAP_ANONYMOUS not being defined. man 2 mmap says this should work.

#include <asm/mman.h>

fixes the problem but is oddly Linux specific. Use of mmap to allocate large slabs w/o using heap is reasonable on any architecture.

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6-dev depends on:
ii  libc-dev-bin    2.24-11+deb9u1
ii  libc6           2.24-11+deb9u1
ii  linux-libc-dev  4.9.82-1+deb9u3

libc6-dev recommends no packages.

Versions of packages libc6-dev suggests:
pn  glibc-doc     <none>
ii  manpages-dev  4.10-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Hello,

Joshua, le sam. 16 juin 2018 16:22:10 -0700, a ecrit:
> #include <sys/mman.h>
> #include "myplatform.h"
> 
> void *slaballoc()
> {
>     void *slab = mmap(... MAP_ANONYMOUS ...);
> }
> 
> does not build due to MAP_ANONYMOUS not being defined.

That kind of code does build :) (but only because by defaut gcc defines
_GNU_SOURCE)

Note that MAP_ANONYMOUS and MAP_ANON are not POSIX, so you have to use
e.g. #define _GNU_SOURCE or _BSD_SOURCE to get access to them.

> man 2 mmap says this should work.

It also says “Certain flags constants are defined only if suitable
feature test macros are defined”

Samuel

--- End Message ---

Reply to: