newlib/winsup/cygwin/cygserver_ipc.h
Christopher Faylor cec4879206 * debug.h (console_printf): Define for non-debugging condition.
* cygtls.h (_threadinfo::lock): Remove wait argument.
(_threadinfo::interrupt_setup): Remove retaddr argument.
* exceptions.cc (_threadinfo::interrupt_setup): Ditto.
(_threadinfo::interrupt_now): Accommodate change to interrupt_setup argument.
(setup_handler): Ditto.  Always lock sig stack prior to determining interrupt
method.
* gendef (_sigfe): Correct thinko regarding cmpxchg.
(_sigbe): Ditto.
(_threadinfo::lock): Ditto.
(_threadinfo::pop): Eliminate left-over stack unlock.
* sigproc.cc (proc_subproc): Chnage debugging output to printed warning.
2004-02-09 04:04:24 +00:00

85 lines
1.7 KiB
C++

/* cygserver_ipc.h
Copyright 2002, 2003, 2004 Red Hat, Inc.
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__
/*
* Datastructure which is part of any IPC input parameter block.
*/
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;
HANDLE signal_arrived;
};
#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;
blk.signal_arrived = signal_arrived;
}
#endif /* __INSIDE_CYGWIN__ */
#ifndef __INSIDE_CYGWIN__
class ipc_retval {
private:
union {
int i;
unsigned int u;
vm_offset_t off;
vm_object_t obj;
};
public:
ipc_retval (int ni) { i = ni; }
operator int () const { return i; }
int operator = (int ni) { return i = ni; }
operator unsigned int () const { return u; }
unsigned int operator = (unsigned int nu) { return u = nu; }
operator vm_offset_t () const { return off; }
vm_offset_t operator = (vm_offset_t noff) { return off = noff; }
operator vm_object_t () const { return obj; }
vm_object_t operator = (vm_object_t nobj) { return obj = nobj; }
};
struct thread {
class process *client;
proc *ipcblk;
ipc_retval td_retval[2];
};
#define td_proc ipcblk
#define p_pid cygpid
#endif
#endif /* __CYGSERVER_IPC_H__ */