diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-23 22:56:58 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-23 22:56:58 +0000 |
commit | 85b995d4f16a88b5645c4fe439349a21f0fd65ee (patch) | |
tree | 9ba90f71a0c629b5a8b7add03249620d1c1e0bcf /winsup/cygwin/cygwin_shm.h | |
parent | 6bda8defe92592970805d48e77031ace1c4a3414 (diff) | |
download | cygnal-85b995d4f16a88b5645c4fe439349a21f0fd65ee.tar.gz cygnal-85b995d4f16a88b5645c4fe439349a21f0fd65ee.tar.bz2 cygnal-85b995d4f16a88b5645c4fe439349a21f0fd65ee.zip |
Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
* sys/ipc.h: Remove.
* sys/shm.h: Remove.
* cygwin_ipc.h: New file.
* cygwin_shm.h: New file.
Diffstat (limited to 'winsup/cygwin/cygwin_shm.h')
-rwxr-xr-x | winsup/cygwin/cygwin_shm.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/winsup/cygwin/cygwin_shm.h b/winsup/cygwin/cygwin_shm.h new file mode 100755 index 000000000..a3aa2f473 --- /dev/null +++ b/winsup/cygwin/cygwin_shm.h @@ -0,0 +1,89 @@ +/* sys/shm.h + + Copyright 2001 Red Hat Inc. + Written by Robert Collins <rbtcollins@hotmail.com> + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef _SYS_SHM_H +#define _SYS_SHM_H + +#include "cygwin_ipc.h" + +#define SHM_RDONLY 1 +/* 64 Kb was hardcoded for x86. MS states this may change, but we need it in the header + * file. + */ +#define SHMLBA 65536 +#define SHM_RND 1 + +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; +}; +#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); + +#endif /* _SYS_SHM_H */ + +#ifdef __cplusplus +} +#endif |