* winsup.h: Eliminate inclusion of most of the cygwin .h files. Use .h files

only in sources which require them.
* Makefile.in: Generate dependencies with -MD option.
This commit is contained in:
Christopher Faylor 2000-08-22 05:10:20 +00:00
parent 19b48cd982
commit bccd5e0d85
63 changed files with 288 additions and 216 deletions

View File

@ -1,3 +1,9 @@
Tue Aug 22 01:08:01 2000 Christopher Faylor <cgf@cygnus.com>
* winsup.h: Eliminate inclusion of most of the cygwin .h files. Use .h
files only in sources which require them.
* Makefile.in: Generate dependencies with -MD option.
Mon Aug 21 23:49:05 2000 Christopher Faylor <cgf@cygnus.com>
* cygerrno.h: New file. Use this throughout whenever errno

View File

@ -47,7 +47,7 @@ INSTALL_PROGRAM:=@INSTALL_PROGRAM@
MT_SAFE = @MT_SAFE@
DEFS = @DEFS@
CC:=@CC@
CC:=@CC@ -MD
# FIXME: Which is it, CC or CC_FOR_TARGET?
CC_FOR_TARGET:=$(CC)
CFLAGS:=@CFLAGS@
@ -282,77 +282,5 @@ WINSUP_H:=winsup.h fhandler.h path.h shared.h \
$(MT_SAFE_HEADERS)
winsup.h: config.h
assert.o: $(WINSUP_H)
dcrt0.o: $(WINSUP_H) include/exceptions.h include/glob.h dll_init.h autoload.h
debug.o: $(WINSUP_H) debug.h sync.h
delqueue.o: $(WINSUP_H)
dir.o: $(WINSUP_H)
dlfcn.o: $(WINSUP_H) dll_init.h
dll_entry.o: $(WINSUP_H) include/cygwin/cygwin_dll.h
dll_init.o: $(WINSUP_H) include/exceptions.h dll_init.h
dll_main.o:
environ.o: $(WINSUP_H)
errno.o: $(WINSUP_H)
exceptions.o: $(WINSUP_H) include/exceptions.h sync.h
exec.o: $(WINSUP_H)
external.o: $(WINSUP_H)
fcntl.o: $(WINSUP_H)
fhandler.o: $(WINSUP_H)
fhandler_console.o: $(WINSUP_H)
fhandler_serial.o: $(WINSUP_H)
fhandler_termios.o: $(WINSUP_H)
fhandler_tty.o: $(WINSUP_H)
fhandler_windows.o: $(WINSUP_H)
fhandler_raw.o: $(WINSUP_H)
fhandler_floppy.o: $(WINSUP_H)
fhandler_tape.o: $(WINSUP_H)
fhandler_zero.o: $(WINSUP_H)
fhandler_random.o: $(WINSUP_H)
fork.o: $(WINSUP_H) dll_init.h
glob.o: include/glob.h
gmon.o: profil.h gmon.h
grp.o: $(WINSUP_H)
heap.o: $(WINSUP_H)
dtable.o: $(WINSUP_H)
init.o: $(WINSUP_H)
ioctl.o: $(WINSUP_H)
libccrt0.o: $(WINSUP_H)
libcmain.o: $(WINSUP_H)
localtime.o: tz_posixrules.h
malloc.o: $(WINSUP_H) sync.h
mcount.o: gmon.h
mmap.o: $(WINSUP_H)
net.o: $(WINSUP_H) autoload.h
ntea.o:
passwd.o: $(WINSUP_H)
path.o: $(WINSUP_H)
pinfo.o: $(WINSUP_H)
pipe.o: $(WINSUP_H)
poll.o: $(WINSUP_H)
profile.o: profil.h
pthread.o: $(WINSUP_H)
registry.o: $(WINSUP_H)
resource.o: $(WINSUP_H)
scandir.o:
security.o: $(WINSUP_H)
select.o: $(WINSUP_H) select.h
shared.o: $(WINSUP_H)
signal.o: $(WINSUP_H)
sigproc.o: $(WINSUP_H) sync.h
smallprint.o: $(WINSUP_H)
spawn.o: $(WINSUP_H)
strace.o: $(WINSUP_H)
strsep.o:
sync.o: $(WINSUP_H) sync.h
syscalls.o: $(WINSUP_H)
sysconf.o: $(WINSUP_H)
syslog.o: $(WINSUP_H)
termios.o: $(WINSUP_H)
test.o: $(WINSUP_H)
times.o: $(WINSUP_H)
tty.o: $(WINSUP_H)
uinfo.o: $(WINSUP_H) autoload.h
uname.o: $(WINSUP_H)
wait.o: $(WINSUP_H)
window.o: $(WINSUP_H)
thread.o: $(WINSUP_H)
include *.d

