On Fri, Feb 12, 2010 at 11:27:35AM +0300, Vadim Zhukov wrote: > > > > > > Maybe it's better to say that this is not treated as error too? See > > > the patch at the end of this letter. > > > > i don;t know this stuff. but why would you expect an error in this > > case? if we are saying that if len is 0, then this happens, why do > > we need to say it doesn;t generate an error? > > For example, another memory management function manual page, malloc(3), > explicitly specifies that it's not an error to specify zero in "size" > parameter. >
can you quote me the bit of text? i cannot immediately see it. > Such declaration make saves time from test compilation that proves "it's > not an error". I think this is job for manual - avoiding such testing. > my point is that if we say that if len is 0 then no action is taken, it is implicit that it is not an error to do so. so again i'm asking, is it important to do so? could someone reading that page really think well, no action is taken, but will it cause an error? > > so, how important is it? > > > > > Index: mprotect.2 > > > =================================================================== > > > RCS file: /cvs/src/lib/libc/sys/mprotect.2,v > > > retrieving revision 1.14 > > > diff -u -p -r1.14 mprotect.2 > > > --- mprotect.2 31 May 2007 19:19:33 -0000 1.14 > > > +++ mprotect.2 12 Feb 2010 07:55:38 -0000 > > > @@ -53,10 +53,11 @@ through > > > .Fa len > > > \- 1 > > > (inclusive). > > > -If > > > -.Fa len > > > -is 0, then action will be taken on the page that contains > > > -.Fa addr . > > > +It is not an error to specify 0 as > > > +.Fa len , > > > +but no action will be taken on the page that contains > > > +.Fa addr > > > +then . > > > .Pp > > > Not all implementations will guarantee protection on a page basis; > > > the granularity of protection changes may be as large as an entire > > > region. > > > > this wording is not great. but i won;t suggest anything else until you > > or someone answers the point above. > > Sorry, I'm not even close to be called native English speaker. :( > assuming we must say it, i suggest: It is not an error if .Fa len is 0, though no action will be taken on the page that contains .Fa addr . jmc