diff options
author | scottc <scottc> | 2002-09-21 13:11:43 +0000 |
---|---|---|
committer | scottc <scottc> | 2002-09-21 13:11:43 +0000 |
commit | 0f2ae33aa7505656b5bea3f5d1dd089480e98546 (patch) | |
tree | ba1b8c2120a6439d39b784c19100e1b5009daa95 | |
parent | 02b19493d8929253752ffe9952155a264618cf1f (diff) | |
download | gdb-0f2ae33aa7505656b5bea3f5d1dd089480e98546.tar.gz |
Merged changes from HEAD
-rw-r--r-- | winsup/cygwin/ChangeLog | 10 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/ipc.h | 53 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/shm.h | 89 | ||||
-rw-r--r-- | winsup/cygwin/ipc.cc | 2 |
4 files changed, 153 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e449240f81f..12dca54e870 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,15 @@ 2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com> + * cygwin_ipc.h: Move to "include/cygwin/ipc.h". + * cygwin_shm.h: Move to "include/cygwin/shm.h". + * include/cygwin/ipc.h: New file. + * include/cygwin/shm.h: New file. + * ipc.c:c Update <cygwin/ipc.h> include. + * cygserver_shm.cc: Update <cygwin/shm.h> include. + * shm.cc: Ditto. + +2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com> + * safe_memory.h (safe_delete): Make a templated function. * cygserver.cc (~server_request): Update use of safe_delete. (main): Ditto. diff --git a/winsup/cygwin/include/cygwin/ipc.h b/winsup/cygwin/include/cygwin/ipc.h new file mode 100644 index 00000000000..c718a173a0e --- /dev/null +++ b/winsup/cygwin/include/cygwin/ipc.h @@ -0,0 +1,53 @@ +/* sys/ipc.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_IPC_H +#define _SYS_IPC_H + +/* sys/types must be included before sys/ipc.h. We aren't meant to automatically + * include it however + */ + +struct ipc_perm { + uid_t uid; + gid_t gid; + uid_t cuid; + gid_t cgid; + mode_t mode; +}; + +/* 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 + +/* ctl commands 1000-1fff is ipc reserved */ +#define IPC_RMID 0x1003 +#define IPC_SET 0x1002 +#define IPC_STAT 0x1001 + +key_t ftok(const char *, int); + +#endif /* _SYS_IPC_H */ + +#ifdef __cplusplus +} +#endif diff --git a/winsup/cygwin/include/cygwin/shm.h b/winsup/cygwin/include/cygwin/shm.h new file mode 100644 index 00000000000..eb037ba19bf --- /dev/null +++ b/winsup/cygwin/include/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 diff --git a/winsup/cygwin/ipc.cc b/winsup/cygwin/ipc.cc index 1f496d328a7..4665fd84a5b 100644 --- a/winsup/cygwin/ipc.cc +++ b/winsup/cygwin/ipc.cc @@ -11,7 +11,7 @@ details. */ #include "winsup.h" -#include <sys/ipc.h> +#include <cygwin/ipc.h> #include <sys/stat.h> extern "C" |