From c3725593efe2563319b36f7668f060a62a83de90 Mon Sep 17 00:00:00 2001 From: scottc Date: Sat, 21 Sep 2002 13:48:15 +0000 Subject: * include/sys/ipc.h: Move to "include/cygwin/ipc.h". * include/sys/msg.h: Move to "include/cygwin/msg.h". * include/sys/sem.h: Move to "include/cygwin/sem.h". * include/sys/shm.h: Move to "include/cygwin/shm.h". * include/cygwin/ipc.h: New file. * include/cygwin/msg.h: Ditto. * include/cygwin/sem.h: Ditto. * include/cygwin/shm.h: Ditto. * cygserver_shm.h: Update includes. * msg.cc: Ditto. * sem.cc: Ditto. --- winsup/cygwin/ChangeLog | 14 +++++ winsup/cygwin/cygserver_shm.h | 2 +- winsup/cygwin/include/cygwin/ipc.h | 58 +++++++++--------- winsup/cygwin/include/cygwin/msg.h | 92 ++++++++++++++++++++++++++++ winsup/cygwin/include/cygwin/sem.h | 95 +++++++++++++++++++++++++++++ winsup/cygwin/include/cygwin/shm.h | 119 +++++++++++++++++++------------------ winsup/cygwin/include/sys/ipc.h | 53 ----------------- winsup/cygwin/include/sys/msg.h | 92 ---------------------------- winsup/cygwin/include/sys/sem.h | 95 ----------------------------- winsup/cygwin/include/sys/shm.h | 94 ----------------------------- winsup/cygwin/msg.cc | 2 +- winsup/cygwin/sem.cc | 2 +- 12 files changed, 295 insertions(+), 423 deletions(-) create mode 100644 winsup/cygwin/include/cygwin/msg.h create mode 100644 winsup/cygwin/include/cygwin/sem.h delete mode 100644 winsup/cygwin/include/sys/ipc.h delete mode 100644 winsup/cygwin/include/sys/msg.h delete mode 100644 winsup/cygwin/include/sys/sem.h delete mode 100644 winsup/cygwin/include/sys/shm.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 12dca54e870..8b21019cd0d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,17 @@ +2002-09-21 Conrad Scott + + * include/sys/ipc.h: Move to "include/cygwin/ipc.h". + * include/sys/msg.h: Move to "include/cygwin/msg.h". + * include/sys/sem.h: Move to "include/cygwin/sem.h". + * include/sys/shm.h: Move to "include/cygwin/shm.h". + * include/cygwin/ipc.h: New file. + * include/cygwin/msg.h: Ditto. + * include/cygwin/sem.h: Ditto. + * include/cygwin/shm.h: Ditto. + * cygserver_shm.h: Update includes. + * msg.cc: Ditto. + * sem.cc: Ditto. + 2002-09-21 Conrad Scott * cygwin_ipc.h: Move to "include/cygwin/ipc.h". diff --git a/winsup/cygwin/cygserver_shm.h b/winsup/cygwin/cygserver_shm.h index 5ebe04141e3..b1ff353daab 100644 --- a/winsup/cygwin/cygserver_shm.h +++ b/winsup/cygwin/cygserver_shm.h @@ -15,7 +15,7 @@ details. */ #define __CYGSERVER_SHM_H__ #include -#include +#include #include #include diff --git a/winsup/cygwin/include/cygwin/ipc.h b/winsup/cygwin/include/cygwin/ipc.h index c718a173a0e..8a88a108546 100644 --- a/winsup/cygwin/include/cygwin/ipc.h +++ b/winsup/cygwin/include/cygwin/ipc.h @@ -1,6 +1,6 @@ /* sys/ipc.h - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins This file is part of Cygwin. @@ -9,45 +9,45 @@ 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 +struct ipc_perm +{ + uid_t uid; /* Owner's user ID. */ + gid_t gid; /* Owner's group ID. */ + uid_t cuid; /* Creator's user ID. */ + gid_t cgid; /* Creator's group ID. */ + mode_t mode; /* Read/write permission. */ + key_t key; +}; + +/* Mode bits: */ +#define IPC_CREAT 0x0200 /* Create entry if key does not exist. */ +#define IPC_EXCL 0x0400 /* Fail if key exists. */ +#define IPC_NOWAIT 0x0800 /* Error if request must wait. */ -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 +/* Keys: */ -#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 +#define IPC_PRIVATE ((key_t) 0) /* Private key. */ -/* ctl commands 1000-1fff is ipc reserved */ -#define IPC_RMID 0x1003 -#define IPC_SET 0x1002 -#define IPC_STAT 0x1001 +/* Control commands: + */ +#define IPC_RMID 0x1000 /* Remove identifier. */ +#define IPC_SET 0x1001 /* Set options. */ +#define IPC_STAT 0x1002 /* Get options. */ +#define IPC_INFO 0x1003 /* For ipcs(8). */ -key_t ftok(const char *, int); - -#endif /* _SYS_IPC_H */ +key_t ftok (const char *path, int id); #ifdef __cplusplus } #endif + +#endif /* _SYS_IPC_H */ diff --git a/winsup/cygwin/include/cygwin/msg.h b/winsup/cygwin/include/cygwin/msg.h new file mode 100644 index 00000000000..14e89f55699 --- /dev/null +++ b/winsup/cygwin/include/cygwin/msg.h @@ -0,0 +1,92 @@ +/* sys/msg.h + + Copyright 2002 Red Hat Inc. + Written by Conrad Scott + +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. */ + +#ifndef _SYS_MSG_H +#define _SYS_MSG_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Message operation flags: + */ +#define MSG_NOERROR 0x01 /* No error if big message. */ + +/* Command definitions for the semctl () function: + */ +#define MSG_STAT 0x2000 /* For ipcs(8) */ +#define MSG_INFO 0x2001 /* For ipcs(8) */ + +/* Used for the number of messages in the message queue. + */ +typedef long int msgqnum_t; + +/* Used for the number of bytes allowed in a message queue. + */ +typedef long int msglen_t; + +struct msqid_ds +{ + struct ipc_perm msg_perm; /* Operation permission structure. */ + msglen_t msg_cbytes; /* Number of bytes currently on queue. */ + msgqnum_t msg_qnum; /* Number of messages currently on queue. */ + msglen_t msg_qbytes; /* Maximum number of bytes allowed on queue. */ + pid_t msg_lspid; /* Process ID of last msgsnd (). */ + pid_t msg_lrpid; /* Process ID of last msgrcv (). */ + timestruc_t msg_stim; /* Time of last msgsnd (). */ + timestruc_t msg_rtim; /* Time of last msgrcv (). */ + timestruc_t msg_ctim; /* Time of last change. */ + long msg_spare4[2]; +}; + +#define msg_stime msg_stim.tv_sec +#define msg_rtime msg_rtim.tv_sec +#define msg_ctime msg_ctim.tv_sec + +/* Buffer type for msgctl (IPC_INFO, ...) as used by ipcs(8). + */ +struct msginfo +{ + unsigned long msgpool; /* Maximum number of message bytes, + system wide. */ + unsigned long msgmax; /* Maximum number of bytes per + message. */ + unsigned long msgmnb; /* Maximum number of bytes on any one + message queue. */ + unsigned long msgmni; /* Maximum number of message queues, + system wide. */ + unsigned long msgtql; /* Maximum number of messages, system + wide. */ + unsigned long msg_spare[4]; +}; + +/* Buffer type for msgctl (MSG_INFO, ...) as used by ipcs(8). + */ +struct msg_info +{ + unsigned long msg_ids; /* Number of allocated queues. */ + unsigned long msg_num; /* Number of messages, system wide. */ + unsigned long msg_tot; /* Size in bytes of messages, system wide. */ +}; + +int msgctl (int msqid, int cmd, struct msqid_ds *buf); +int msgget (key_t key, int msgflg); +ssize_t msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); +int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_MSG_H */ diff --git a/winsup/cygwin/include/cygwin/sem.h b/winsup/cygwin/include/cygwin/sem.h new file mode 100644 index 00000000000..a3ece9f8a2b --- /dev/null +++ b/winsup/cygwin/include/cygwin/sem.h @@ -0,0 +1,95 @@ +/* sys/sem.h + + Copyright 2002 Red Hat Inc. + Written by Conrad Scott + +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. */ + +#ifndef _SYS_SEM_H +#define _SYS_SEM_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Semaphore operation flags: + */ +#define SEM_UNDO /* Set up adjust on exit entry. */ + +/* Command definitions for the semctl () function: + */ +#define GETNCNT 0x3000 /* Get semncnt. */ +#define GETPID 0x3001 /* Get sempid. */ +#define GETVAL 0x3002 /* Get semval. */ +#define GETALL 0x3003 /* Get all cases of semval. */ +#define GETZCNT 0x3004 /* Get semzcnt. */ +#define SETVAL 0x3005 /* Set semval. */ +#define SETALL 0x3006 /* Set all cases of semval. */ + +#define SEM_STAT 0x3010 /* For ipcs(8). */ +#define SEM_INFO 0x3011 /* For ipcs(8). */ + +struct semid_ds +{ + struct ipc_perm sem_perm; /* Operation permission structure. */ + unsigned short sem_nsems; /* Number of semaphores in set. */ + timestruc_t sem_otim; /* Last semop () time. */ + timestruc_t sem_ctim; /* Last time changed by semctl (). */ + long sem_spare4[2]; +}; + +#define sem_otime sem_otim.tv_sec +#define sem_ctime sem_ctim.tv_sec + +struct sembuf +{ + unsigned short sem_num; /* Semaphore number. */ + short sem_op; /* Semaphore operation. */ + short sem_flg; /* Operation flags. */ +}; + +/* Buffer type for semctl (IPC_INFO, ...) as used by ipcs(8). + */ +struct seminfo +{ + unsigned long semmni; /* Maximum number of unique semaphore + sets, system wide. */ + unsigned long semmns; /* Maximum number of semaphores, + system wide. */ + unsigned long semmsl; /* Maximum number of semaphores per + semaphore set. */ + unsigned long semopm; /* Maximum number of operations per + semop call. */ + unsigned long semmnu; /* Maximum number of undo structures, + system wide. */ + unsigned long semume; /* Maximum number of undo entries per + undo structure. */ + unsigned long semvmx; /* Maximum semaphore value. */ + unsigned long semaem; /* Maximum adjust-on-exit value. */ + unsigned long sem_spare[4]; +}; + +/* Buffer type for semctl (SEM_INFO, ...) as used by ipcs(8). + */ +struct sem_info +{ + unsigned long sem_ids; /* Number of allocated semaphore sets. */ + unsigned long sem_num; /* Number of allocated semaphores. */ +}; + +int semctl (int semid, int semnum, int cmd, ...); +int semget (key_t key, int nsems, int semflg); +int semop (int semid, struct sembuf *sops, size_t nsops); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_SEM_H */ diff --git a/winsup/cygwin/include/cygwin/shm.h b/winsup/cygwin/include/cygwin/shm.h index eb037ba19bf..b6b2d447c08 100644 --- a/winsup/cygwin/include/cygwin/shm.h +++ b/winsup/cygwin/include/cygwin/shm.h @@ -1,6 +1,6 @@ /* sys/shm.h - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins This file is part of Cygwin. @@ -9,81 +9,86 @@ 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 + #ifdef __cplusplus extern "C" { #endif -#ifndef _SYS_SHM_H -#define _SYS_SHM_H - -#include +/* 64 Kb was hardcoded for x86. MS states this may change, but we need + * it in the header file. + */ +#define SHMLBA 65536 /* Segment low boundary address multiple. */ -#define SHM_RDONLY 1 -/* 64 Kb was hardcoded for x86. MS states this may change, but we need it in the header - * file. +/* Shared memory operation flags: */ -#define SHMLBA 65536 -#define SHM_RND 1 +#define SHM_RDONLY 0x01 /* Attach read-only (else read-write). */ +#define SHM_RND 0x02 /* Round attach address to SHMLBA. */ -typedef long int shmatt_t; +/* Command definitions for the semctl () function: + */ +#define SHM_STAT 0x4000 /* For ipcs(8) */ +#define SHM_INFO 0x4001 /* For ipcs(8) */ -#if defined(__INSIDE_CYGWIN__) && defined(__cplusplus) +/* Unsigned integer used for the number of current attaches. + */ +typedef unsigned int shmatt_t; -class _shmattach { -public: - void *data; - int shmflg; - class _shmattach *next; +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 operation. */ + pid_t shm_cpid; /* Process ID of creator. */ + shmatt_t shm_nattch; /* Number of current attaches. */ + timestruc_t shm_atim; /* Time of last shmat (). */ + timestruc_t shm_dtim; /* Time of last shmdt (). */ + timestruc_t shm_ctim; /* Time of last change by shmctl (). */ + long shm_spare4[2]; }; -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; -}; +#define shm_atime shm_atim.tv_sec +#define shm_dtime shm_dtim.tv_sec +#define shm_ctime shm_ctim.tv_sec -class shmnode { -public: - class shmid_ds * shmds; - int shm_id; - class shmnode *next; - key_t key; - HANDLE filemap; - HANDLE attachmap; - class _shmattach *attachhead; +/* Buffer type for shmctl (IPC_INFO, ...) as used by ipcs(8). + */ +struct shminfo +{ + unsigned long shmmax; /* Maximum size in bytes of a shared + memory segment. */ + unsigned long shmmin; /* Minimum size in bytes of a shared + memory segment. */ + unsigned long shmmni; /* Maximum number of shared memory + segments, system wide. */ + unsigned long shmseg; /* Maximum number of shared memory + segments attached per process. */ + unsigned long shmall; /* Maximum number of bytes of shared + memory, system wide. */ + unsigned long shm_spare[4]; }; -#else -/* this is what we return when queried. It has no bitwise correspondence - * the internal structures +/* Buffer type for shmctl (SHM_INFO, ...) as used by ipcs(8). */ -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 shm_info +{ + unsigned long shm_ids; /* Number of allocated segments. */ + unsigned long shm_tot; /* Size in bytes of allocated segments. */ + unsigned long shm_atts; /* Number of attached segments, system + wide. */ }; -#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 */ +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 */ diff --git a/winsup/cygwin/include/sys/ipc.h b/winsup/cygwin/include/sys/ipc.h deleted file mode 100644 index 8a88a108546..00000000000 --- a/winsup/cygwin/include/sys/ipc.h +++ /dev/null @@ -1,53 +0,0 @@ -/* sys/ipc.h - - Copyright 2001, 2002 Red Hat Inc. - Written by Robert Collins - -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. */ - -#ifndef _SYS_IPC_H -#define _SYS_IPC_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct ipc_perm -{ - uid_t uid; /* Owner's user ID. */ - gid_t gid; /* Owner's group ID. */ - uid_t cuid; /* Creator's user ID. */ - gid_t cgid; /* Creator's group ID. */ - mode_t mode; /* Read/write permission. */ - key_t key; -}; - -/* Mode bits: - */ -#define IPC_CREAT 0x0200 /* Create entry if key does not exist. */ -#define IPC_EXCL 0x0400 /* Fail if key exists. */ -#define IPC_NOWAIT 0x0800 /* Error if request must wait. */ - -/* Keys: - */ -#define IPC_PRIVATE ((key_t) 0) /* Private key. */ - -/* Control commands: - */ -#define IPC_RMID 0x1000 /* Remove identifier. */ -#define IPC_SET 0x1001 /* Set options. */ -#define IPC_STAT 0x1002 /* Get options. */ -#define IPC_INFO 0x1003 /* For ipcs(8). */ - -key_t ftok (const char *path, int id); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_IPC_H */ diff --git a/winsup/cygwin/include/sys/msg.h b/winsup/cygwin/include/sys/msg.h deleted file mode 100644 index 6c1adf34d20..00000000000 --- a/winsup/cygwin/include/sys/msg.h +++ /dev/null @@ -1,92 +0,0 @@ -/* sys/msg.h - - Copyright 2002 Red Hat Inc. - Written by Conrad Scott - -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. */ - -#ifndef _SYS_MSG_H -#define _SYS_MSG_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Message operation flags: - */ -#define MSG_NOERROR 0x01 /* No error if big message. */ - -/* Command definitions for the semctl () function: - */ -#define MSG_STAT 0x2000 /* For ipcs(8) */ -#define MSG_INFO 0x2001 /* For ipcs(8) */ - -/* Used for the number of messages in the message queue. - */ -typedef long int msgqnum_t; - -/* Used for the number of bytes allowed in a message queue. - */ -typedef long int msglen_t; - -struct msqid_ds -{ - struct ipc_perm msg_perm; /* Operation permission structure. */ - msglen_t msg_cbytes; /* Number of bytes currently on queue. */ - msgqnum_t msg_qnum; /* Number of messages currently on queue. */ - msglen_t msg_qbytes; /* Maximum number of bytes allowed on queue. */ - pid_t msg_lspid; /* Process ID of last msgsnd (). */ - pid_t msg_lrpid; /* Process ID of last msgrcv (). */ - timestruc_t msg_stim; /* Time of last msgsnd (). */ - timestruc_t msg_rtim; /* Time of last msgrcv (). */ - timestruc_t msg_ctim; /* Time of last change. */ - long msg_spare4[2]; -}; - -#define msg_stime msg_stim.tv_sec -#define msg_rtime msg_rtim.tv_sec -#define msg_ctime msg_ctim.tv_sec - -/* Buffer type for msgctl (IPC_INFO, ...) as used by ipcs(8). - */ -struct msginfo -{ - unsigned long msgpool; /* Maximum number of message bytes, - system wide. */ - unsigned long msgmax; /* Maximum number of bytes per - message. */ - unsigned long msgmnb; /* Maximum number of bytes on any one - message queue. */ - unsigned long msgmni; /* Maximum number of message queues, - system wide. */ - unsigned long msgtql; /* Maximum number of messages, system - wide. */ - unsigned long msg_spare[4]; -}; - -/* Buffer type for msgctl (MSG_INFO, ...) as used by ipcs(8). - */ -struct msg_info -{ - unsigned long msg_ids; /* Number of allocated queues. */ - unsigned long msg_num; /* Number of messages, system wide. */ - unsigned long msg_tot; /* Size in bytes of messages, system wide. */ -}; - -int msgctl (int msqid, int cmd, struct msqid_ds *buf); -int msgget (key_t key, int msgflg); -ssize_t msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); -int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_MSG_H */ diff --git a/winsup/cygwin/include/sys/sem.h b/winsup/cygwin/include/sys/sem.h deleted file mode 100644 index d37c6fd81a9..00000000000 --- a/winsup/cygwin/include/sys/sem.h +++ /dev/null @@ -1,95 +0,0 @@ -/* sys/sem.h - - Copyright 2002 Red Hat Inc. - Written by Conrad Scott - -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. */ - -#ifndef _SYS_SEM_H -#define _SYS_SEM_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Semaphore operation flags: - */ -#define SEM_UNDO /* Set up adjust on exit entry. */ - -/* Command definitions for the semctl () function: - */ -#define GETNCNT 0x3000 /* Get semncnt. */ -#define GETPID 0x3001 /* Get sempid. */ -#define GETVAL 0x3002 /* Get semval. */ -#define GETALL 0x3003 /* Get all cases of semval. */ -#define GETZCNT 0x3004 /* Get semzcnt. */ -#define SETVAL 0x3005 /* Set semval. */ -#define SETALL 0x3006 /* Set all cases of semval. */ - -#define SEM_STAT 0x3010 /* For ipcs(8). */ -#define SEM_INFO 0x3011 /* For ipcs(8). */ - -struct semid_ds -{ - struct ipc_perm sem_perm; /* Operation permission structure. */ - unsigned short sem_nsems; /* Number of semaphores in set. */ - timestruc_t sem_otim; /* Last semop () time. */ - timestruc_t sem_ctim; /* Last time changed by semctl (). */ - long sem_spare4[2]; -}; - -#define sem_otime sem_otim.tv_sec -#define sem_ctime sem_ctim.tv_sec - -struct sembuf -{ - unsigned short sem_num; /* Semaphore number. */ - short sem_op; /* Semaphore operation. */ - short sem_flg; /* Operation flags. */ -}; - -/* Buffer type for semctl (IPC_INFO, ...) as used by ipcs(8). - */ -struct seminfo -{ - unsigned long semmni; /* Maximum number of unique semaphore - sets, system wide. */ - unsigned long semmns; /* Maximum number of semaphores, - system wide. */ - unsigned long semmsl; /* Maximum number of semaphores per - semaphore set. */ - unsigned long semopm; /* Maximum number of operations per - semop call. */ - unsigned long semmnu; /* Maximum number of undo structures, - system wide. */ - unsigned long semume; /* Maximum number of undo entries per - undo structure. */ - unsigned long semvmx; /* Maximum semaphore value. */ - unsigned long semaem; /* Maximum adjust-on-exit value. */ - unsigned long sem_spare[4]; -}; - -/* Buffer type for semctl (SEM_INFO, ...) as used by ipcs(8). - */ -struct sem_info -{ - unsigned long sem_ids; /* Number of allocated semaphore sets. */ - unsigned long sem_num; /* Number of allocated semaphores. */ -}; - -int semctl (int semid, int semnum, int cmd, ...); -int semget (key_t key, int nsems, int semflg); -int semop (int semid, struct sembuf *sops, size_t nsops); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_SEM_H */ diff --git a/winsup/cygwin/include/sys/shm.h b/winsup/cygwin/include/sys/shm.h deleted file mode 100644 index d5c7d2519af..00000000000 --- a/winsup/cygwin/include/sys/shm.h +++ /dev/null @@ -1,94 +0,0 @@ -/* sys/shm.h - - Copyright 2001, 2002 Red Hat Inc. - Written by Robert Collins - -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. */ - -#ifndef _SYS_SHM_H -#define _SYS_SHM_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* 64 Kb was hardcoded for x86. MS states this may change, but we need - * it in the header file. - */ -#define SHMLBA 65536 /* Segment low boundary address multiple. */ - -/* Shared memory operation flags: - */ -#define SHM_RDONLY 0x01 /* Attach read-only (else read-write). */ -#define SHM_RND 0x02 /* Round attach address to SHMLBA. */ - -/* Command definitions for the semctl () function: - */ -#define SHM_STAT 0x4000 /* For ipcs(8) */ -#define SHM_INFO 0x4001 /* For ipcs(8) */ - -/* Unsigned integer used for the number of current attaches. - */ -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 operation. */ - pid_t shm_cpid; /* Process ID of creator. */ - shmatt_t shm_nattch; /* Number of current attaches. */ - timestruc_t shm_atim; /* Time of last shmat (). */ - timestruc_t shm_dtim; /* Time of last shmdt (). */ - timestruc_t shm_ctim; /* Time of last change by shmctl (). */ - long shm_spare4[2]; -}; - -#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; /* Maximum size in bytes of a shared - memory segment. */ - unsigned long shmmin; /* Minimum size in bytes of a shared - memory segment. */ - unsigned long shmmni; /* Maximum number of shared memory - segments, system wide. */ - unsigned long shmseg; /* Maximum number of shared memory - segments attached per process. */ - unsigned long shmall; /* Maximum number of bytes of shared - memory, system wide. */ - unsigned long shm_spare[4]; -}; - -/* Buffer type for shmctl (SHM_INFO, ...) as used by ipcs(8). - */ -struct shm_info -{ - unsigned long shm_ids; /* Number of allocated segments. */ - unsigned long shm_tot; /* Size in bytes of allocated segments. */ - unsigned long shm_atts; /* Number of attached segments, system - wide. */ -}; - -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 */ diff --git a/winsup/cygwin/msg.cc b/winsup/cygwin/msg.cc index 0daee06f7f8..c76fd8ee702 100644 --- a/winsup/cygwin/msg.cc +++ b/winsup/cygwin/msg.cc @@ -13,7 +13,7 @@ details. */ #include "winsup.h" #include -#include +#include #include diff --git a/winsup/cygwin/sem.cc b/winsup/cygwin/sem.cc index 8d0f873a740..63aba8e80b3 100644 --- a/winsup/cygwin/sem.cc +++ b/winsup/cygwin/sem.cc @@ -13,7 +13,7 @@ details. */ #include "winsup.h" #include -#include +#include #include -- cgit v1.2.1