OSDN Git Service

* select.cc (select_stuff::wait): Temporarily disallow APCS.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / cygserver_sem.h
1 /* cygserver_sem.h: Single unix specification IPC interface for Cygwin.
2
3    Copyright 2003, 2008 Red Hat, Inc.
4
5 This file is part of Cygwin.
6
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
9 details. */
10
11 #ifndef __CYGSERVER_SEM_H__
12 #define __CYGSERVER_SEM_H__
13
14 #include <sys/types.h>
15 #include <sys/sysproto.h>
16 #ifndef _KERNEL
17 #define _KERNEL 1
18 #endif
19 #include <cygwin/sem.h>
20
21 #include "cygserver.h"
22 #include "cygserver_ipc.h"
23
24 #ifndef __INSIDE_CYGWIN__
25 class transport_layer_base;
26 class process_cache;
27 #endif
28
29 class client_request_sem : public client_request
30 {
31   friend class client_request;
32
33 public:
34   enum semop_t
35     {
36       SEMOP_semctl,
37       SEMOP_semget,
38       SEMOP_semop
39     };
40
41 private:
42   union
43   {
44     struct
45     {
46       semop_t semop;
47       proc ipcblk;
48       union
49       {
50         struct semctl_args ctlargs;
51         struct semget_args getargs;
52         struct semop_args  opargs;
53       };
54     } in;
55
56     union {
57       int ret;
58     } out;
59   } _parameters;
60
61 #ifndef __INSIDE_CYGWIN__
62   client_request_sem ();
63   virtual void serve (transport_layer_base *, process_cache *);
64 #endif
65
66 public:
67
68 #ifdef __INSIDE_CYGWIN__
69   client_request_sem (int, int, int, union semun *);    // semctl
70   client_request_sem (key_t, int, int);                 // semget
71   client_request_sem (int, struct sembuf *, size_t);    // semop
72 #endif
73
74   int retval () const { return msglen () ? _parameters.out.ret : -1; }
75 };
76
77 #ifndef __INSIDE_CYGWIN__
78 int seminit ();
79 int semunload ();
80 void semexit_myhook(void *arg, struct proc *p);
81
82 int semctl (struct thread *, struct semctl_args *);
83 int semget (struct thread *, struct semget_args *);
84 int semop (struct thread *, struct semop_args *);
85 #endif
86
87 #endif /* __CYGSERVER_SEM_H__ */