4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-01 03:50:28 +08:00

* winsup.h: take out protections of environ, errno, allow C use

* *.cc: put winsup.h before other headers (for __INSIDE_CYGWIN__);
use cur_environ() instead of just environ
* times.cc: remove import protections
* glob.c: add winsup.h
* localtime.c: ditto
* smallprint.c: ditto
* Makefile.in: don't __INSIDE_CYGWIN__ as it messes up profiling.
This commit is contained in:
DJ Delorie 2000-08-02 16:28:18 +00:00
parent ad8dea13f0
commit 4c8d72ded5
60 changed files with 98 additions and 92 deletions

View File

@ -1,3 +1,14 @@
2000-08-02 DJ Delorie <dj@redhat.com>
* winsup.h: take out protections of environ, errno, allow C use
* *.cc: put winsup.h before other headers (for __INSIDE_CYGWIN__);
use cur_environ() instead of just environ
* times.cc: remove import protections
* glob.c: add winsup.h
* localtime.c: ditto
* smallprint.c: ditto
* Makefile.in: don't __INSIDE_CYGWIN__ as it messes up profiling.
Wed Aug 2 11:22:53 2000 Christopher Faylor <cgf@cygnus.com> Wed Aug 2 11:22:53 2000 Christopher Faylor <cgf@cygnus.com>
* include/sys/strace.h: Fix strace definition. * include/sys/strace.h: Fix strace definition.

View File

@ -71,8 +71,6 @@ include $(srcdir)/../Makefile.common
INSTALL_DATA:=$(SHELL) $(updir1)/install-sh -c INSTALL_DATA:=$(SHELL) $(updir1)/install-sh -c
COMPILE_CC+=-D__INSIDE_CYGWIN__
@SET_MAKE@ @SET_MAKE@
# Setup the testing framework, if you have one # Setup the testing framework, if you have one

View File

@ -8,9 +8,9 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
#include "glob.h" #include "glob.h"
#include "exceptions.h" #include "exceptions.h"
#include "dll_init.h" #include "dll_init.h"

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#define _COMPILING_NEWLIB #define _COMPILING_NEWLIB
#include "dirent.h" #include "dirent.h"

View File

@ -8,10 +8,10 @@ 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 "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
#include <ctype.h> #include <ctype.h>
#include "dlfcn.h" #include "dlfcn.h"
#include "dll_init.h" #include "dll_init.h"

View File

@ -6,8 +6,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 <stdlib.h>
#include "winsup.h" #include "winsup.h"
#include <stdlib.h>
#include "exceptions.h" #include "exceptions.h"
#include "dll_init.h" #include "dll_init.h"

View File

@ -10,6 +10,8 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#define Win32_Winsock
#include "winsup.h"
#include <errno.h> #include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <stdlib.h> #include <stdlib.h>
@ -17,8 +19,6 @@ details. */
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#define Win32_Winsock
#include "winsup.h"
#include <winsock.h> #include <winsock.h>
hinfo dtable; hinfo dtable;

View File

