* cygserver.h (client_request::request_code_t): Add
CYGSERVER_REQUEST_MSG and CYGSERVER_REQUEST_SEM. (admininstrator_group_sid): Add extern declaration. * cygserver_ipc.h: Rewrite. * cygserver_msg.h: New file. * cygserver_sem.h: New file. * cygserver_shm.h: More or less rewrite. * cygwin.din: Add msgctl, msgget, msgrcv, msgsnd, semctl, semget and semop. * msg.cc: Rewrite. * safe_memory.h: Remove. * sem.cc: Rewrite. * shm.cc: Rewrite. * include/cygwin/ipc.h: Use appropriate guard. (struct ipc_perm): Add seq. (IPCID_TO_IX): New define from BSD. (IPCID_TO_SEQ): Ditto. (IXSEQ_TO_IPCID): Ditto. (IPC_R): Ditto. (IPC_W): Ditto. (IPC_M): Ditto. * include/cygwin/msg.h: Use appropriate guard. #ifdef _KERNEL all stuff not explicitely defined by SUSv3. Use signed types in structs to match types used in BSD. (msgqnum_t): Define unsigned. (msglen_t): Ditto. (struct msqid_ds): Add msg_first and msg_last. (struct msginfo): Remove msgpool. Add msgssz and msgseg. * include/cygwin/sem.h: Use appropriate guard. #ifdef _KERNEL all stuff not explicitely defined by SUSv3. Use signed types in structs to match types used in BSD. (SEM_UNDO): Define appropriately. (struct semid_ds): Add sem_base. (struct seminfo): Add semmap and semusz. (SEM_A): New define from BSD. (SEM_R): Ditto. (SEM_ALLOC): Ditto. (union semun): Define. * include/cygwin/shm.h: Use appropriate guard. #ifdef _KERNEL all stuff not explicitely defined by SUSv3. Use signed types in structs to match types used in BSD. (SHMLBA): Define using cygwin_internal(CW_GET_SHMLBA) call. (struct shmid_ds): Add shm_internal. (struct shm_info): Rename shm_ids to used_ids as in BSD. Add define for shm_ids. * include/cygwin/sysproto.h: New file. * include/cygwin/version.h: Bump API minor number. * include/sys/ipc.h: New file. * include/sys/msg.h: New file. * include/sys/queue.h: New file from BSD. * include/sys/sem.h: New file. * include/sys/shm.h: New file. * include/sys/sysproto.h: New file.
This commit is contained in:
@ -9,8 +9,8 @@ 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
|
||||
#ifndef _CYGWIN_MSG_H
|
||||
#define _CYGWIN_MSG_H
|
||||
|
||||
#include <cygwin/ipc.h>
|
||||
|
||||
@ -23,18 +23,20 @@ extern "C"
|
||||
*/
|
||||
#define MSG_NOERROR 0x01 /* No error if big message. */
|
||||
|
||||
#ifdef _KERNEL
|
||||
/* Command definitions for the semctl () function:
|
||||
*/
|
||||
#define MSG_STAT 0x2000 /* For ipcs(8) */
|
||||
#define MSG_INFO 0x2001 /* For ipcs(8) */
|
||||
#endif /* _KERNEL */
|
||||
|
||||
/* Used for the number of messages in the message queue.
|
||||
*/
|
||||
typedef long int msgqnum_t;
|
||||
typedef unsigned long msgqnum_t;
|
||||
|
||||
/* Used for the number of bytes allowed in a message queue.
|
||||
*/
|
||||
typedef long int msglen_t;
|
||||
typedef unsigned long msglen_t;
|
||||
|
||||
struct msqid_ds
|
||||
{
|
||||
@ -47,38 +49,46 @@ struct msqid_ds
|
||||
timestruc_t msg_stim; /* Time of last msgsnd (). */
|
||||
timestruc_t msg_rtim; /* Time of last msgrcv (). */
|
||||
timestruc_t msg_ctim; /* Time of last change. */
|
||||
#ifdef _KERNEL
|
||||
struct msg *msg_first;
|
||||
struct msg *msg_last;
|
||||
#else
|
||||
long msg_spare4[2];
|
||||
#endif /* _KERNEL */
|
||||
};
|
||||
|
||||
#define msg_stime msg_stim.tv_sec
|
||||
#define msg_rtime msg_rtim.tv_sec
|
||||
#define msg_ctime msg_ctim.tv_sec
|
||||
|
||||
#ifdef _KERNEL
|
||||
/* 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];
|
||||
long msgmax; /* Maximum number of bytes per
|
||||
message. */
|
||||
long msgmnb; /* Maximum number of bytes on any one
|
||||
message queue. */
|
||||
long msgmni; /* Maximum number of message queues,
|
||||
system wide. */
|
||||
long msgtql; /* Maximum number of messages, system
|
||||
wide. */
|
||||
long msgssz; /* Size of a message segment, must be
|
||||
small power of 2 greater than 4. */
|
||||
long msgseg; /* Number of message segments */
|
||||
long msg_spare[2];
|
||||
};
|
||||
|
||||
/* 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. */
|
||||
long msg_ids; /* Number of allocated queues. */
|
||||
long msg_num; /* Number of messages, system wide. */
|
||||
long msg_tot; /* Size in bytes of messages, system wide. */
|
||||
};
|
||||
#endif /* _KERNEL */
|
||||
|
||||
int msgctl (int msqid, int cmd, struct msqid_ds *buf);
|
||||
int msgget (key_t key, int msgflg);
|
||||
@ -89,4 +99,4 @@ int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_MSG_H */
|
||||
#endif /* _CYGWIN_MSG_H */
|
||||
|
Reference in New Issue
Block a user