* shmat()'s and shmdt()'s addr argument shall be const.
* Make struct shmid_ds's shm_nattch unsigned and define the shmatt_t
type for it.
* More manual page adjustments.
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/lib/libc/sys/shmat.2,v 1.8.2.6 2001/12/14 18:34:01 ru Exp $
-.\" $DragonFly: src/lib/libc/sys/shmat.2,v 1.2 2003/06/17 04:26:47 dillon Exp $
.\"
-.Dd August 2, 1995
+.Dd October 29, 2011
.Dt SHMAT 2
.Os
.Sh NAME
.In sys/ipc.h
.In sys/shm.h
.Ft void *
-.Fn shmat "int shmid" "void *addr" "int flag"
+.Fn shmat "int shmid" "const void *addr" "int flag"
.Ft int
-.Fn shmdt "void *addr"
+.Fn shmdt "const void *addr"
.Sh DESCRIPTION
.Fn Shmat
attaches the shared memory segment identified by
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/lib/libc/sys/shmctl.2,v 1.9.2.4 2001/12/14 18:34:01 ru Exp $
-.\" $DragonFly: src/lib/libc/sys/shmctl.2,v 1.2 2003/06/17 04:26:47 dillon Exp $
.\"
-.Dd July 17, 1995
+.Dd October 29, 2011
.Dt SHMCTL 2
.Os
.Sh NAME
.\" with nroff, but otherwise it's straight from sys/shm.h
.\"
.Bd -literal
+typedef unsigned int shmatt_t;
+
struct shmid_ds {
struct ipc_perm shm_perm; /* operation permission structure */
- int shm_segsz; /* size of segment in bytes */
+ size_t shm_segsz; /* size of segment in bytes */
pid_t shm_lpid; /* process ID of last shared memory op */
pid_t shm_cpid; /* process ID of creator */
- short shm_nattch; /* number of current attaches */
+ shmatt_t shm_nattch; /* number of current attaches */
time_t shm_atime; /* time of last shmat() */
time_t shm_dtime; /* time of last shmdt() */
time_t shm_ctime; /* time of last change by shmctl() */
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/lib/libc/sys/shmget.2,v 1.8.2.6 2001/12/14 18:34:01 ru Exp $
-.\" $DragonFly: src/lib/libc/sys/shmget.2,v 1.2 2003/06/17 04:26:47 dillon Exp $
.\"
-.Dd July 3, 1995
+.Dd October 29, 2011
.Dt SHMGET 2
.Os
.Sh NAME
int msgflg); }
227 STD BSD { int msgrcv(int msqid, void *msgp, size_t msgsz, \
long msgtyp, int msgflg); }
-228 STD BSD { caddr_t shmat(int shmid, void *shmaddr, int shmflg); }
+228 STD BSD { caddr_t shmat(int shmid, const void *shmaddr, \
+ int shmflg); }
229 STD BSD { int shmctl(int shmid, int cmd, \
struct shmid_ds *buf); }
-230 STD BSD { int shmdt(void *shmaddr); }
+230 STD BSD { int shmdt(const void *shmaddr); }
231 STD BSD { int shmget(key_t key, size_t size, int shmflg); }
;
232 STD POSIX { int clock_gettime(clockid_t clock_id, \
/* $FreeBSD: src/sys/sys/shm.h,v 1.14 1999/12/29 04:24:46 peter Exp $ */
-/* $DragonFly: src/sys/sys/shm.h,v 1.6 2006/09/30 20:03:44 swildner Exp $ */
/* $NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $ */
/*
#define SHM_R (IPC_R)
#define SHM_W (IPC_W)
+typedef unsigned int shmatt_t;
struct shmid_ds {
struct ipc_perm shm_perm; /* operation permission structure */
size_t shm_segsz; /* size of segment in bytes */
pid_t shm_lpid; /* process ID of last shared memory op */
pid_t shm_cpid; /* process ID of creator */
- int shm_nattch; /* number of current attaches */
+ shmatt_t shm_nattch; /* number of current attaches */
time_t shm_atime; /* time of last shmat() */
time_t shm_dtime; /* time of last shmdt() */
time_t shm_ctime; /* time of last change by shmctl() */
__BEGIN_DECLS
int shmsys (int, ...);
-void *shmat (int, void *, int);
+void *shmat (int, const void *, int);
int shmget (key_t, size_t, int);
int shmctl (int, int, struct shmid_ds *);
-int shmdt (void *);
+int shmdt (const void *);
__END_DECLS
#endif /* !_KERNEL */
struct sysmsg sysmsg;
#endif
int shmid; char shmid_[PAD_(int)];
- void * shmaddr; char shmaddr_[PAD_(void *)];
+ const void * shmaddr; char shmaddr_[PAD_(const void *)];
int shmflg; char shmflg_[PAD_(int)];
};
struct shmctl_args {
#ifdef _KERNEL
struct sysmsg sysmsg;
#endif
- void * shmaddr; char shmaddr_[PAD_(void *)];
+ const void * shmaddr; char shmaddr_[PAD_(const void *)];
};
struct shmget_args {
#ifdef _KERNEL