]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/cygserver_ipc.h
* DevNotes: Add entry cgf-000013.
[newlib-cygwin.git] / winsup / cygwin / cygserver_ipc.h
CommitLineData
e217832c
CV
1/* cygserver_ipc.h
2
33a6952b 3 Copyright 2002, 2003, 2004, 2012 Red Hat, Inc.
e217832c
CV
4
5This file is part of Cygwin.
6
7This software is a copyrighted work licensed under the terms of the
8Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9details. */
10
11#ifndef __CYGSERVER_IPC_H__
12#define __CYGSERVER_IPC_H__
13
e217832c 14/*
a6df500f 15 * Datastructure which is part of any IPC input parameter block.
e217832c 16 */
a6df500f
CV
17struct vmspace {
18 void *vm_map; /* UNUSED */
19 struct shmmap_state *vm_shm;
20};
21
22struct proc {
23 pid_t cygpid;
24 DWORD winpid;
25 __uid32_t uid;
26 __gid32_t gid;
27 int gidcnt;
28 __gid32_t *gidlist;
29 bool is_admin;
30 struct vmspace *p_vmspace;
2a566ac3 31 HANDLE signal_arrived;
a6df500f
CV
32};
33
34#ifdef __INSIDE_CYGWIN__
33a6952b 35#include "sigproc.h"
a6df500f
CV
36inline void
37ipc_set_proc_info (proc &blk)
38{
39 blk.cygpid = getpid ();
40 blk.winpid = GetCurrentProcessId ();
41 blk.uid = geteuid32 ();
42 blk.gid = getegid32 ();
43 blk.gidcnt = 0;
44 blk.gidlist = NULL;
45 blk.is_admin = false;
962f9a2c 46 _my_tls.set_signal_arrived (true, blk.signal_arrived);
a6df500f
CV
47}
48#endif /* __INSIDE_CYGWIN__ */
49
50#ifndef __INSIDE_CYGWIN__
51class ipc_retval {
52private:
53 union {
54 int i;
55 unsigned int u;
56 vm_offset_t off;
57 vm_object_t obj;
e217832c
CV
58 };
59
a6df500f
CV
60public:
61 ipc_retval (int ni) { i = ni; }
e217832c 62
a6df500f
CV
63 operator int () const { return i; }
64 int operator = (int ni) { return i = ni; }
e217832c 65
a6df500f
CV
66 operator unsigned int () const { return u; }
67 unsigned int operator = (unsigned int nu) { return u = nu; }
e217832c 68
a6df500f
CV
69 operator vm_offset_t () const { return off; }
70 vm_offset_t operator = (vm_offset_t noff) { return off = noff; }
e217832c 71
a6df500f
CV
72 operator vm_object_t () const { return obj; }
73 vm_object_t operator = (vm_object_t nobj) { return obj = nobj; }
74};
e217832c 75
a6df500f
CV
76struct thread {
77 class process *client;
78 proc *ipcblk;
79 ipc_retval td_retval[2];
80};
81#define td_proc ipcblk
82#define p_pid cygpid
83#endif
e217832c
CV
84
85#endif /* __CYGSERVER_IPC_H__ */
This page took 0.215108 seconds and 5 git commands to generate.