Cygwin: (mostly) drop NT4 and Samba < 3.0 support
[newlib-cygwin.git] / winsup / cygwin / local_includes / cygserver_msg.h
blobb9fa7d77b17096179dab02c90e79c3e74173fdf5
1 /* cygserver_msg.h: Single unix specification IPC interface for Cygwin.
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7 details. */
9 #ifndef __CYGSERVER_MSG_H__
10 #define __CYGSERVER_MSG_H__
12 #include <sys/types.h>
13 #include <sys/sysproto.h>
14 #ifndef _KERNEL
15 #define _KERNEL 1
16 #endif
17 #include <cygwin/msg.h>
19 #include "cygserver.h"
20 #include "cygserver_ipc.h"
22 #ifndef __INSIDE_CYGWIN__
23 class transport_layer_base;
24 class process_cache;
25 #endif
27 class client_request_msg : public client_request
29 friend class client_request;
31 public:
32 enum msgop_t
34 MSGOP_msgctl,
35 MSGOP_msgget,
36 MSGOP_msgrcv,
37 MSGOP_msgsnd
40 private:
41 union
43 struct
45 msgop_t msgop;
46 proc ipcblk;
47 union
49 struct msgctl_args ctlargs;
50 struct msgget_args getargs;
51 struct msgrcv_args rcvargs;
52 struct msgsnd_args sndargs;
54 } in;
56 union {
57 int ret;
58 ssize_t rcv;
59 } out;
60 } _parameters;
62 #ifndef __INSIDE_CYGWIN__
63 client_request_msg ();
64 virtual void serve (transport_layer_base *, process_cache *);
65 #endif
67 public:
69 #ifdef __INSIDE_CYGWIN__
70 client_request_msg (int, int, struct msqid_ds *); // msgctl
71 client_request_msg (key_t, int); // msgget
72 client_request_msg (int, void *, size_t, long, int); // msgrcv
73 client_request_msg (int, const void *, size_t, int); // msgsnd
74 #endif
76 int retval () const { return msglen () ? _parameters.out.ret : -1; }
77 ssize_t rcvval () const { return _parameters.out.rcv; }
80 #ifndef __INSIDE_CYGWIN__
81 int msginit ();
82 int msgunload ();
83 int msgctl (struct thread *, struct msgctl_args *);
84 int msgget (struct thread *, struct msgget_args *);
85 int msgsnd (struct thread *, struct msgsnd_args *);
86 int msgrcv (struct thread *, struct msgrcv_args *);
87 #endif
89 #endif /* __CYGSERVER_MSG_H__ */