Hi.
(if the cross-post is considered harmful, a polite nudge
will make me stop :-)
I am developing an app under SuSE 7.1 at work, and discovered
that in order to get mmap(2) with MAP_ANON, I had to
#define __USE_MISC. (I peeked in
* Michael Fischer (michael@visv.net) [20021115 08:02]:
I am developing an app under SuSE 7.1 at work, and discovered that in order to get mmap(2) with MAP_ANON, I had to #define __USE_MISC. (I peeked in
)
That's the wrong way to do it, as you should never define __USE* directly. Look at /usr/include/features.h and you'll see the things you should define to get the __USE* defined. __USE_MISC is defined if you define either _BSD_SOURCE or _SVID_SOURCE.
but I wonder why glibc was not compiled (on linux) to have this (if that's the right way to phrase it).
The features of glibc are defined in differing standards and glibc allows
you to write code for specific environments by letting you controll what
gets defined/declared. And you use things outside the scope of standard C89,
you have to explicitely ask for it.
--
Philipp Thomas
On Fri, Nov 15, Philipp Thomas wrote:
* Michael Fischer (michael@visv.net) [20021115 08:02]:
I am developing an app under SuSE 7.1 at work, and discovered that in order to get mmap(2) with MAP_ANON, I had to #define __USE_MISC. (I peeked in
) That's the wrong way to do it, as you should never define __USE* directly. Look at /usr/include/features.h and you'll see the things you should define to get the __USE* defined.
__USE_MISC is defined if you define either _BSD_SOURCE or _SVID_SOURCE.
Ok, are there any peculiar surprises or "gotchas" associated with #define'ing either _BSD_SOURCE or _SVID_SOURCE on linux? TIA. Michael -- Michael Fischer Happiness is a config option. michael@visv.net Recompile and be happy.
participants (2)
-
Michael Fischer
-
Philipp Thomas