diff options
author | scottc <scottc> | 2002-06-24 11:33:48 +0000 |
---|---|---|
committer | scottc <scottc> | 2002-06-24 11:33:48 +0000 |
commit | dad8fc79ea991f41508782760d1b7c2dbe226b55 (patch) | |
tree | bc24970416693ab118373e1afba27d2af45660cd /winsup/cygwin | |
parent | 00218ce2ed1bb153754a31f628ea7b9d4600b72b (diff) | |
download | gdb-dad8fc79ea991f41508782760d1b7c2dbe226b55.tar.gz |
* cygserver_shm.h: Replace <sys/shm.h> with "cygwin_shm.h" after
merge from HEAD.
* cygwin_ipc.h: Update with changes to include/sys/ipc.h lost in
merge from HEAD.
* cygwin_shm.h: Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/cygserver_shm.h | 2 | ||||
-rwxr-xr-x | winsup/cygwin/cygwin_ipc.h | 36 | ||||
-rwxr-xr-x | winsup/cygwin/cygwin_shm.h | 106 |
4 files changed, 77 insertions, 75 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9b8411dc809..230f4418513 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2002-06-24 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.h: Replace <sys/shm.h> with "cygwin_shm.h" after + merge from HEAD. + * cygwin_ipc.h: Update with changes to include/sys/ipc.h lost in + merge from HEAD. + * cygwin_shm.h: Ditto. + 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com> * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes. diff --git a/winsup/cygwin/cygserver_shm.h b/winsup/cygwin/cygserver_shm.h index a8b7dd2a6bc..2475c3628bf 100644 --- a/winsup/cygwin/cygserver_shm.h +++ b/winsup/cygwin/cygserver_shm.h @@ -10,8 +10,8 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ #include <sys/types.h> -#include <sys/shm.h> +#include "cygwin_shm.h" #include "threaded_queue.h" #include "cygwin/cygserver_process.h" #include "cygwin/cygserver_transport.h" diff --git a/winsup/cygwin/cygwin_ipc.h b/winsup/cygwin/cygwin_ipc.h index c718a173a0e..f319aebeb54 100755 --- a/winsup/cygwin/cygwin_ipc.h +++ b/winsup/cygwin/cygwin_ipc.h @@ -9,16 +9,17 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#ifndef _SYS_IPC_H +#define _SYS_IPC_H + #ifdef __cplusplus extern "C" { #endif -#ifndef _SYS_IPC_H -#define _SYS_IPC_H - -/* sys/types must be included before sys/ipc.h. We aren't meant to automatically - * include it however +/* + * <sys/types.h> must be included before <sys/ipc.h>. We aren't meant + * to automatically include it however. */ struct ipc_perm { @@ -29,25 +30,30 @@ struct ipc_perm { mode_t mode; }; -/* the mode flags used with the _get functions use the low order 9 bits for a mode - * request +/* + * The mode flags used with the _get functions use the low order 9 + * bits for a mode request. */ #define IPC_CREAT 0x0200 #define IPC_EXCL 0x0400 #define IPC_NOWAIT 0x0800 -/* this is a value that will _never_ be a valid key from ftok */ -#define IPC_PRIVATE -2 +/* This is a value that will _never_ be a valid key from ftok(3). */ +#define IPC_PRIVATE ((key_t) -2) -/* ctl commands 1000-1fff is ipc reserved */ -#define IPC_RMID 0x1003 -#define IPC_SET 0x1002 -#define IPC_STAT 0x1001 +/* + * Values for the cmd argument to shmctl(2). + * Commands 1000-1fff are reserved for IPC_xxx. + */ +#define IPC_RMID 0x1000 +#define IPC_SET 0x1001 +#define IPC_STAT 0x1002 +#define IPC_INFO 0x1003 /* For ipcs(8). */ key_t ftok(const char *, int); -#endif /* _SYS_IPC_H */ - #ifdef __cplusplus } #endif + +#endif /* _SYS_IPC_H */ diff --git a/winsup/cygwin/cygwin_shm.h b/winsup/cygwin/cygwin_shm.h index a3aa2f47383..987de660e68 100755 --- a/winsup/cygwin/cygwin_shm.h +++ b/winsup/cygwin/cygwin_shm.h @@ -9,81 +9,69 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ +#ifndef _SYS_SHM_H +#define _SYS_SHM_H + +#include "cygwin_ipc.h" + #ifdef __cplusplus extern "C" { #endif -#ifndef _SYS_SHM_H -#define _SYS_SHM_H +/* + * 64 Kb was hardcoded for x86. MS states this may change, but we need + * it in the header file. + */ +#define SHMLBA 65536 -#include "cygwin_ipc.h" +/* + * Values for the shmflg argument to shmat(2). + */ +#define SHM_RDONLY 0x01 /* Attach read-only, not read/write. */ +#define SHM_RND 0x02 /* Round shmaddr down to multiple of SHMLBA. */ -#define SHM_RDONLY 1 -/* 64 Kb was hardcoded for x86. MS states this may change, but we need it in the header - * file. +/* + * Values for the cmd argument to shmctl(2). + * Commands 4000-4fff are reserved for SHM_xxx. */ -#define SHMLBA 65536 -#define SHM_RND 1 +#define SHM_STAT 0x4000 /* For ipcs(8) */ typedef long int shmatt_t; -#if defined(__INSIDE_CYGWIN__) && defined(__cplusplus) - -class _shmattach { -public: - void *data; - int shmflg; - class _shmattach *next; -}; - -class shmid_ds { -public: - struct ipc_perm shm_perm; - size_t shm_segsz; - pid_t shm_lpid; - pid_t shm_cpid; - shmatt_t shm_nattch; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; - void *mapptr; -}; - -class shmnode { -public: - class shmid_ds * shmds; - int shm_id; - class shmnode *next; - key_t key; - HANDLE filemap; - HANDLE attachmap; - class _shmattach *attachhead; -}; - -#else -/* this is what we return when queried. It has no bitwise correspondence - * the internal structures - */ struct shmid_ds { - struct ipc_perm shm_perm; - size_t shm_segsz; - pid_t shm_lpid; - pid_t shm_cpid; - shmatt_t shm_nattch; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; + struct ipc_perm shm_perm; + size_t shm_segsz; + pid_t shm_lpid; + pid_t shm_cpid; + shmatt_t shm_nattch; + timestruc_t shm_atim; + timestruc_t shm_dtim; + timestruc_t shm_ctim; + long shm_spare4[2]; }; -#endif /* __INSIDE_CYGWIN__ */ -void *shmat(int, const void *, int); -int shmctl(int, int, struct shmid_ds *); -int shmdt(const void *); -int shmget(key_t, size_t, int); +#define shm_atime shm_atim.tv_sec +#define shm_dtime shm_dtim.tv_sec +#define shm_ctime shm_ctim.tv_sec + +/* Buffer type for shmctl(IPC_INFO, ...) as used by ipcs(8). */ +struct shminfo { + unsigned long shmmax; + unsigned long shmmin; + unsigned long shmmni; + unsigned long shmseg; + unsigned long shmall; + unsigned long shm_spare[4]; +}; -#endif /* _SYS_SHM_H */ +void *shmat(int shmid, const void *shmaddr, int shmflg); +int shmctl(int shmid, int cmd, struct shmid_ds *buf); +int shmdt(const void *shmaddr); +int shmget(key_t key, size_t size, int shmflg); #ifdef __cplusplus } #endif + +#endif /* _SYS_SHM_H */ |