Re: remove redundant information from mmap.2

2012-10-17 Thread Otto Moerbeek
On Wed, Oct 17, 2012 at 03:14:14PM +0100, Jason McIntyre wrote:

> On Wed, Oct 17, 2012 at 09:06:23AM +0200, Otto Moerbeek wrote:
> > 
> > Op 16 okt. 2012 om 22:56 heeft Jason McIntyre  het 
> > volgende geschreven:
> > 
> > > On Sat, Oct 06, 2012 at 09:40:23PM +0200, Dawe wrote:
> > >> I think this information is already given in the sentences before.
> > >> 
> > >> Index: mmap.2
> > >> ===
> > >> RCS file: /cvs/src/lib/libc/sys/mmap.2,v
> > >> retrieving revision 1.39
> > >> diff -u -p -u -p -r1.39 mmap.2
> > >> --- mmap.212 Apr 2012 12:53:27 -1.39
> > >> +++ mmap.26 Oct 2012 19:35:32 -
> > >> @@ -188,10 +188,6 @@ The symbol
> > >> .Dv MAP_FAILED
> > >> is defined in the header
> > >> .Ao Pa sys/mman.h Ac .
> > >> -No successful return from
> > >> -.Fn mmap
> > >> -will return the value
> > >> -.Dv MAP_FAILED .
> > >> .Sh ERRORS
> > >> .Fn mmap
> > >> will fail if:
> > >> 
> > > 
> > > philip guenther replied to this:
> > > 
> > >No, it isn't.  The previous sentences say that MAP_FAILED
> > >is returned on error; this one says that MAP_FAILED is
> > >*only* returned on error.  Contrast this to strtoul(), where
> > >ULONG_MAX is returned on error, but can also be returned
> > >on success, meaning you have to do extra steps (clear errno
> > >before, test it afterwards) to detect failure.  This sentence
> > >is the one that makes it clear that that isn't the case
> > >with mmap().
> > > 
> > > i have to say, i didn;t get that. after discussing it a bit i've come to
> > > see there is an ambiguity in the sentence being proposed for removal - it
> > > can be read two ways.
> > 
> > Wondering which two ways. I can only see one. It must be either lack of 
> > coffee or too much exposure to formal logic.
> > 
> > That said, I like your diff.
> > 
> >  -Otto
> > 
> 
> well, i spent a few days arguing with guenther before i saw it. so i'd
> say it's subtle ;) the sentence in question is this:
> 
>   No successful return from mmap will return the value MAP_FAILED.
> 
> what it's trying to say is that "under no cicumstances will a successful
> mmap return MAP_FAILED". however i (and the original poster, i presume)
> read it as "an unsuccessful return from mmap will return MAP_FAILED".
> 
> since the latter had already been said, we supposed it to be
> duplication. i'd have zapped it if guenther hadn;t spotted the true
> intent.
> 
> jmc

aha, now that is cleared up I'm even more in favor of your diff.

-Otto



Re: remove redundant information from mmap.2

2012-10-17 Thread Jason McIntyre
On Wed, Oct 17, 2012 at 09:06:23AM +0200, Otto Moerbeek wrote:
> 
> Op 16 okt. 2012 om 22:56 heeft Jason McIntyre  het 
> volgende geschreven:
> 
> > On Sat, Oct 06, 2012 at 09:40:23PM +0200, Dawe wrote:
> >> I think this information is already given in the sentences before.
> >> 
> >> Index: mmap.2
> >> ===
> >> RCS file: /cvs/src/lib/libc/sys/mmap.2,v
> >> retrieving revision 1.39
> >> diff -u -p -u -p -r1.39 mmap.2
> >> --- mmap.212 Apr 2012 12:53:27 -1.39
> >> +++ mmap.26 Oct 2012 19:35:32 -
> >> @@ -188,10 +188,6 @@ The symbol
> >> .Dv MAP_FAILED
> >> is defined in the header
> >> .Ao Pa sys/mman.h Ac .
> >> -No successful return from
> >> -.Fn mmap
> >> -will return the value
> >> -.Dv MAP_FAILED .
> >> .Sh ERRORS
> >> .Fn mmap
> >> will fail if:
> >> 
> > 
> > philip guenther replied to this:
> > 
> >No, it isn't.  The previous sentences say that MAP_FAILED
> >is returned on error; this one says that MAP_FAILED is
> >*only* returned on error.  Contrast this to strtoul(), where
> >ULONG_MAX is returned on error, but can also be returned
> >on success, meaning you have to do extra steps (clear errno
> >before, test it afterwards) to detect failure.  This sentence
> >is the one that makes it clear that that isn't the case
> >with mmap().
> > 
> > i have to say, i didn;t get that. after discussing it a bit i've come to
> > see there is an ambiguity in the sentence being proposed for removal - it
> > can be read two ways.
> 
> Wondering which two ways. I can only see one. It must be either lack of 
> coffee or too much exposure to formal logic.
> 
> That said, I like your diff.
> 
>  -Otto
> 

well, i spent a few days arguing with guenther before i saw it. so i'd
say it's subtle ;) the sentence in question is this:

No successful return from mmap will return the value MAP_FAILED.

what it's trying to say is that "under no cicumstances will a successful
mmap return MAP_FAILED". however i (and the original poster, i presume)
read it as "an unsuccessful return from mmap will return MAP_FAILED".

since the latter had already been said, we supposed it to be
duplication. i'd have zapped it if guenther hadn;t spotted the true
intent.

jmc



Re: remove redundant information from mmap.2

