2003-10-22 12:07:59 +02:00
|
|
|
/* cygserver_ipc.h
|
|
|
|
|
2004-02-09 05:04:24 +01:00
|
|
|
Copyright 2002, 2003, 2004 Red Hat, Inc.
|
2003-10-22 12:07:59 +02:00
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef __CYGSERVER_IPC_H__
|
|
|
|
#define __CYGSERVER_IPC_H__
|
|
|
|
|
|
|
|
/*
|
2003-11-19 19:50:23 +01:00
|
|
|
* Datastructure which is part of any IPC input parameter block.
|
2003-10-22 12:07:59 +02:00
|
|
|
*/
|
2003-11-19 19:50:23 +01:00
|
|
|
struct vmspace {
|
|
|
|
void *vm_map; /* UNUSED */
|
|
|
|
struct shmmap_state *vm_shm;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct proc {
|
|
|
|
pid_t cygpid;
|
|
|
|
DWORD winpid;
|
|
|
|
__uid32_t uid;
|
|
|
|
__gid32_t gid;
|
|
|
|
int gidcnt;
|
|
|
|
__gid32_t *gidlist;
|
|
|
|
bool is_admin;
|
|
|
|
struct vmspace *p_vmspace;
|
2004-02-06 17:18:59 +01:00
|
|
|
HANDLE signal_arrived;
|
2003-11-19 19:50:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __INSIDE_CYGWIN__
|
|
|
|
inline void
|
|
|
|
ipc_set_proc_info (proc &blk)
|
|
|
|
{
|
|
|
|
blk.cygpid = getpid ();
|
|
|
|
blk.winpid = GetCurrentProcessId ();
|
|
|
|
blk.uid = geteuid32 ();
|
|
|
|
blk.gid = getegid32 ();
|
|
|
|
blk.gidcnt = 0;
|
|
|
|
blk.gidlist = NULL;
|
|
|
|
blk.is_admin = false;
|
2004-02-06 17:18:59 +01:00
|
|
|
blk.signal_arrived = signal_arrived;
|
2003-11-19 19:50:23 +01:00
|
|
|
}
|
|
|
|
#endif /* __INSIDE_CYGWIN__ */
|
|
|
|
|
|
|
|
#ifndef __INSIDE_CYGWIN__
|
|
|
|
class ipc_retval {
|
|
|
|
private:
|
|
|
|
union {
|
|
|
|
int i;
|
|
|
|
unsigned int u;
|
|
|
|
vm_offset_t off;
|
|
|
|
vm_object_t obj;
|
2003-10-22 12:07:59 +02:00
|
|
|
};
|
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
public:
|
|
|
|
ipc_retval (int ni) { i = ni; }
|
2003-10-22 12:07:59 +02:00
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
operator int () const { return i; }
|
|
|
|
int operator = (int ni) { return i = ni; }
|
2003-10-22 12:07:59 +02:00
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
operator unsigned int () const { return u; }
|
|
|
|
unsigned int operator = (unsigned int nu) { return u = nu; }
|
2003-10-22 12:07:59 +02:00
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
operator vm_offset_t () const { return off; }
|
|
|
|
vm_offset_t operator = (vm_offset_t noff) { return off = noff; }
|
2003-10-22 12:07:59 +02:00
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
operator vm_object_t () const { return obj; }
|
|
|
|
vm_object_t operator = (vm_object_t nobj) { return obj = nobj; }
|
|
|
|
};
|
2003-10-22 12:07:59 +02:00
|
|
|
|
2003-11-19 19:50:23 +01:00
|
|
|
struct thread {
|
|
|
|
class process *client;
|
|
|
|
proc *ipcblk;
|
|
|
|
ipc_retval td_retval[2];
|
|
|
|
};
|
|
|
|
#define td_proc ipcblk
|
|
|
|
#define p_pid cygpid
|
|
|
|
#endif
|
2003-10-22 12:07:59 +02:00
|
|
|
|
|
|
|
#endif /* __CYGSERVER_IPC_H__ */
|