@ -7,9 +7,9 @@ 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 "winsup.h"
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
#include <stddef.h> #include <stddef.h>
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
@ -83,7 +83,7 @@ getwinenv (const char *env, const char *in_posix)
{ {
win_env *we = conv_envvars + i; win_env *we = conv_envvars + i;
const char *val; const char *val;
if (!environ || !(val = in_posix ?: getenv(we->name))) if (!cur_environ () || !(val = in_posix ?: getenv(we->name)))
debug_printf ("can't set native for %s since no environ yet", debug_printf ("can't set native for %s since no environ yet",
we->name); we->name);
else if (!envcache || !we->posix || strcmp (val, we->posix)) else if (!envcache || !we->posix || strcmp (val, we->posix))
@ -146,11 +146,11 @@ my_findenv (const char *name, int *offset)
len++; len++;
} }
for (p = environ; *p; ++p) for (p = cur_environ (); *p; ++p)
if (!strncmp (*p, name, len)) if (!strncmp (*p, name, len))
if (*(c = *p + len) == '=') if (*(c = *p + len) == '=')
{ {
*offset = p - environ; *offset = p - cur_environ ();
return (char *) (++c); return (char *) (++c);
} }
return NULL; return NULL;
@ -199,13 +199,13 @@ _addenv (const char *name, const char *value, int overwrite)
char **env; char **env;
/* Search for the end of the environment. */ /* Search for the end of the environment. */
for (env = environ; *env; env++) for (env = cur_environ (); *env; env++)
continue; continue;
offset = env - environ; /* Number of elements currently in environ. */ offset = env - cur_environ (); /* Number of elements currently in environ. */
/* Allocate space for additional element plus terminating NULL. */ /* Allocate space for additional element plus terminating NULL. */
__cygwin_environ = (char **) realloc (environ, (sizeof (char *) * __cygwin_environ = (char **) realloc (cur_environ (), (sizeof (char *) *
(offset + 2))); (offset + 2)));
if (!__cygwin_environ) if (!__cygwin_environ)
return -1; /* Oops. No more memory. */ return -1; /* Oops. No more memory. */
@ -216,7 +216,7 @@ _addenv (const char *name, const char *value, int overwrite)
char *envhere; char *envhere;
if (!issetenv) if (!issetenv)
envhere = environ[offset] = (char *) name; /* Not setenv. Just envhere = cur_environ ()[offset] = (char *) name; /* Not setenv. Just
overwrite existing. */ overwrite existing. */
else else
{ /* setenv */ { /* setenv */
@ -226,7 +226,7 @@ _addenv (const char *name, const char *value, int overwrite)
int namelen = p - name; /* Length of name. */ int namelen = p - name; /* Length of name. */
/* Allocate enough space for name + '=' + value + '\0' */ /* Allocate enough space for name + '=' + value + '\0' */
envhere = environ[offset] = (char *) malloc (namelen + valuelen + 2); envhere = cur_environ ()[offset] = (char *) malloc (namelen + valuelen + 2);
if (!envhere) if (!envhere)
return -1; /* Oops. No more memory. */ return -1; /* Oops. No more memory. */
@ -308,7 +308,7 @@ unsetenv (const char *name)
while (my_findenv (name, &offset)) /* if set multiple times */ while (my_findenv (name, &offset)) /* if set multiple times */
/* Move up the rest of the array */ /* Move up the rest of the array */
for (e = environ + offset; ; e++) for (e = cur_environ () + offset; ; e++)
if (!(*e = *(e + 1))) if (!(*e = *(e + 1)))
break; break;
} }

View File

@ -8,9 +8,9 @@ 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 "winsup.h"
#define _REENT_ONLY #define _REENT_ONLY
#include <stdio.h> #include <stdio.h>
#include "winsup.h"
#include <errno.h> #include <errno.h>
/* Table to map Windows error codes to Errno values. */ /* Table to map Windows error codes to Errno values. */

View File

@ -8,11 +8,11 @@ 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. */
#define Win32_Winsock
#include "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#define Win32_Winsock
#include "winsup.h"
#include "exceptions.h" #include "exceptions.h"
#include <imagehlp.h> #include <imagehlp.h>

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <process.h> #include <process.h>
#include "winsup.h"
/* This is called _execve and not execve because the real execve is defined /* This is called _execve and not execve because the real execve is defined
in libc/posix/execve.c. It calls us. */ in libc/posix/execve.c. It calls us. */
@ -44,7 +44,7 @@ execl (const char *path, const char *arg0, ...)
while (argv[i++] != NULL); while (argv[i++] != NULL);
va_end (args); va_end (args);
MALLOC_CHECK; MALLOC_CHECK;
return _execve (path, (char * const *) argv, environ); return _execve (path, (char * const *) argv, cur_environ ());
} }
extern "C" extern "C"
@ -52,7 +52,7 @@ int
execv (const char *path, char * const *argv) execv (const char *path, char * const *argv)
{ {
MALLOC_CHECK; MALLOC_CHECK;
return _execve (path, (char * const *) argv, environ); return _execve (path, (char * const *) argv, cur_environ ());
} }
/* the same as a standard exec() calls family, but with NT security support */ /* the same as a standard exec() calls family, but with NT security support */
@ -85,7 +85,7 @@ sexecl (HANDLE hToken, const char *path, const char *arg0, ...)
va_end (args); va_end (args);
MALLOC_CHECK; MALLOC_CHECK;
return sexecve (hToken, path, (char * const *) argv, environ); return sexecve (hToken, path, (char * const *) argv, cur_environ ());
} }
extern "C" extern "C"
@ -131,7 +131,7 @@ sexeclp (HANDLE hToken, const char *path, const char *arg0, ...)
va_end (args); va_end (args);
MALLOC_CHECK; MALLOC_CHECK;
return sexecvpe (hToken, path, (const char * const *) argv, environ); return sexecvpe (hToken, path, (const char * const *) argv, cur_environ ());
} }
extern "C" extern "C"
@ -163,7 +163,7 @@ int
sexecv (HANDLE hToken, const char *path, const char * const *argv) sexecv (HANDLE hToken, const char *path, const char * const *argv)
{ {
MALLOC_CHECK; MALLOC_CHECK;
return sexecve (hToken, path, argv, environ); return sexecve (hToken, path, argv, cur_environ ());
} }
extern "C" extern "C"
@ -171,7 +171,7 @@ int
sexecp (HANDLE hToken, const char *path, const char * const *argv) sexecp (HANDLE hToken, const char *path, const char * const *argv)
{ {
MALLOC_CHECK; MALLOC_CHECK;
return sexecvpe (hToken, path, argv, environ); return sexecvpe (hToken, path, argv, cur_environ ());
} }
/* /*

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
extern "C" extern "C"
int int

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */ static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */

View File

@ -12,13 +12,13 @@ details. */
Should the constructor call tcinit() explicitly rather than having Should the constructor call tcinit() explicitly rather than having
it sprinkled throughout here? */ it sprinkled throughout here? */
#include "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>
#include <ctype.h> #include <ctype.h>

View File

@ -9,11 +9,11 @@ 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 "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
/**********************************************************************/ /**********************************************************************/
/* fhandler_dev_floppy */ /* fhandler_dev_floppy */

View File

@ -10,9 +10,9 @@ 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 "winsup.h"
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
#define RANDOM 8 #define RANDOM 8
#define URANDOM 9 #define URANDOM 9

View File

@ -8,11 +8,11 @@
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
#include <cygwin/rdevio.h> #include <cygwin/rdevio.h>
#include <sys/mtio.h> #include <sys/mtio.h>

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
/**********************************************************************/ /**********************************************************************/
/* fhandler_serial */ /* fhandler_serial */

View File

@ -9,11 +9,11 @@ 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 "winsup.h"
#include <sys/termios.h> #include <sys/termios.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
#include <sys/mtio.h> #include <sys/mtio.h>

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#include <ctype.h> #include <ctype.h>
/* Common functions shared by tty/console */ /* Common functions shared by tty/console */

View File

@ -8,12 +8,12 @@ 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 "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>

View File

@ -11,8 +11,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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -10,8 +10,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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
fhandler_dev_zero::fhandler_dev_zero (const char *name) fhandler_dev_zero::fhandler_dev_zero (const char *name)
: fhandler_base (FH_ZERO, name) : fhandler_base (FH_ZERO, name)

View File

@ -8,13 +8,13 @@ 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 "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#include "dll_init.h" #include "dll_init.h"
DWORD NO_COPY chunksize = 0; DWORD NO_COPY chunksize = 0;

View File

@ -67,6 +67,8 @@
/* #include "namespace.h" */ /* #include "namespace.h" */
/* end CYGNUS LOCAL */ /* end CYGNUS LOCAL */
#include "winsup.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -11,10 +11,10 @@ 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 "winsup.h"
#include <grp.h> #include <grp.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
/* Read /etc/group only once for better performance. This is done /* Read /etc/group only once for better performance. This is done
on the first call that needs information from it. */ on the first call that needs information from it. */

View File

@ -8,8 +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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#define brksize ((char *) user_data->heaptop - (char *) user_data->heapbase) #define brksize ((char *) user_data->heaptop - (char *) user_data->heapbase)
#define brk (user_data->heapptr) #define brk (user_data->heapptr)

View File

@ -8,8 +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 <stdlib.h>
#include "winsup.h" #include "winsup.h"
#include <stdlib.h>
extern HMODULE cygwin_hmodule; extern HMODULE cygwin_hmodule;

View File

@ -11,9 +11,9 @@ 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 "winsup.h"
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
extern "C" extern "C"
int int

View File

@ -5,6 +5,7 @@
/* Temporarily merged private.h and tzfile.h for ease of management - DJ */ /* Temporarily merged private.h and tzfile.h for ease of management - DJ */
/* CYGNUS LOCAL */ /* CYGNUS LOCAL */
#include "winsup.h"
#define lint #define lint
#include <windows.h> #include <windows.h>

View File

@ -8,12 +8,12 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
/* /*
* Simple class used to keep a record of all current * Simple class used to keep a record of all current

View File

@ -12,14 +12,13 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#define Win32_Winsock
#include "winsup.h"
#include <errno.h> #include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include <unistd.h> #include <unistd.h>
#define Win32_Winsock
#include "winsup.h"
#include <netdb.h> #include <netdb.h>
#include <fcntl.h> #include <fcntl.h>
#include "autoload.h" #include "autoload.h"

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
/* Read /etc/passwd only once for better performance. This is done /* Read /etc/passwd only once for better performance. This is done
on the first call that needs information from it. */ on the first call that needs information from it. */