2012-10-17 Thread Otto Moerbeek
Op 16 okt. 2012 om 22:56 heeft Jason McIntyre  het volgende
geschreven:

> On Sat, Oct 06, 2012 at 09:40:23PM +0200, Dawe wrote:
>> I think this information is already given in the sentences before.
>>
>> Index: mmap.2
>> ===
>> RCS file: /cvs/src/lib/libc/sys/mmap.2,v
>> retrieving revision 1.39
>> diff -u -p -u -p -r1.39 mmap.2
>> --- mmap.212 Apr 2012 12:53:27 -1.39
>> +++ mmap.26 Oct 2012 19:35:32 -
>> @@ -188,10 +188,6 @@ The symbol
>> .Dv MAP_FAILED
>> is defined in the header
>> .Ao Pa sys/mman.h Ac .
>> -No successful return from
>> -.Fn mmap
>> -will return the value
>> -.Dv MAP_FAILED .
>> .Sh ERRORS
>> .Fn mmap
>> will fail if:
>>
>
> philip guenther replied to this:
>
>No, it isn't.  The previous sentences say that MAP_FAILED
>is returned on error; this one says that MAP_FAILED is
>*only* returned on error.  Contrast this to strtoul(), where
>ULONG_MAX is returned on error, but can also be returned
>on success, meaning you have to do extra steps (clear errno
>before, test it afterwards) to detect failure.  This sentence
>is the one that makes it clear that that isn't the case
>with mmap().
>
> i have to say, i didn;t get that. after discussing it a bit i've come to
> see there is an ambiguity in the sentence being proposed for removal - it
> can be read two ways.

Wondering which two ways. I can only see one. It must be either lack of coffee
or too much exposure to formal logic.

That said, I like your diff.

 -Otto

>
> with that in mind i propose to commit the diff below very shortly.
> (the Fn -> Nm is just by the by)
>
> jmc
>
> Index: mmap.2
> ===
> RCS file: /cvs/src/lib/libc/sys/mmap.2,v
> retrieving revision 1.39
> diff -u -r1.39 mmap.2
> --- mmap.212 Apr 2012 12:53:27 -1.39
> +++ mmap.216 Oct 2012 20:55:08 -
> @@ -188,12 +188,12 @@
> .Dv MAP_FAILED
> is defined in the header
> .Ao Pa sys/mman.h Ac .
> -No successful return from
> -.Fn mmap
> -will return the value
> +A successful return from
> +.Nm
> +will never return the value
> .Dv MAP_FAILED .
> .Sh ERRORS
> -.Fn mmap
> +.Nm
> will fail if:
> .Bl -tag -width Er
> .It Bq Er EACCES



Re: remove redundant information from mmap.2

2012-10-16 Thread Jason McIntyre
On Sat, Oct 06, 2012 at 09:40:23PM +0200, Dawe wrote:
> I think this information is already given in the sentences before.
> 
> Index: mmap.2
> ===
> RCS file: /cvs/src/lib/libc/sys/mmap.2,v
> retrieving revision 1.39
> diff -u -p -u -p -r1.39 mmap.2
> --- mmap.212 Apr 2012 12:53:27 -  1.39
> +++ mmap.26 Oct 2012 19:35:32 -
> @@ -188,10 +188,6 @@ The symbol
>  .Dv MAP_FAILED
>  is defined in the header
>  .Ao Pa sys/mman.h Ac .
> -No successful return from
> -.Fn mmap
> -will return the value
> -.Dv MAP_FAILED .
>  .Sh ERRORS
>  .Fn mmap
>  will fail if:
> 

philip guenther replied to this:

No, it isn't.  The previous sentences say that MAP_FAILED
is returned on error; this one says that MAP_FAILED is
*only* returned on error.  Contrast this to strtoul(), where
ULONG_MAX is returned on error, but can also be returned
on success, meaning you have to do extra steps (clear errno
before, test it afterwards) to detect failure.  This sentence
is the one that makes it clear that that isn't the case
with mmap().

i have to say, i didn;t get that. after discussing it a bit i've come to
see there is an ambiguity in the sentence being proposed for removal - it
can be read two ways.

with that in mind i propose to commit the diff below very shortly.
(the Fn -> Nm is just by the by)

jmc

Index: mmap.2
===
RCS file: /cvs/src/lib/libc/sys/mmap.2,v
retrieving revision 1.39
diff -u -r1.39 mmap.2
--- mmap.2  12 Apr 2012 12:53:27 -  1.39
+++ mmap.2  16 Oct 2012 20:55:08 -
@@ -188,12 +188,12 @@
 .Dv MAP_FAILED
 is defined in the header
 .Ao Pa sys/mman.h Ac .
-No successful return from
-.Fn mmap
-will return the value
+A successful return from
+.Nm
+will never return the value
 .Dv MAP_FAILED .
 .Sh ERRORS
-.Fn mmap
+.Nm
 will fail if:
 .Bl -tag -width Er
 .It Bq Er EACCES



Re: remove redundant information from mmap.2

2012-10-06 Thread Philip Guenther
On Sat, Oct 6, 2012 at 12:40 PM, Dawe  wrote:
> I think this information is already given in the sentences before.

No, it isn't.  The previous sentences say that MAP_FAILED is returned
on error; this one says that MAP_FAILED is *only* returned on error.
Contrast this to strtoul(), where ULONG_MAX is returned on error, but
can also be returned on success, meaning you have to do extra steps
(clear errno before, test it afterwards) to detect failure.  This
sentence is the one that makes it clear that that isn't the case with
mmap().


Philip Guenther