bug-gnulib
[Top][All Lists]
Advanced

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

Re: mmapping of /dev/zero always fails on darwin


From: Peter O'Gorman
Subject: Re: mmapping of /dev/zero always fails on darwin
Date: Tue, 13 Sep 2005 08:30:53 +0900
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

Derek Price wrote:


I don't suppose you could come up with a configure test or a short C
program that fails to compile (preferrably) or run (if necessary) to
spot this, short of actually switching on the system name or something
similar?

The test would have to be a run test, which would mean having a cross-compile alternative switching on the system name (this is why gcc switches on name).

Just doing the same thing as gnulib does will show the failure:

int main(){
        void * address = NULL;
        static int fd =-1;
        int ret = 0;
        fd = open ("/dev/zero",O_RDONLY,666);
ret = mmap (NULL, 4096, PROT_READ | PROT_WRITE, MAP_FILE | MAP_PRIVATE, fd, 0);
        if (ret != MAP_FAILED) return 0;
return 1;
}

Hope this helps,
Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]