View File

@ -16,9 +16,15 @@ details. */
#include "dll_init.h"
#include "autoload.h"
#include <ctype.h>
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "perthread.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "thread.h"
#define MAX_AT_FILE_LEVEL 10

View File

@ -9,8 +9,10 @@ details. */
#define NO_DEBUG_DEFINES
#include "winsup.h"
#include "exceptions.h"
#include "perthread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "perthread.h"
static muto NO_COPY *threadname_lock = NULL;
#define lock_threadname() \

View File

@ -13,11 +13,16 @@ details. */
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include "pinfo.h"
#include "cygerrno.h"
#define _COMPILING_NEWLIB
#include "dirent.h"
#include <dirent.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
/* Cygwin internal */
/* Return whether the directory of a file is writable. Return 1 if it

View File

@ -15,6 +15,9 @@ details. */
#include <ctype.h>
#include "dlfcn.h"
#include "dll_init.h"
#include "fhandler.h"
#include "path.h"
#include "thread.h"
#define _dl_error _reent_winsup()->_dl_error
#define _dl_buffer _reent_winsup()->_dl_buffer

View File

@ -20,9 +20,14 @@ details. */
#include <fcntl.h>
#include <winsock.h>
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "thread.h"
dtable fdtab;

View File

@ -13,7 +13,11 @@ details. */
#include <stddef.h>
#include <ctype.h>
#include <fcntl.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "fhandler.h"
#include "path.h"
#include "cygerrno.h"
extern BOOL allow_glob;

View File

@ -13,6 +13,7 @@ details. */
#include <stdio.h>
#include <errno.h>
#include "cygerrno.h"
#include "thread.h"
/* Table to map Windows error codes to Errno values. */
/* FIXME: Doing things this way is a little slow. It's trivial to change

View File

@ -10,13 +10,16 @@ details. */
#define Win32_Winsock
#include "winsup.h"
#include <stdio.h>
#include <imagehlp.h>
#include <errno.h>
#include "exceptions.h"
#include <imagehlp.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "thread.h"
#include "perthread.h"
char debugger_command[2 * MAX_PATH + 20];

View File

@ -13,6 +13,8 @@ details. */
#include <stdlib.h>
#include <errno.h>
#include <process.h>
#include "fhandler.h"
#include "path.h"
/* This is called _execve and not execve because the real execve is defined
in libc/posix/execve.c. It calls us. */

View File

@ -11,6 +11,9 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
#include "fhandler.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
static external_pinfo *

View File

@ -13,8 +13,10 @@ details. */
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include "fhandler.h"
#include "dtable.h"
#include "cygerrno.h"
#include "thread.h"
extern "C"
int

View File

@ -15,6 +15,8 @@ details. */
#include <stdlib.h>
#include <string.h>
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */

View File

@ -22,8 +22,11 @@ details. */
#include <wingdi.h>
#include <winuser.h>
#include <ctype.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/*
* Scroll the screen context.

View File

@ -14,6 +14,7 @@ details. */
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include "fhandler.h"
/**********************************************************************/
/* fhandler_dev_floppy */

View File

@ -14,6 +14,7 @@ details. */
#include <errno.h>
#include <limits.h>
#include "cygerrno.h"
#include "fhandler.h"
#define RANDOM 8
#define URANDOM 9

View File

@ -17,6 +17,8 @@
#include <cygwin/rdevio.h>
#include <sys/mtio.h>
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
/* static wrapper functions to hide the effect of media changes and
bus resets which occurs after a new media is inserted. This is

View File

@ -13,8 +13,11 @@ details. */
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/**********************************************************************/
/* fhandler_serial */

View File

@ -17,6 +17,8 @@ details. */
#include <sys/mtio.h>
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
/**********************************************************************/
/* fhandler_dev_tape */

View File

@ -14,8 +14,11 @@ details. */
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* Common functions shared by tty/console */

