Add PAGE_SIZE, PAGE_SHIFT, PAGE_MASK to sys/param.h

Nicholas Wourms nwourms@netscape.net
Thu Oct 30 00:02:00 GMT 2003


cygwin-patches@cygwin.com wrote:

[SNIP]
> 
> 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
> size. 
> 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
> them? 

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...

Cheers,
Nicholas



More information about the Cygwin-patches mailing list