Subject: Proposed diff against shmat(2)
To: None <netbsd-docs@netbsd.org>
From: Matthew Mondor <mmondor@gmail.com>
List: netbsd-docs
Date: 06/27/2004 03:03:42
------=_Part_9_669970.1088319822029
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

I propose the following diff against shmat(2) for clarity. I have seen
several instances of code assuming that it would return NULL on
failure, and the manual page did not seem to stress enough the fact
that it in fact returns -1 on error...

I am taking this opportunity to ask the following question:

I have various other changes to apply to several section 2 manual
pages... I previously sent a PR with some of them a while back, but it
never got any attention apparently (lib/23152). I did not have any
time back then to paricipate more actively in the mailing lists and so
left it stall there... Since then, those manual pages changed a bit,
some of which new versions in 2.0 and -current fixed the bugs those
patches were fixing for 1.6.

Is it preferable to send a PR and then post here to notify other
netbsd-doc active developers, or to simply propose the patch here on
the list, as I am currently doing for this one? I have no cvs access.
I will follow your recommendations for future diffs I will post. I
assume that this will also be the prefered way to proceed for various
kernel patches I will submit soon...

Thanks,
Matthew Mondor

------=_Part_9_669970.1088319822029
Content-Type: text/plain; name="shmat-2-diff.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="shmat-2-diff.txt"

*** src/lib/libc/sys/shmat.2=09Wed Apr 16 09:34:56 2003
--- src/lib/libc/sys/shmat.2=09Sun Jun 27 02:58:58 2004
***************
*** 90,101 ****
  .Sh RETURN VALUES
  .Fn shmat
  returns the address at which the shared memory segment has been mapped in=
to
! the calling process' address space when successful,
  .Fn shmdt
  returns 0 on successful completion.
! Otherwise, a value of -1 is returned, and the global variable
  .Va errno
! is set to indicate the error.
  .Sh ERRORS
  .Fn shmat
  will fail if:
--- 90,106 ----
  .Sh RETURN VALUES
  .Fn shmat
  returns the address at which the shared memory segment has been mapped in=
to
! the calling process' address space when successful, or -1 to indicate an
! error (not NULL, despite the fact that it is a pointer, to conform with t=
he
! standard).
! .Pp
  .Fn shmdt
  returns 0 on successful completion.
! Otherwise, a value of -1 is returned.
! .Pp
! On errors, both functions set the global variable
  .Va errno
! to indicate the error.
  .Sh ERRORS
  .Fn shmat
  will fail if:

------=_Part_9_669970.1088319822029--