View File

@ -16,9 +16,12 @@ details. */
#include <errno.h>
#include <ctype.h>
#include <limits.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* Tty master stuff */

View File

@ -16,6 +16,7 @@ details. */
#include <wingdi.h>
#include <winuser.h>
#include "cygerrno.h"
#include "fhandler.h"
/*
The following unix-style calls are supported:

View File

@ -12,6 +12,7 @@ details. */
#include "winsup.h"
#include <errno.h>
#include "fhandler.h"
fhandler_dev_zero::fhandler_dev_zero (const char *name)
: fhandler_base (FH_ZERO, name)

View File

@ -16,9 +16,13 @@ details. */
#include <stdarg.h>
#include <errno.h>
#include "dll_init.h"
#include "fhandler.h"
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "perthread.h"
DWORD NO_COPY chunksize = 0;
/* Timeout to wait for child to start, parent to init child, etc. */

View File

@ -15,6 +15,9 @@ details. */
#include <grp.h>
#include <stdio.h>
#include <stdlib.h>
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* Read /etc/group only once for better performance. This is done

View File

@ -10,8 +10,10 @@ details. */
#include "winsup.h"
#include <errno.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#define brksize ((char *) user_data->heaptop - (char *) user_data->heapbase)
#define brk (user_data->heapptr)

View File

@ -10,6 +10,7 @@ details. */
#include "winsup.h"
#include <stdlib.h>
#include "thread.h"
extern HMODULE cygwin_hmodule;

View File

@ -14,11 +14,11 @@ details. */
#include "winsup.h"
#include <sys/ioctl.h>
#include <errno.h>
#include "dtable.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
extern "C"
int
extern "C" int
ioctl (int fd, int cmd, void *buf)
{
if (fdtab.not_open (fd))

View File

@ -13,6 +13,7 @@ details. */
#include "winsup.h"
#include <stdlib.h>
#include "sync.h"
/* we provide these stubs to call into a user's
provided malloc if there is one - otherwise

View File

@ -13,9 +13,13 @@ details. */
#include <stddef.h>
#include <sys/mman.h>
#include <errno.h>
#include "fhandler.h"
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/*
* Simple class used to keep a record of all current

View File

@ -23,9 +23,14 @@ details. */
#include <fcntl.h>
#include "autoload.h"
#include <winsock.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* We only want to initialize WinSock in a child process if socket
handles are inheritted. This global allows us to know whether this

View File

@ -13,9 +13,13 @@ details. */
#include <pwd.h>
#include <stdio.h>
#include <errno.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* Read /etc/passwd only once for better performance. This is done
on the first call that needs information from it. */

View File

@ -81,8 +81,13 @@ details. */
#include <errno.h>
#include <ctype.h>
#include <winioctl.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
static int normalize_win32_path (const char *cwd, const char *src, char *dst);
static char *getcwd_inner (char *buf, size_t ulen, int posix_p, int with_chroot);

View File

@ -108,6 +108,9 @@ int __stdcall get_device_number (const char *name, int &unit, BOOL from_conv = F
int __stdcall slash_unc_prefix_p (const char *path);
int __stdcall check_null_empty_path (const char *name);
const char * __stdcall find_exec (const char *name, path_conv& buf, const char *winenv = "PATH=",
int null_if_notfound = 0, const char **known_suffix = NULL);
/* Common macros for checking for invalid path names */
#define check_null_empty_path_errno(src) \

View File

@ -35,3 +35,79 @@ set_reent (struct _reent *r)
*base = PTMAGIC;
base[-1] = (DWORD) r;
}
#define PER_THREAD_FORK_CLEAR ((void *)0xffffffff)
class per_thread
{
DWORD tls;
int clear_on_fork_p;
public:
per_thread (int forkval = 1) {tls = TlsAlloc (); clear_on_fork_p = forkval;}
DWORD get_tls () {return tls;}
int clear_on_fork () {return clear_on_fork_p;}
virtual void *get () {return TlsGetValue (get_tls ());}
virtual size_t size () {return 0;}
virtual void set (void *s = NULL);
virtual void set (int n) {TlsSetValue (get_tls (), (void *)n);}
virtual void *create ()
{
void *s = new char [size ()];
memset (s, 0, size ());
set (s);
return s;
}
};
class per_thread_waitq : public per_thread
{
public:
per_thread_waitq () : per_thread (0) {}
void *get () {return (waitq *) this->per_thread::get ();}
void *create () {return (waitq *) this->per_thread::create ();}
size_t size () {return sizeof (waitq);}
};
struct vfork_save
{
int pid;
jmp_buf j;
DWORD frame[100];
char **vfork_ebp;
char **vfork_esp;
int is_active () { return pid < 0; }
};
class per_thread_vfork : public per_thread
{
public:
vfork_save *val () { return (vfork_save *) this->per_thread::get (); }
vfork_save *create () {return (vfork_save *) this->per_thread::create ();}
size_t size () {return sizeof (vfork_save);}
};
extern "C" {
struct signal_dispatch
{
int arg;
void (*func) (int);
int sig;
int saved_errno;
DWORD oldmask;
DWORD retaddr;
DWORD *retaddr_on_stack;
};
};
struct per_thread_signal_dispatch : public per_thread
{
signal_dispatch *get () { return (signal_dispatch *) this->per_thread::get (); }
signal_dispatch *create () {return (signal_dispatch *) this->per_thread::create ();}
size_t size () {return sizeof (signal_dispatch);}
};
extern per_thread_waitq waitq_storage;
extern per_thread_vfork vfork_storage;
extern per_thread_signal_dispatch signal_dispatch_storage;
extern per_thread *threadstuff[];

View File

@ -13,9 +13,13 @@ details. */
#include <time.h>
#include <errno.h>
#include <limits.h>
#include "fhandler.h"
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0};

