This is the mail archive of the
mailing list for the Cygwin project.
Re: Add PAGE_SIZE, PAGE_SHIFT, PAGE_MASK to sys/param.h
I was mulling over this definitions again and somehow I'm inclined to
refuse these definitons entirely.
I see, well I suppose that's ok.
First of all, you shouldn't use them in applications. Applications
should call getpagesize() or sysconf(_SC_PAGESIZE) to get the page
Second, if you use them in a Cygwin patch, I would refuse *that* patch
since in Cygwin you should also use getpagesize(). Or, even worse,
in some circumstances you need the allocation granularity which you
get by calling GetSystemInfo().
Well I accept your criticism. Some of this is new territory for me, so
thanks for taking the time to explain why you think it is wrong. I
guess it is back to the drawing board for me. Still, perhaps Brian's
suggestion has some merit?
So, the question is this: If you should never use these values in an
application and you should also not use them in Cygwin, why do we need
I think I can work around depending on them using the ways you suggested
and some other ways I've discoved while doing more research. I'll
rework the other stuff and resubmit a new patch.
Which brings up another matter, asm/socket.h. Can someone point me to
what source we should use when defining if ioctl macros in asm/socket.h.
Both bind and bsd seem to have very different definitions in terms of
the read/write capabilities of the ioctls...