Throughout, remove "include <errno.h>" from files which already include

cygerrno.h.
* include/cygwin/config.h (__DYNAMIC_REENT__): Define.
* include/cygwin/version.h: Bump API minor version.
* cygwin.din: Export __getreent
* cygerrno.h: Include errno.h.  Fix places where _impure_ptr is used directly
to store the errno value.
* debug.cc (__set_errno): Ditto.
* errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled.
* signal.cc: Rename _reent_clib to _REENT throughout.
* thread.h (reent_clib): Remove prototype.
* thread.cc (reent_clib): Rename reent_clib to __getreent.  Return _impure_ptr
until MTinterface is initialized.
(reent_winsup): Fix a possible SEGV when _r == NULL.  Return NULL instead.
* MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to keep
signal handling running when fork is called from a thread other than the
mainthread.
This commit is contained in:
Christopher Faylor 2003-06-16 03:24:13 +00:00
parent 753d031f1f
commit c433f4617f
83 changed files with 65 additions and 91 deletions

View File

@ -18,7 +18,6 @@ details. */
#endif #endif
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -16,7 +16,6 @@ details. */
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <getopt.h> #include <getopt.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>

View File

@ -15,7 +15,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -20,7 +20,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>

View File

@ -1,3 +1,27 @@
2003-06-15 Christopher Faylor <cgf@redhat.com>
Throughout, remove "include <errno.h>" from files which already include
cygerrno.h.
2003-06-15 Thomas Pfaff <tpfaff@gmx.net>
* include/cygwin/config.h (__DYNAMIC_REENT__): Define.
* include/cygwin/version.h: Bump API minor version.
* cygwin.din: Export __getreent
* cygerrno.h: Include errno.h. Fix places where _impure_ptr is used
directly to store the errno value.
* debug.cc (__set_errno): Ditto.
* errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled.
* signal.cc: Rename _reent_clib to _REENT throughout.
* thread.h (reent_clib): Remove prototype.
* thread.cc (reent_clib): Rename reent_clib to __getreent. Return
_impure_ptr until MTinterface is initialized.
(reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL
instead.
* MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to
keep signal handling running when fork is called from a thread other
than the mainthread.
2003-06-12 Thomas Pfaff <tpfaff@gmx.net> 2003-06-12 Thomas Pfaff <tpfaff@gmx.net>
* thread.cc (pthread_attr_init): Revert change from 2003-06-11 * thread.cc (pthread_attr_init): Revert change from 2003-06-11

View File

@ -1,6 +1,6 @@
/* cygerrno.h: main Cygwin header file. /* cygerrno.h: main Cygwin header file.
Copyright 2000 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -8,6 +8,8 @@ This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include <errno.h>
void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3))); void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3)));
void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2))); void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2)));
int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ((regparm(2))); int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ((regparm(2)));
@ -16,12 +18,12 @@ int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ (
#define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val) #define __seterrno_from_win_error(val) seterrno_from_win_error (__FILE__, __LINE__, val)
#ifndef DEBUGGING #ifndef DEBUGGING
#define set_errno(val) (_impure_ptr->_errno = (val)) #define set_errno(val) (errno = (val))
#else #else
int __stdcall __set_errno (const char *ln, int ln, int val) __attribute ((regparm(3))); int __stdcall __set_errno (const char *ln, int ln, int val) __attribute ((regparm(3)));
#define set_errno(val) __set_errno (__PRETTY_FUNCTION__, __LINE__, (val)) #define set_errno(val) __set_errno (__PRETTY_FUNCTION__, __LINE__, (val))
#endif #endif
#define get_errno() (_impure_ptr->_errno) #define get_errno() (errno)
extern "C" void __stdcall set_sig_errno (int e); extern "C" void __stdcall set_sig_errno (int e);
class save_errno class save_errno

View File

@ -10,7 +10,6 @@
#include "winsup.h" #include "winsup.h"
#include <string.h> #include <string.h>
#include <errno.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "security.h" #include "security.h"

View File

@ -16,7 +16,6 @@ details. */
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <getopt.h> #include <getopt.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>

View File

@ -18,7 +18,6 @@ details. */
#endif #endif
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -15,7 +15,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -20,7 +20,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>

View File

@ -9,7 +9,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <windows.h> #include <windows.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "exceptions.h" #include "exceptions.h"
#include "security.h" #include "security.h"
#include "cygthread.h" #include "cygthread.h"

View File

@ -26,6 +26,7 @@ __eprintf
__errno __errno
__fpclassifyd __fpclassifyd
__fpclassifyf __fpclassifyf
__getreent
__infinity __infinity
__main __main
__signbitd __signbitd

View File

@ -17,7 +17,6 @@ details. */
#include <limits.h> #include <limits.h>
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>
#include <errno.h>
#include "sigproc.h" #include "sigproc.h"
#include "pinfo.h" #include "pinfo.h"
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -15,7 +15,6 @@ details. */
#include "security.h" #include "security.h"
#include "cygerrno.h" #include "cygerrno.h"
#ifdef DEBUGGING #ifdef DEBUGGING
#include <errno.h>
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"
#include "dtable.h" #include "dtable.h"
@ -222,6 +221,6 @@ int __stdcall
__set_errno (const char *func, int ln, int val) __set_errno (const char *func, int ln, int val)
{ {
debug_printf ("%s:%d val %d", func, ln, val); debug_printf ("%s:%d val %d", func, ln, val);
return _impure_ptr->_errno = val; return errno = val;
} }
#endif /*DEBUGGING*/ #endif /*DEBUGGING*/

View File

@ -12,7 +12,6 @@ details. */
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h>
#define _COMPILING_NEWLIB #define _COMPILING_NEWLIB
#include <dirent.h> #include <dirent.h>

View File

@ -8,7 +8,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "perprocess.h" #include "perprocess.h"
#include "dll_init.h" #include "dll_init.h"

View File

@ -11,7 +11,6 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>

View File

@ -8,7 +8,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#include <ctype.h> #include <ctype.h>

View File

@ -12,9 +12,7 @@ details. */
#define sys_nerr FOOsys_nerr #define sys_nerr FOOsys_nerr
#define _sys_errlist FOO_sys_errlist #define _sys_errlist FOO_sys_errlist
#include "winsup.h" #include "winsup.h"
#define _REENT_ONLY
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "thread.h" #include "thread.h"
#undef _sys_nerr #undef _sys_nerr

View File

@ -10,7 +10,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <imagehlp.h> #include <imagehlp.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "exceptions.h" #include "exceptions.h"

View File

@ -12,7 +12,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <process.h> #include <process.h>
#include "perprocess.h" #include "perprocess.h"
#include "security.h" #include "security.h"

View File

@ -11,7 +11,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"
#include "sigproc.h" #include "sigproc.h"

View File

@ -10,7 +10,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <stdarg.h> #include <stdarg.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -13,7 +13,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <windows.h> #include <windows.h>
#include <wingdi.h> #include <wingdi.h>

View File

@ -12,7 +12,6 @@ details. */
#include <sys/termios.h> #include <sys/termios.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -12,7 +12,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include <windows.h> #include <windows.h>
#include <sys/soundcard.h> #include <sys/soundcard.h>
#include <mmsystem.h> #include <mmsystem.h>

View File

@ -11,7 +11,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <winioctl.h> #include <winioctl.h>
#include <asm/socket.h> #include <asm/socket.h>

View File

@ -9,7 +9,6 @@
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <ntdef.h> #include <ntdef.h>

View File

@ -11,7 +11,6 @@ details. */
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -11,7 +11,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <limits.h> #include <limits.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"

View File

@ -10,7 +10,6 @@
#include "winsup.h" #include "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <cygwin/rdevio.h> #include <cygwin/rdevio.h>

View File

@ -11,7 +11,6 @@ details. */
/* FIXME: Access permissions are ignored at the moment. */ /* FIXME: Access permissions are ignored at the moment. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -13,7 +13,6 @@
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <sys/uio.h> #include <sys/uio.h>

View File

@ -11,7 +11,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/mtio.h> #include <sys/mtio.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -12,7 +12,6 @@ details. */
#include <sys/termios.h> #include <sys/termios.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <ctype.h> #include <ctype.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"

View File

@ -14,7 +14,6 @@ details. */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>

View File

@ -12,7 +12,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -13,7 +13,6 @@ details. */
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"

View File

@ -16,7 +16,6 @@ details. */
#include <wininet.h> #include <wininet.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "pinfo.h" #include "pinfo.h"
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "sigproc.h" #include "sigproc.h"
#include "pinfo.h" #include "pinfo.h"

View File

@ -19,6 +19,7 @@ extern "C" {
#endif #endif
#define _CYGWIN_CONFIG_H #define _CYGWIN_CONFIG_H
#define __DYNAMIC_REENT__
#define __FILENAME_MAX__ (260 - 1 /* NUL */) #define __FILENAME_MAX__ (260 - 1 /* NUL */)
#define _READ_WRITE_RETURN_TYPE _ssize_t #define _READ_WRITE_RETURN_TYPE _ssize_t
#define __LARGE64_FILES 1 #define __LARGE64_FILES 1

View File

@ -207,12 +207,13 @@ details. */
exported symbols like fopen64, which might confuse configure. exported symbols like fopen64, which might confuse configure.
86: Export ftok 86: Export ftok
87: Export vsyslog 87: Export vsyslog
88: Export _getreent
*/ */
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0 #define CYGWIN_VERSION_API_MAJOR 0
#define CYGWIN_VERSION_API_MINOR 87 #define CYGWIN_VERSION_API_MINOR 88
/* There is also a compatibity version number associated with the /* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible shared memory regions. It is incremented when incompatible

View File

@ -13,7 +13,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -18,7 +18,6 @@ details. */
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"
#include "dtable.h" #include "dtable.h"
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "cygheap.h" #include "cygheap.h"
#include "heap.h" #include "heap.h"

View File

@ -13,7 +13,6 @@ details. */
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"

View File

@ -15,7 +15,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <cygwin/msg.h> #include <cygwin/msg.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -13,7 +13,6 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>

View File

@ -12,7 +12,6 @@ details. */
#include <stdlib.h> #include <stdlib.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -53,7 +53,6 @@ details. */
#include <sys/mount.h> #include <sys/mount.h>
#include <mntent.h> #include <mntent.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <winioctl.h> #include <winioctl.h>
#include <wingdi.h> #include <wingdi.h>

View File

@ -11,7 +11,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -12,7 +12,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"

View File

@ -15,7 +15,6 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#define USE_SYS_TYPES_FD_SET #define USE_SYS_TYPES_FD_SET
#include <winsock2.h> #include <winsock2.h>

View File

@ -13,7 +13,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -13,7 +13,6 @@
#include "winsup.h" #include "winsup.h"
#include <dirent.h> #include <dirent.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
extern "C" int extern "C" int

View File

@ -16,7 +16,6 @@
#include "winsup.h" #include "winsup.h"
#include <limits.h> #include <limits.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -15,7 +15,6 @@ details. */
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -15,7 +15,6 @@ details. */
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -16,7 +16,6 @@ details. */
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -20,7 +20,6 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>

View File

@ -15,7 +15,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <cygwin/sem.h> #include <cygwin/sem.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -14,7 +14,6 @@ details. */
#include <stdlib.h> #include <stdlib.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <errno.h>
#include "pinfo.h" #include "pinfo.h"
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -16,7 +16,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -12,7 +12,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"
#include <sys/cygwin.h> #include <sys/cygwin.h>
@ -297,8 +296,8 @@ abort (void)
be flushed. be flushed.
However this is the way FreeBSD does it, and it is much easier to However this is the way FreeBSD does it, and it is much easier to
do things this way, so... */ do things this way, so... */
if (_reent_clib ()->__cleanup) if (_REENT->__cleanup)
_reent_clib ()->__cleanup (_reent_clib ()); _REENT->__cleanup (_REENT);
/* Ensure that SIGABRT can be caught regardless of blockage. */ /* Ensure that SIGABRT can be caught regardless of blockage. */
sigset_t sig_mask; sigset_t sig_mask;

View File

@ -14,7 +14,6 @@ details. */
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>
#include <assert.h> #include <assert.h>

View File

@ -14,7 +14,6 @@ details. */
#include <unistd.h> #include <unistd.h>
#include <process.h> #include <process.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -14,7 +14,6 @@ details. */
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include "pinfo.h" #include "pinfo.h"
#include "perprocess.h" #include "perprocess.h"
#include "cygwin_version.h" #include "cygwin_version.h"

View File

@ -29,7 +29,6 @@ details. */
#include <process.h> #include <process.h>
#include <utmp.h> #include <utmp.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <unistd.h> #include <unistd.h>
#include <setjmp.h> #include <setjmp.h>

View File

@ -10,7 +10,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <time.h> #include <time.h>
#include <limits.h> #include <limits.h>
#include <ntdef.h> #include <ntdef.h>

View File

@ -14,7 +14,6 @@ details. */
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"
#include "path.h" #include "path.h"

View File

@ -12,7 +12,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"

View File

@ -45,16 +45,21 @@ details. */
extern int threadsafe; extern int threadsafe;
struct _reent * extern "C" struct _reent *
_reent_clib () __getreent ()
{ {
struct __reent_t *_r = struct __reent_t *_r =
(struct __reent_t *) MT_INTERFACE->reent_key.get (); (struct __reent_t *) MT_INTERFACE->reent_key.get ();
#ifdef _CYG_THREAD_FAILSAFE
if (_r == 0) if (_r == 0)
system_printf ("local thread storage not inited"); {
#ifdef _CYG_THREAD_FAILSAFE
system_printf ("local thread storage not inited");
#endif #endif
/* Return _impure_ptr as long as MTinterface is not initialized */
return _impure_ptr;
}
return _r->_clib; return _r->_clib;
} }
@ -64,10 +69,14 @@ _reent_winsup ()
struct __reent_t *_r = struct __reent_t *_r =
(struct __reent_t *) MT_INTERFACE->reent_key.get (); (struct __reent_t *) MT_INTERFACE->reent_key.get ();
#ifdef _CYG_THREAD_FAILSAFE
if (_r == 0) if (_r == 0)
system_printf ("local thread storage not inited"); {
#ifdef _CYG_THREAD_FAILSAFE
system_printf ("local thread storage not inited");
#endif #endif
return NULL;
}
return _r->_winsup; return _r->_winsup;
} }
@ -212,6 +221,20 @@ MTinterface::fixup_after_fork (void)
{ {
pthread_key::fixup_after_fork (); pthread_key::fixup_after_fork ();
#ifndef __SIGNALS_ARE_MULTITHREADED__
/* As long as the signal handling not multithreaded
switch reents storage back to _impure_ptr for the mainthread
to support fork from threads other than the mainthread */
struct _reent *reent_old = __getreent ();
if (reent_old && _impure_ptr != reent_old)
*_impure_ptr = *reent_old;
reents._clib = _impure_ptr;
reents._winsup = &winsup_reent;
winsup_reent._process_logmask = LOG_UPTO (LOG_DEBUG);
reent_key.set (&reents);
#endif
threadcount = 1; threadcount = 1;
pthread::init_mainthread (); pthread::init_mainthread ();

View File

@ -110,7 +110,6 @@ struct __reent_t
struct _winsup_t *_winsup; struct _winsup_t *_winsup;
}; };
_reent *_reent_clib ();
_winsup_t *_reent_winsup (); _winsup_t *_reent_winsup ();
void SetResourceLock (int, int, const char *) __attribute__ ((regparm (3))); void SetResourceLock (int, int, const char *) __attribute__ ((regparm (3)));
void ReleaseResourceLock (int, int, const char *) void ReleaseResourceLock (int, int, const char *)

View File

@ -15,7 +15,6 @@ details. */
#include <utime.h> #include <utime.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "security.h" #include "security.h"
#include "fhandler.h" #include "fhandler.h"

View File

@ -9,7 +9,6 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <utmp.h> #include <utmp.h>
#include <wingdi.h> #include <wingdi.h>

View File

@ -17,7 +17,6 @@ details. */
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#include <lm.h> #include <lm.h>
#include <errno.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>
#include "pinfo.h" #include "pinfo.h"
#include "security.h" #include "security.h"

View File

@ -11,7 +11,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <sys/wait.h> #include <sys/wait.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "sigproc.h" #include "sigproc.h"
#include "perthread.h" #include "perthread.h"

View File

@ -13,7 +13,6 @@ details. */
#include "winsup.h" #include "winsup.h"
#include <sys/time.h> #include <sys/time.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include <signal.h> #include <signal.h>
#include <limits.h> #include <limits.h>
#include <wingdi.h> #include <wingdi.h>