View File

@ -71,6 +71,7 @@ details. */
c: means c:\. c: means c:\.
*/ */
#include "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/mount.h> #include <sys/mount.h>
@ -78,7 +79,6 @@ details. */
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#include <ctype.h> #include <ctype.h>
#include <winioctl.h> #include <winioctl.h>

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0}; static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0};

View File

@ -8,10 +8,10 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
static int static int
make_pipe (int fildes[2], unsigned int psize, int mode) make_pipe (int fildes[2], unsigned int psize, int mode)

View File

@ -8,8 +8,8 @@
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include <sys/poll.h>
#include "winsup.h" #include "winsup.h"
#include <sys/poll.h>
extern "C" extern "C"
int int

View File

@ -12,8 +12,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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
/* add timeval values */ /* add timeval values */
static void static void

View File

@ -10,10 +10,10 @@
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#include "winsup.h"
#include <dirent.h> #include <dirent.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
extern "C" extern "C"
int int

View File

@ -11,6 +11,7 @@ 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 "winsup.h"
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
@ -20,7 +21,6 @@ details. */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/acl.h> #include <sys/acl.h>
#include "winsup.h"
#include <ctype.h> #include <ctype.h>
extern BOOL allow_ntea; extern BOOL allow_ntea;

View File

@ -20,17 +20,17 @@ details. */
#define __INSIDE_CYGWIN_NET__ #define __INSIDE_CYGWIN_NET__
#define Win32_Winsock #define Win32_Winsock
#include "winsup.h"
#include <errno.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>
#include <wingdi.h>
#include <winuser.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include "winsup.h"
#include <wingdi.h>
#include <winuser.h>
#include <winsock.h> #include <winsock.h>
#include "select.h" #include "select.h"

View File

@ -8,12 +8,12 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include "winsup.h"
#define SHAREDVER (unsigned)(cygwin_version.api_major << 16 | \ #define SHAREDVER (unsigned)(cygwin_version.api_major << 16 | \
cygwin_version.api_minor) cygwin_version.api_minor)

View File

@ -11,8 +11,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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
extern "C" extern "C"
_sig_func_ptr _sig_func_ptr

View File

@ -10,12 +10,12 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
extern BOOL allow_ntsec; extern BOOL allow_ntsec;

View File

@ -8,6 +8,7 @@ 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 "winsup.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -8,6 +8,7 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <unistd.h> #include <unistd.h>
@ -15,7 +16,6 @@ details. */
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>
#include <ctype.h> #include <ctype.h>
@ -921,7 +921,7 @@ spawnl (int mode, const char *path, const char *arg0, ...)
va_end (args); va_end (args);
return _spawnve (NULL, mode, path, (char * const *) argv, environ); return _spawnve (NULL, mode, path, (char * const *) argv, cur_environ ());
} }
extern "C" extern "C"
@ -966,7 +966,7 @@ spawnlp (int mode, const char *path, const char *arg0, ...)
va_end (args); va_end (args);
return spawnvpe (mode, path, (char * const *) argv, environ); return spawnvpe (mode, path, (char * const *) argv, cur_environ ());
} }
extern "C" extern "C"
@ -996,7 +996,7 @@ extern "C"
int int
spawnv (int mode, const char *path, const char * const *argv) spawnv (int mode, const char *path, const char * const *argv)
{ {
return _spawnve (NULL, mode, path, argv, environ); return _spawnve (NULL, mode, path, argv, cur_environ ());
} }
extern "C" extern "C"
@ -1011,7 +1011,7 @@ extern "C"
int int
spawnvp (int mode, const char *path, const char * const *argv) spawnvp (int mode, const char *path, const char * const *argv)
{ {
return spawnvpe (mode, path, argv, environ); return spawnvpe (mode, path, argv, cur_environ ());
} }
extern "C" extern "C"

View File

@ -8,9 +8,9 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include "winsup.h"
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -14,12 +14,12 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include "winsup.h"
muto NO_COPY muto_start; muto NO_COPY muto_start;

View File

@ -8,6 +8,7 @@ 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 "winsup.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/vfs.h> /* needed for statfs */ #include <sys/vfs.h> /* needed for statfs */
#include <fcntl.h> #include <fcntl.h>
@ -20,7 +21,6 @@ details. */
#include <sys/uio.h> #include <sys/uio.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <winnls.h> #include <winnls.h>
#include <lmcons.h> /* for UNLEN */ #include <lmcons.h> /* for UNLEN */

View File

