* Makefile.in: Use variables rather than configure constructs where

appropriate.
(LIBCOS): Find additional stub library stuff in their own subdirectory.
* dcrt0.cc: Convert user_data pointer to static __cygwin_user_data area.
(do_global_ctors): Check magic_bisquit for initialization.
(dll_crt0_1): First group of premain functions prior to fd initialization.  Run
second group before calling main.
(dll_crt0 ()): New function, called from new initialization code.
(dll_crt0 (per_process *uptr)): Call new dll_crt0 () function on
initialization.
* debug.cc (thread_stub): Initialize bottom of stack with per-thread info.
* environ.cc (parse_thing): Use binmode global to control CYGWIN=binmode
behavior.
* fhandler.cc (fhandler_base::open): Allow explicit setting of __fmode to
O_BINARY or O_TEXT to override disk mount settings.
* libcmain.cc: Move to lib subdirectory.
* libccrt0.cc: Ditto.
* dll_main.cc: Ditto.
* dll_entry.cc: Ditto.
* getopt.c: Ditto.
* thread.cc (thread_init_wrapper): Call ExitThread explicitly rather than
returning, as a preliminary step towards placing per thread info at the bottom
of the stack.
* winsup.h: Move per_process class to include/sys/cygwin.h.  Declare new
dll_crt0().
* include/cygwin/version.h: Bump API minor version.
* binmode.c: New file.
* textmode.c: Ditto.
* lib/_cygwin_crt0_common.cc: Ditto.
* lib/crt0.h: Ditto.
* lib/cygwin_attach_dll.c: Ditto.
* lib/cygwin_crt0.c: Ditto.
* lib/dll_entry.cc: Ditto.
* lib/dll_main.cc: Ditto.
* lib/getopt.c: Ditto.
* lib/libcmain.c: Ditto.
* lib/premain0.c: Ditto.
* lib/premain1.c: Ditto.
* lib/premain2.c: Ditto.
* lib/premain3.c: Ditto.
This commit is contained in:
Christopher Faylor
2000-07-01 03:51:55 +00:00
parent 86e25f234a
commit 14a3bc2fa1
26 changed files with 455 additions and 223 deletions

View File

@ -18,6 +18,8 @@ static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
static char fhandler_disk_dummy_name[] = "some disk file";
DWORD binmode;
int
fhandler_base::puts_readahead (const char *s, size_t len = (size_t) -1)
{
@ -352,10 +354,14 @@ fhandler_base::open (int flags, mode_t mode)
int bin;
if (flags & (O_BINARY | O_TEXT))
bin = flags & O_TEXT ? 0 : O_BINARY;
else if (__fmode & O_BINARY)
bin = O_BINARY;
else if (__fmode & O_TEXT)
bin = O_TEXT;
else if (get_device () == FH_DISK)
bin = get_w_binary () || get_r_binary ();
else
bin = (__fmode & O_BINARY) || get_w_binary () || get_r_binary ();
bin = binmode || get_w_binary () || get_r_binary ();
set_r_binary (bin);
set_w_binary (bin);