Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-08-22 21:50:22 +0400
committerChristopher Faylor <me@cgf.cx>2001-08-22 21:50:22 +0400
commit0a047e8f321216f24140ee18135bbe9ea4461f0a (patch)
treee8bc85a9d7a597f57dccb8ec64e0ff8a479c2249 /winsup/cygwin/smallprint.c
parent1fdc8df95d7723d278daf4c3ce2f856d8d1db276 (diff)
* smallprint.c (console_printf): New function.
* dcrt0.cc (dll_crt0_1): Use console_printf for debugging output. * debug.cc (debug_mark_closed): New function. (close_handle): Use debug_mark_closed. * debug.h: Declare new functions. * dtable.cc (dtable::build_fhandler): Remove unneeded extern. * spawn.cc: Cosmetic changes. * winsup.h: Define NO_COPY for C files, too. Declare a global.
Diffstat (limited to 'winsup/cygwin/smallprint.c')
-rw-r--r--winsup/cygwin/smallprint.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/winsup/cygwin/smallprint.c b/winsup/cygwin/smallprint.c
index 54ae9b0a8..7e23d1a6d 100644
--- a/winsup/cygwin/smallprint.c
+++ b/winsup/cygwin/smallprint.c
@@ -181,7 +181,7 @@ __small_sprintf (char *dst, const char *fmt,...)
void
small_printf (const char *fmt,...)
{
- char buf[2000];
+ char buf[16384];
va_list ap;
DWORD done;
int count;
@@ -199,6 +199,29 @@ small_printf (const char *fmt,...)
count = __small_vsprintf (buf, fmt, ap);
va_end (ap);
- WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, count, &done, 0);
+ WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, count, &done, NULL);
FlushFileBuffers (GetStdHandle (STD_ERROR_HANDLE));
}
+
+#ifdef DEBUGGING
+static HANDLE NO_COPY console_handle = NULL;
+void
+console_printf (const char *fmt,...)
+{
+ char buf[16384];
+ va_list ap;
+ DWORD done;
+ int count;
+ extern SECURITY_ATTRIBUTES sec_none;
+
+ if (!console_handle)
+ console_handle = CreateFileA ("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE,
+ &sec_none, OPEN_EXISTING, 0, 0);
+ va_start (ap, fmt);
+ count = __small_vsprintf (buf, fmt, ap);
+ va_end (ap);
+
+ WriteFile (console_handle, buf, count, &done, NULL);
+ FlushFileBuffers (console_handle);
+}
+#endif