@ -8,11 +8,11 @@ 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 "winsup.h"
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
/* sysconf: POSIX 4.8.1.1 */ /* sysconf: POSIX 4.8.1.1 */
/* Allows a portable app to determine quantities of resources or /* Allows a portable app to determine quantities of resources or

View File

@ -8,12 +8,12 @@ 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 "winsup.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include <unistd.h> #include <unistd.h>
#include "winsup.h"
/* FIXME: These should probably be in the registry. */ /* FIXME: These should probably be in the registry. */
/* FIXME: The Win95 path should be whatever slash is */ /* FIXME: The Win95 path should be whatever slash is */

View File

@ -11,8 +11,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>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
/* tcsendbreak: POSIX 7.2.2.1 */ /* tcsendbreak: POSIX 7.2.2.1 */
extern "C" extern "C"

View File

@ -15,8 +15,8 @@ details. */
#endif #endif
#ifdef _MT_SAFE #ifdef _MT_SAFE
#include <errno.h>
#include "winsup.h" #include "winsup.h"
#include <errno.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -8,10 +8,7 @@ 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. */
/* Hide definitions from the library since they contain the #include "winsup.h"
"dllimport" attribute. */
#define _timezone dummy_timezone
#define _daylight dummy_daylight
#include <time.h> #include <time.h>
#include <sys/times.h> #include <sys/times.h>
#include <sys/timeb.h> #include <sys/timeb.h>
@ -19,12 +16,7 @@ details. */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
#undef _timezone
#undef _daylight
extern time_t _timezone;
extern int _daylight;
#define FACTOR (0x19db1ded53ea710LL) #define FACTOR (0x19db1ded53ea710LL)
#define NSPERSEC 10000000LL #define NSPERSEC 10000000LL

View File

@ -8,10 +8,10 @@ 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 "winsup.h"
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <utmp.h> #include <utmp.h>
#include "winsup.h"
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -8,8 +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 <pwd.h>
#include "winsup.h" #include "winsup.h"
#include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <winnls.h> #include <winnls.h>
#include <utmp.h> #include <utmp.h>

View File

@ -10,9 +10,9 @@ 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 "winsup.h"
#include <stdio.h> #include <stdio.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include "winsup.h"
/* uname: POSIX 4.4.1.1 */ /* uname: POSIX 4.4.1.1 */
extern "C" int extern "C" int

View File

@ -8,10 +8,10 @@ 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 "winsup.h"
#include <sys/wait.h> #include <sys/wait.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "winsup.h"
/* This is called _wait and not wait because the real wait is defined /* This is called _wait and not wait because the real wait is defined
in libc/syscalls/syswait.c. It calls us. */ in libc/syscalls/syswait.c. It calls us. */

View File

@ -10,11 +10,11 @@ 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 "winsup.h"
#include <sys/time.h> #include <sys/time.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "winsup.h"
#include <wingdi.h> #include <wingdi.h>
#include <winuser.h> #include <winuser.h>

View File

@ -14,6 +14,8 @@ details. */
#define __INSIDE_CYGWIN__ #define __INSIDE_CYGWIN__
#ifdef __cplusplus
#define alloca(x) __builtin_alloca (x) #define alloca(x) __builtin_alloca (x)
#define strlen __builtin_strlen #define strlen __builtin_strlen
#define strcpy __builtin_strcpy #define strcpy __builtin_strcpy
@ -502,7 +504,6 @@ void __stdcall update_envptrs ();
char * __stdcall winenv (const char * const *, int); char * __stdcall winenv (const char * const *, int);
extern char **__cygwin_environ, ***main_environ; extern char **__cygwin_environ, ***main_environ;
extern "C" char __stdcall **cur_environ (); extern "C" char __stdcall **cur_environ ();
#define environ (cur_environ ())
/* The title on program start. */ /* The title on program start. */
extern char *old_title; extern char *old_title;
@ -516,8 +517,7 @@ void seterrno (const char *, int line);
#define __seterrno() seterrno (__FILE__, __LINE__) #define __seterrno() seterrno (__FILE__, __LINE__)
#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)
#undef errno
#define errno dont_use_this_since_were_in_a_shared library
#define set_errno(val) (_impure_ptr->_errno = (val)) #define set_errno(val) (_impure_ptr->_errno = (val))
#define get_errno() (_impure_ptr->_errno) #define get_errno() (_impure_ptr->_errno)
extern "C" void __stdcall set_sig_errno (int e); extern "C" void __stdcall set_sig_errno (int e);
@ -535,3 +535,5 @@ class save_errno
extern const char *__sp_fn; extern const char *__sp_fn;
extern int __sp_ln; extern int __sp_ln;
#endif /* defined __cplusplus */