NetBSD Problem Report #10431
Received: (qmail 647 invoked from network); 23 Jun 2000 21:21:56 -0000
Message-Id: <200006232120.e5NLKix00490@noon>
Date: Fri, 23 Jun 2000 23:20:44 +0200 (MEST)
From: feyrer@noon
Reply-To: hubert.feyrer@rz.uni-regensburg.de
To: gnats-bugs@gnats.netbsd.org
Subject: shmget(2) doesn't document shmflgs
X-Send-Pr-Version: 3.95
>Number: 10431
>Category: bin
>Synopsis: shmget(2) doesn't document shmflgs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: assar
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 23 21:22:00 +0000 2000
>Closed-Date: Mon Jun 26 16:22:14 +0000 2000
>Last-Modified: Mon Jun 26 16:22:14 +0000 2000
>Originator:
>Release: 20000525
>Organization:
>Environment:
System: NetBSD noon 1.4ZD NetBSD 1.4ZD (NOON) #18: Mon Jun 19 21:38:37 MEST 2000 feyrer@noon:/usr/cvs/src-current/sys/arch/i386/compile/NOON i386
>Description:
trying to port some program (cflowd) that uses SHM_R i discovered that
we don't have this flag available, and worse, that the shmget(2) manpage
doesn't document any flags besides IPC_CREAT.
>How-To-Repeat:
man shmget
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
From: Assar Westerlund <assar@sics.se>
To: hubert.feyrer@rz.uni-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: 26 Jun 2000 03:28:15 +0200
feyrer@noon.netbsd.org writes:
> >Description:
> trying to port some program (cflowd) that uses SHM_R i discovered that
> we don't have this flag available, and worse, that the shmget(2) manpage
> doesn't document any flags besides IPC_CREAT.
I was unable to find any mention of SHM_R in the single unix standard
but I assume that it's supposed to be defined to IPC_R ? You don't
happen to know what standard defines these?
/assar
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: Assar Westerlund <assar@sics.se>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: Mon, 26 Jun 2000 04:45:01 +0200 (MET DST)
On 26 Jun 2000, Assar Westerlund wrote:
> I was unable to find any mention of SHM_R in the single unix standard
> but I assume that it's supposed to be defined to IPC_R ? You don't
> happen to know what standard defines these?
Linux, probably. But Solaris' <sys/shm.h> defines it as:
/*
* Permission Definitions.
*/
#define SHM_R 0400 /* read permission */
#define SHM_W 0200 /* write permission */
In any case, the shmflg in shmget needs it's possible values documented...
- Hubert
--
NetBSD - because Unix isn't just #include <linux.h>, i386, ILP32, ELF, ...!
From: Assar Westerlund <assar@sics.se>
To: hubert.feyrer@informatik.fh-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: 26 Jun 2000 05:09:13 +0200
Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de> writes:
> In any case, the shmflg in shmget needs it's possible values documented...
Right. Not that I'm particularly good with mdoc of the English
language, but here are some diffs.
/assar
Index: shm.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/shm.h,v
retrieving revision 1.26
diff -u -w -u -w -r1.26 shm.h
--- shm.h 2000/06/02 15:53:05 1.26
+++ shm.h 2000/06/26 03:07:47
@@ -83,6 +83,11 @@
#define SHM_RND 020000 /* Round attach address to SHMLBA */
#define SHMLBA NBPG /* Segment low boundry address multiple XXX */
+/* permissions */
+
+#define SHM_R IPC_R
+#define SHM_W IPC_W
+
typedef unsigned int shmatt_t;
struct shmid_ds {
Index: shmget.2
===================================================================
RCS file: /cvsroot/basesrc/lib/libc/sys/shmget.2,v
retrieving revision 1.8
diff -u -w -u -w -r1.8 shmget.2
--- shmget.2 1999/12/02 21:42:39 1.8
+++ shmget.2 2000/06/26 03:08:29
@@ -45,6 +45,27 @@
.Fn shmget
returns the shared memory identifier associated with the key
.Fa key .
+The
+.Fa shmflg
+should be a combination of the following flags:
+.Bl -tag -offset indent -width IPC_NOWAIT
+.It Dv IPC_CREAT
+create if segment does not exist
+.It Dv IPC_EXCL
+fail if segment already exists
+.It Dv IPC_NOWAIT
+return error instead of waiting
+.El
+.Pp
+and nine bits of access bits, based on:
+.Bl -tag -offset indent -width IPC_R
+.It Dv IPC_R (SHM_R)
+read permission
+.It Dv IPC_W (SHM_W)
+write permission
+.It Dv IPC_M
+changing control info permission
+.El
.Pp
A shared memory segment is created if either
.Fa key
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: Assar Westerlund <assar@sics.se>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: Mon, 26 Jun 2000 13:37:08 +0200 (MET DST)
On 26 Jun 2000, Assar Westerlund wrote:
> Right. Not that I'm particularly good with mdoc of the English
> language, but here are some diffs.
Looks good, but if we have IPC_R for the job (which I didn't know it was
valid - if I had some docs I'd just have tried & jused it!), then I don't
thing we should add SHM_R. Just documenting the existing interface is ok.
Thanks!
- Hubert
--
NetBSD - because Unix isn't just #include <linux.h>, i386, ILP32, ELF, ...!
From: Assar Westerlund <assar@sics.se>
To: hubert.feyrer@informatik.fh-regensburg.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: 26 Jun 2000 17:46:43 +0200
Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de> writes:
> Looks good, but if we have IPC_R for the job (which I didn't know it was
> valid - if I had some docs I'd just have tried & jused it!), then I don't
> thing we should add SHM_R. Just documenting the existing interface is ok.
> Thanks!
I dunno, I don't have any problems with adding SHM_R et al, it makes
sense to use SHM_* constants for shmget, it just seems that they're
incomplete. And since solaris and others use them I think it's good
to be compatible. I've comitted the man-page update, anyways.
/assar
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: Assar Westerlund <assar@sics.se>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/10431: shmget(2) doesn't document shmflgs
Date: Mon, 26 Jun 2000 18:11:54 +0200 (MET DST)
On 26 Jun 2000, Assar Westerlund wrote:
> I dunno, I don't have any problems with adding SHM_R et al, it makes
> sense to use SHM_* constants for shmget, it just seems that they're
> incomplete. And since solaris and others use them I think it's good
> to be compatible.
I'm not sure. I've just checked SUSv2, and it doesn't mention any symbolic
values for the permissions at all, it rather spells out the octal
constants. I've also asked kleink (our "standards" guy), and he'd rather
not add SHM_*.
> I've comitted the man-page update, anyways.
Thanks!
- Hubert
--
NetBSD - because Unix isn't just #include <linux.h>, i386, ILP32, ELF, ...!
State-Changed-From-To: open->closed
State-Changed-By: assar
State-Changed-When: Mon Jun 26 09:16:17 PDT 2000
State-Changed-Why:
fixed in shmget.2:1.9
Responsible-Changed-From-To: bin-bug-people->assar
Responsible-Changed-By: assar
Responsible-Changed-When: Mon Jun 26 09:16:17 PDT 2000
Responsible-Changed-Why:
took care of it
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.