On Fri, Nov 15, Jesse Marlin wrote:
Michael Fischer writes:
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 <bits/types.h>)
I compiled this program fine on a SuSE 7.2 box. The sys/mman.h header looks like it pulls in bits/mman.h where it is defined on my box. They appear to be mapped like any of the other flags. Maybe the headers have been fixed/changed since then.
#include <unistd.h> #include <sys/mman.h>
int main (int argc, char **argv) { void *start; mmap (start, 512, PROT_READ, MAP_ANON, 2, 0); return 0; }
Interesting, I tried it at home (SuSE 8.0) and it does indeed do just fine... hmm. I suppose I'll have to take Phillip Thomas' advice, and test for defined'ness of certain values, and #define _{BSD,SVID}_SOURCE accordingly. Thanks. Michael -- Michael Fischer Happiness is a config option. michael@visv.net Recompile and be happy.