msq.win32.h
Go to the documentation of this file.
00001 // Copyright (c) 2010-2016 The YP-Spur Authors, except where otherwise indicated.
00002 //
00003 // Permission is hereby granted, free of charge, to any person obtaining a copy
00004 // of this software and associated documentation files (the "Software"), to
00005 // deal in the Software without restriction, including without limitation the
00006 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00007 // sell copies of the Software, and to permit persons to whom the Software is
00008 // furnished to do so, subject to the following conditions:
00009 //
00010 // The above copyright notice and this permission notice shall be included in
00011 // all copies or substantial portions of the Software.
00012 //
00013 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00014 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00015 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00016 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00017 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00018 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00019 // SOFTWARE.
00020 
00021 #ifndef MSQ_WIN32_H
00022 #define MSQ_WIN32_H
00023 
00024 #include <sys/types.h>
00025 
00026 #ifdef __MINGW32__
00027 // Windows用
00028 
00029 #include <windows.h>
00030 
00031 #include <unistd.h>
00032 
00033 #define IPC_CREAT 01000
00034 #define IPC_EXCL 02000
00035 #define IPC_NOWAIT 04000
00036 #define IPC_RMID 0
00037 #define IPC_SET 1
00038 #define IPC_STAT 2
00039 
00040 #ifndef __key_t_defined
00041 typedef int key_t;
00042 #define __key_t_defined
00043 #endif  // __key_t_defined
00044 
00045 #ifndef __uid_t_defined
00046 typedef int uid_t;
00047 #define __uid_t_defined
00048 #endif  // __uid_t_defined
00049 
00050 #ifndef __gid_t_defined
00051 typedef int gid_t;
00052 #define __gid_t_defined
00053 #endif  // __gid_t_defined
00054 
00055 typedef unsigned long int msgqnum_t;
00056 typedef unsigned long int msglen_t;
00057 
00058 struct ipc_perm
00059 {
00060   key_t __key;             /* Key.  */
00061   uid_t uid;               /* Owner's user ID.  */
00062   gid_t gid;               /* Owner's group ID.  */
00063   uid_t cuid;              /* Creator's user ID.  */
00064   gid_t cgid;              /* Creator's group ID.  */
00065   unsigned short int mode; /* Read/write permission.  */
00066   unsigned short int __pad1;
00067   unsigned short int __seq; /* Sequence number.  */
00068   unsigned short int __pad2;
00069   unsigned long int __unused1;
00070   unsigned long int __unused2;
00071 };
00072 struct msqid_ds
00073 {
00074   struct ipc_perm msg_perm; /* structure describing operation permission */
00075   time_t msg_stime;         /* time of last msgsnd command */
00076   unsigned long int __unused1;
00077   time_t msg_rtime; /* time of last msgrcv command */
00078   unsigned long int __unused2;
00079   time_t msg_ctime; /* time of last change */
00080   unsigned long int __unused3;
00081   unsigned long int __msg_cbytes; /* current number of bytes on queue */
00082   msgqnum_t msg_qnum;             /* number of messages currently on queue */
00083   msglen_t msg_qbytes;            /* max number of bytes allowed on queue */
00084   pid_t msg_lspid;                /* pid of last msgsnd() */
00085   pid_t msg_lrpid;                /* pid of last msgrcv() */
00086   unsigned long int __unused4;
00087   unsigned long int __unused5;
00088 };
00089 
00090 int msgget(key_t key, int msgflg);
00091 int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
00092 ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);
00093 int msgctl(int msqid, int cmd, struct msqid_ds *buf);
00094 
00095 #else
00096 // Linux用
00097 
00098 #include <sys/ipc.h>
00099 #include <sys/msg.h>
00100 
00101 #endif  // __MINGW32__
00102 
00103 #endif  // MSQ_WIN32_H


yp-spur
Author(s):
autogenerated on Fri May 10 2019 02:52:19