View File

@ -11,6 +11,9 @@ enum
};
#define PSIZE 1024
class ThreadItem;
class _pinfo
{
public:
@ -166,3 +169,4 @@ cygwin_pid (pid_t pid)
return (pid_t) (os_being_run == winNT) ? pid : -(int) pid;
}
void __stdcall pinfo_init (PBYTE);
extern pinfo myself;

View File

@ -12,8 +12,10 @@ details. */
#include <unistd.h>
#include <sys/fcntl.h>
#include <errno.h>
#include "dtable.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
#include "thread.h"
static int
make_pipe (int fildes[2], unsigned int psize, int mode)

View File

@ -11,6 +11,7 @@
#include "winsup.h"
#include <sys/poll.h>
#include <errno.h>
#include "fhandler.h"
#include "dtable.h"
#include "cygerrno.h"

View File

@ -11,6 +11,7 @@
details. */
#include "winsup.h"
#include "thread.h"
extern "C" {
/* ThreadCreation */

View File

@ -14,8 +14,10 @@ details. */
#include "winsup.h"
#include <errno.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
/* add timeval values */
static void

View File

@ -22,9 +22,13 @@ details. */
#include <sys/stat.h>
#include <sys/acl.h>
#include <ctype.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
extern BOOL allow_ntea;
BOOL allow_ntsec = FALSE;
@ -51,11 +55,11 @@ convert_sid_to_string_sid (PSID psid, char *sid_str)
if (!psid || !sid_str)
return NULL;
strcpy (sid_str, "S-1-");
sprintf(t, "%u", GetSidIdentifierAuthority (psid)->Value[5]);
__small_sprintf(t, "%u", GetSidIdentifierAuthority (psid)->Value[5]);
strcat (sid_str, t);
for (i = 0; i < *GetSidSubAuthorityCount (psid); ++i)
{
sprintf(t, "-%lu", *GetSidSubAuthority (psid, i));
__small_sprintf(t, "-%lu", *GetSidSubAuthority (psid, i));
strcat (sid_str, t);
}
return sid_str;
@ -2005,27 +2009,27 @@ acltotext (aclent_t *aclbufp, int aclcnt)
switch (aclbufp[pos].a_type)
{
case USER_OBJ:
sprintf (buf + strlen (buf), "user::%s",
__small_sprintf (buf + strlen (buf), "user::%s",
permtostr (aclbufp[pos].a_perm));
break;
case USER:
sprintf (buf + strlen (buf), "user:%d:%s",
__small_sprintf (buf + strlen (buf), "user:%d:%s",
aclbufp[pos].a_id, permtostr (aclbufp[pos].a_perm));
break;
case GROUP_OBJ:
sprintf (buf + strlen (buf), "group::%s",
__small_sprintf (buf + strlen (buf), "group::%s",
permtostr (aclbufp[pos].a_perm));
break;
case GROUP:
sprintf (buf + strlen (buf), "group:%d:%s",
__small_sprintf (buf + strlen (buf), "group:%d:%s",
aclbufp[pos].a_id, permtostr (aclbufp[pos].a_perm));
break;
case CLASS_OBJ:
sprintf (buf + strlen (buf), "mask::%s",
__small_sprintf (buf + strlen (buf), "mask::%s",
permtostr (aclbufp[pos].a_perm));
break;
case OTHER_OBJ:
sprintf (buf + strlen (buf), "other::%s",
__small_sprintf (buf + strlen (buf), "other::%s",
permtostr (aclbufp[pos].a_perm));
break;
default:

View File

@ -33,8 +33,12 @@ details. */
#include <stdio.h>
#include <winsock.h>
#include "select.h"
#include "dtable.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "perthread.h"
/*
* All these defines below should be in sys/types.h

View File

@ -14,6 +14,8 @@ details. */
#include <stdlib.h>
#include <grp.h>
#include <pwd.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#define SHAREDVER (unsigned)(cygwin_version.api_major << 16 | \

View File

@ -86,9 +86,6 @@ void __stdcall init_child_info (DWORD, child_info *, int, HANDLE);
extern child_info_fork *child_proc_info;
/* Process info for this process */
extern pinfo myself;
/* non-NULL if this process is a child of a cygwin process */
extern HANDLE parent_alive;

View File

@ -13,8 +13,10 @@ details. */
#include "winsup.h"
#include <errno.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
extern "C"
_sig_func_ptr

View File

@ -16,8 +16,11 @@ details. */
#include <sys/wait.h>
#include <errno.h>
#include <stdlib.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "perthread.h"
extern BOOL allow_ntsec;

View File

@ -32,8 +32,6 @@ typedef struct struct_waitq
HANDLE thread_ev;
} waitq;
class muto;
struct sigthread
{
DWORD id;

View File

@ -20,9 +20,14 @@ details. */
#include <winuser.h>
#include <ctype.h>
#include <paths.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#include "perthread.h"
extern BOOL allow_ntsec;

View File

@ -14,6 +14,8 @@ details. */
#include <wingdi.h>
#include <winuser.h>
#include <ctype.h>
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#define PROTECT(x) x[sizeof(x)-1] = 0

View File

@ -20,6 +20,7 @@ details. */
#include <sys/wait.h>
#include <errno.h>
#include <stdlib.h>
#include "sync.h"
muto NO_COPY muto_start;

View File

@ -24,9 +24,14 @@ details. */
#include <unistd.h>
#include <winnls.h>
#include <lmcons.h> /* for UNLEN */
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "dtable.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
extern BOOL allow_ntsec;

View File

@ -13,6 +13,7 @@ details. */
#include <errno.h>
#include <time.h>
#include <limits.h>
#include "fhandler.h"
#include "dtable.h"
#include "cygerrno.h"

View File

@ -14,8 +14,10 @@ details. */
#include <syslog.h>
#include <stdarg.h>
#include <unistd.h>
#include "fhandler.h"
#include "dtable.h"
#include "cygerrno.h"
#include "thread.h"
/* FIXME: These should probably be in the registry. */
/* FIXME: The Win95 path should be whatever slash is */

View File

@ -13,8 +13,9 @@ details. */
#include "winsup.h"
#include <errno.h>
#include "dtable.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
/* tcsendbreak: POSIX 7.2.2.1 */
extern "C"

View File

@ -20,6 +20,9 @@ details. */
#include <assert.h>
#include <stdlib.h>
#include <syslog.h>
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
extern int threadsafe;

View File

@ -43,9 +43,8 @@ extern "C"
#include <pthread.h>
#include <pwd.h>
#include <grp.h>
#include <stdio.h>
#define _NOMNTENT_FUNCS
#include <mntent.h>
#include <time.h>
extern "C" {

View File

@ -16,8 +16,13 @@ details. */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
#define FACTOR (0x19db1ded53ea710LL)
#define NSPERSEC 10000000LL

View File

@ -14,9 +14,12 @@ details. */
#include <utmp.h>
#include <wingdi.h>
#include <winuser.h>
#include "dtable.h"
#include "pinfo.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "dtable.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
extern fhandler_tty_master *tty_master;

View File

@ -18,6 +18,9 @@ details. */
#include <stdlib.h>
#include <wchar.h>
#include <lm.h>
#include "thread.h"
#include "sync.h"
#include "sigproc.h"
#include "pinfo.h"
char *

View File

@ -13,6 +13,9 @@ details. */
#include <stdlib.h>
#include <errno.h>
#include "cygerrno.h"
#include "sync.h"
#include "sigproc.h"
#include "perthread.h"
/* This is called _wait and not wait because the real wait is defined
in libc/syscalls/syswait.c. It calls us. */

View File

@ -107,17 +107,12 @@ extern int dynamically_loaded;
#define __CONDSETF(n, what, x, prefix) \
((n) ? __SETF (what, x, prefix) : __CLEARF (what, x, prefix))
#include "thread.h"
#include "shared.h"
extern HANDLE hMainThread;
extern HANDLE hMainProc;
#include "debug.h"
#include "sync.h"
#include "sigproc.h"
#include "fhandler.h"
#include "path.h"
#include <sys/cygwin.h>
/********************** Application Interface **************************/
@ -155,84 +150,6 @@ extern host_dependent_constants host_dependent;
/* Events/mutexes */
extern HANDLE title_mutex;
/*************************** Per Thread ******************************/
#define PER_THREAD_FORK_CLEAR ((void *)0xffffffff)
class per_thread
{
DWORD tls;
int clear_on_fork_p;
public:
per_thread (int forkval = 1) {tls = TlsAlloc (); clear_on_fork_p = forkval;}
DWORD get_tls () {return tls;}
int clear_on_fork () {return clear_on_fork_p;}
virtual void *get () {return TlsGetValue (get_tls ());}
virtual size_t size () {return 0;}
virtual void set (void *s = NULL);
virtual void set (int n) {TlsSetValue (get_tls (), (void *)n);}
virtual void *create ()
{
void *s = new char [size ()];
memset (s, 0, size ());
set (s);
return s;
}
};
class per_thread_waitq : public per_thread
{
public:
per_thread_waitq () : per_thread (0) {}
void *get () {return (waitq *) this->per_thread::get ();}
void *create () {return (waitq *) this->per_thread::create ();}
size_t size () {return sizeof (waitq);}
};
struct vfork_save
{
int pid;
jmp_buf j;
DWORD frame[100];
char **vfork_ebp;
char **vfork_esp;
int is_active () { return pid < 0; }
};
class per_thread_vfork : public per_thread
{
public:
vfork_save *val () { return (vfork_save *) this->per_thread::get (); }
vfork_save *create () {return (vfork_save *) this->per_thread::create ();}
size_t size () {return sizeof (vfork_save);}
};
extern "C" {
struct signal_dispatch
{
int arg;
void (*func) (int);
int sig;
int saved_errno;
DWORD oldmask;
DWORD retaddr;
DWORD *retaddr_on_stack;
};
};
struct per_thread_signal_dispatch : public per_thread
{
signal_dispatch *get () { return (signal_dispatch *) this->per_thread::get (); }
signal_dispatch *create () {return (signal_dispatch *) this->per_thread::create ();}
size_t size () {return sizeof (signal_dispatch);}
};
extern per_thread_waitq waitq_storage;
extern per_thread_vfork vfork_storage;
extern per_thread_signal_dispatch signal_dispatch_storage;
extern per_thread *threadstuff[];
/**************************** Convenience ******************************/
#define NO_COPY __attribute__((section(".data_cygwin_nocopy")))
@ -316,9 +233,6 @@ extern int cygwin_finished_initializing;
/**************************** Miscellaneous ******************************/
const char * __stdcall find_exec (const char *name, path_conv& buf, const char *winenv = "PATH=",
int null_if_notfound = 0, const char **known_suffix = NULL);
/* File manipulation */
int __stdcall set_process_privileges ();
int __stdcall get_file_attribute (int, const char *, int *,
@ -349,6 +263,7 @@ extern "C" int _spawnve (HANDLE hToken, int mode, const char *path,
extern void __stdcall exec_fixup_after_fork ();
class _pinfo;
/* For mmaps across fork(). */
int __stdcall recreate_mmaps_after_fork (void *);
void __stdcall set_child_mmap_ptr (_pinfo *);