Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error: sys/mman.h: No such file or directory #49

Closed
ghost opened this issue Nov 7, 2015 · 3 comments
Closed

compilation error: sys/mman.h: No such file or directory #49

ghost opened this issue Nov 7, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 7, 2015

Did not found mman.h on x86-64 (Ubuntu GNOME) because the sys folder doesn't exist.
I replaced sys with linux and everything is working now:

libc6-dev-i386: /usr/include/sys/mman.h

linux-libc-dev: /usr/include/linux/mman.h
@erikd
Copy link
Member

erikd commented Nov 8, 2015

I would consider this an Ubuntu (and possibly even a Debian) bug.

According to the msync man page:

SYNOPSIS
       #include <sys/mman.h>

       int msync(void *addr, size_t length, int flags);
.....

CONFORMING TO
       POSIX.1-2001.

If its conforming to a POSIX spec, it should not be under /usr/include/linux and it should be in the location specified by the man page.

In your particular instance, I would just install the libc6-dev-i386 package.

I'm pretty sure you need to install the libc6-dev package which installs the sys/mman.h file at
/usr/include/x86_64-linux-gnu/sys/mman.h. GCC will automatically find this file because /usr/include/x86_64-linux-gnu/ is on the default search path.

@erikd
Copy link
Member

erikd commented Nov 9, 2015

Ok, to close this? Installing the libc6-dev package should fix it.

@ghost
Copy link
Author

ghost commented Nov 9, 2015

You're right!

libc6-dev: /usr/include/x86_64-linux-gnu/sys/mman.h

The file was missing on my system. sudo apt-get install --reinstall libc6-dev solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants