summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscottc <scottc>2002-09-03 13:52:06 +0000
committerscottc <scottc>2002-09-03 13:52:06 +0000
commit5e557b4b9b9db522a0b584e342d980f8f85aeaa2 (patch)
tree566a561296db9ef330a43db9e8a5c394193df390
parentd41dd3bb324b98e2fe6e35c9b03cbbb9f098f2c2 (diff)
downloadgdb-5e557b4b9b9db522a0b584e342d980f8f85aeaa2.tar.gz
Merged changes from HEAD
-rw-r--r--winsup/cygwin/ChangeLog44
-rw-r--r--winsup/cygwin/autoload.cc2
-rw-r--r--winsup/cygwin/cygwin.din52
-rw-r--r--winsup/cygwin/dcrt0.cc2
-rw-r--r--winsup/cygwin/fhandler.h2
-rw-r--r--winsup/cygwin/fhandler_proc.cc12
-rw-r--r--winsup/cygwin/fhandler_process.cc17
-rw-r--r--winsup/cygwin/fhandler_tty.cc17
-rw-r--r--winsup/cygwin/include/cygwin/version.h4
-rw-r--r--winsup/cygwin/select.cc34
-rw-r--r--winsup/cygwin/shared.cc1
11 files changed, 65 insertions, 122 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b3e509073b4..62b649679b2 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,14 +1,44 @@
-2002-08-29 Conrad Scott <conrad.scott@dsl.pipex.com>
+2002-09-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
- * safe_memory.h: Replace #include <new> with an explicit
- definition of the placement new operator.
- (safe_delete): Remove unnecessary ## operator.
+ * cygwin.din: Revert exporting new wchar functions.
+ * include/cygwin/version.h: Change comment for API minor 62.
+
+2002-09-02 Christopher Faylor <cgf@redhat.com>
+
+ * dcrt0.cc (dll_crt0_1): Remove getpagesize() call.
+ * shared.cc (memory_init): Move it here.
+
+2002-08-31 Christopher January <chris@atomice.net>
+
+ * fhandler_proc.cc: Add <sys/param.h> include.
+ (format_proc_uptime): Use KernelTime and UserTime only as they include
+ the other counters.
+ (format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime
+ from KernelTime. Make number of 'jiffies' per second same as HZ define.
+ * fhandler_process.cc: Add <sys/param.h> include.
+ (format_process_stat): Make number of 'jiffies' per second same as
+ HZ define. Use KernelTime and UserTime only to calculate start_time.
+
+2002-08-30 Christopher Faylor <cgf@redhat.com>
+
+ (inspired by a patch from Egor Duda)
+ * select.cc (fhandler_tty_slave::ready_for_read): Remove.
+ * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
+ * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't
+ need ready for read" flag.
+ (fhandler_tty_slave::read): Don't do anything special with vtime when
+ vmin == 0.
+
+2002-07-25 Egor Duda <deo@logos-m.ru>
+
+ * autoload.cc (GetConsoleWindow): Correct parameter count.
2002-08-30 Christopher January <chris@atomice.net>
Christopher Faylor <cgf@redhat.com>
* tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available.
Call FindWindow in a loop.
+ * autoload.cc (GetConsoleWindow): Export
2002-08-30 Christopher Faylor <cgf@redhat.com>
@@ -16,6 +46,12 @@
length iov_len.
(check_iovec_for_write): Ditto.
+2002-08-29 Conrad Scott <conrad.scott@dsl.pipex.com>
+
+ * safe_memory.h: Replace #include <new> with an explicit
+ definition of the placement new operator.
+ (safe_delete): Remove unnecessary ## operator.
+
2002-08-27 Conrad Scott <conrad.scott@dsl.pipex.com>
* fhandler.h (fhandler_base::readv): New method.
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 0c0334f1106..7c3f47fc66e 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -494,7 +494,7 @@ LoadDLLfunc (CoCreateInstance, 20, ole32)
LoadDLLfuncEx (CancelIo, 4, kernel32, 1)
LoadDLLfuncEx (CreateHardLinkA, 12, kernel32, 1)
LoadDLLfuncEx (CreateToolhelp32Snapshot, 8, kernel32, 1)
-LoadDLLfuncEx (GetConsoleWindow, 4, kernel32, 1)
+LoadDLLfuncEx (GetConsoleWindow, 0, kernel32, 1)
LoadDLLfuncEx2 (IsDebuggerPresent, 0, kernel32, 1, 1)
LoadDLLfuncEx (Process32First, 8, kernel32, 1)
LoadDLLfuncEx (Process32Next, 8, kernel32, 1)
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index cf17eedd7e3..1a9de94c377 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -1031,58 +1031,6 @@ wcscmp
_wcscmp = wcscmp
wcslen
_wcslen = wcslen
-wcscat
-_wcscat = wcscat
-wcschr
-_wcschr = wcschr
-wcscpy
-_wcscpy = wcscpy
-wcscspn
-_wcscspn = wcscspn
-wcslcat
-_wcslcat = wcslcat
-wcslcpy
-_wcslcpy = wcslcpy
-wcsncat
-_wcsncat = wcsncat
-wcsncmp
-_wcsncmp = wcsncmp
-wcsncpy
-_wcsncpy = wcsncpy
-wcspbrk
-_wcspbrk = wcspbrk
-wcsrchr
-_wcsrchr = wcsrchr
-wcsspn
-_wcsspn = wcsspn
-wcsstr
-_wcsstr = wcsstr
-wmemchr
-_wmemchr = wmemchr
-wmemcmp
-_wmemcmp = wmemcmp
-wmemcpy
-_wmemcpy = wmemcpy
-wmemmove
-_wmemmove = wmemmove
-wmemset
-_wmemset = wmemset
-btowc
-_btowc = btowc
-wctob
-_wctob = wctob
-mbsinit
-_mbsinit = mbsinit
-mbrlen
-_mbrlen = mbrlen
-mbrtowc
-_mbrtowc = mbrtowc
-mbsrtowcs
-_mbsrtowcs = mbsrtowcs
-wcrtomb
-_wcrtomb = wcrtomb
-wcsrtombs
-_wcsrtombs = wcsrtombs
wprintf
_wprintf = wprintf
memccpy
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index cfc95833009..03618310639 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -566,8 +566,6 @@ dll_crt0_1 ()
user_data->resourcelocks->Init ();
user_data->threadinterface->Init (user_data->forkee);
- (void) getpagesize (); /* initialize page size constant */
-
mainthread.init ("mainthread"); // For use in determining if signals
// should be blocked.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index a63c0514e2b..786c2ad0245 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -888,8 +888,6 @@ class fhandler_tty_slave: public fhandler_tty_common
__off64_t lseek (__off64_t, int) { return 0; }
select_record *select_read (select_record *s);
- int ready_for_read (int fd, DWORD howlong);
-
int cygserver_attach_tty (HANDLE*, HANDLE*);
};
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 97b8a1751f6..417b59a25e0 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -23,6 +23,7 @@ details. */
#include "cygheap.h"
#include <assert.h>
#include <sys/utsname.h>
+#include <sys/param.h>
#include "ntdll.h"
#define _COMPILING_NEWLIB
@@ -423,9 +424,8 @@ format_proc_uptime (char *destbuf, size_t maxsize)
else
{
idle_time = spt.IdleTime.QuadPart / 100000ULL;
- uptime = (spt.InterruptTime.QuadPart + spt.KernelTime.QuadPart +
- spt.IdleTime.QuadPart + spt.UserTime.QuadPart +
- spt.DpcTime.QuadPart) / 100000ULL;
+ uptime = (spt.KernelTime.QuadPart +
+ spt.UserTime.QuadPart) / 100000ULL;
}
return __small_sprintf (destbuf, "%U.%02u %U.%02u\n",
@@ -467,9 +467,9 @@ format_proc_stat (char *destbuf, size_t maxsize)
ret, RtlNtStatusToDosError (ret));
return 0;
}
- kernel_time = (spt.KernelTime.QuadPart + spt.InterruptTime.QuadPart + spt.DpcTime.QuadPart) / 100000ULL;
- user_time = spt.UserTime.QuadPart / 100000ULL;
- idle_time = spt.IdleTime.QuadPart / 100000ULL;
+ kernel_time = (spt.KernelTime.QuadPart - spt.IdleTime.QuadPart) * HZ / 10000000ULL;
+ user_time = spt.UserTime.QuadPart * HZ / 10000000ULL;
+ idle_time = spt.IdleTime.QuadPart * HZ / 10000000ULL;
interrupt_count = spt.InterruptCount;
pages_in = spi.PagesRead;
pages_out = spi.PagefilePagesWritten + spi.MappedFilePagesWritten;
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index dc885820ad6..6f59b2abd47 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -23,6 +23,7 @@ details. */
#include "dtable.h"
#include "cygheap.h"
#include "ntdll.h"
+#include <sys/param.h>
#include <assert.h>
#define _COMPILING_NEWLIB
@@ -454,22 +455,18 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
return 0;
}
fault_count = vmc.PageFaultCount;
- utime = put.UserTime.QuadPart / 100000ULL;
- stime = put.KernelTime.QuadPart / 100000ULL;
+ utime = put.UserTime.QuadPart * HZ / 10000000ULL;
+ stime = put.KernelTime.QuadPart * HZ / 10000000ULL;
if (stodi.CurrentTime.QuadPart > put.CreateTime.QuadPart)
- start_time = (spt.InterruptTime.QuadPart + spt.KernelTime.QuadPart +
- spt.IdleTime.QuadPart + spt.UserTime.QuadPart +
- spt.DpcTime.QuadPart - stodi.CurrentTime.QuadPart +
- put.CreateTime.QuadPart) / 100000ULL;
+ start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart -
+ stodi.CurrentTime.QuadPart + put.CreateTime.QuadPart) * HZ / 10000000ULL;
else
/*
* sometimes stodi.CurrentTime is a bit behind
* Note: some older versions of procps are broken and can't cope
* with process start times > time(NULL).
*/
- start_time = (spt.InterruptTime.QuadPart + spt.KernelTime.QuadPart +
- spt.IdleTime.QuadPart + spt.UserTime.QuadPart +
- spt.DpcTime.QuadPart) / 100000ULL;
+ start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart) * HZ / 10000000ULL;
priority = pbi.BasePriority;
unsigned page_size = getpagesize();
vmsize = vmc.VirtualSize;
@@ -478,7 +475,7 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
}
else
{
- start_time = (GetTickCount() / 1000 - time(NULL) + p->start_time) * 100;
+ start_time = (GetTickCount() / 1000 - time(NULL) + p->start_time) * HZ;
}
return __small_sprintf (destbuf, "%d (%s) %c "
"%d %d %d %d %d "
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index b073c940cad..68a09a2a7c8 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -411,11 +411,13 @@ process_ioctl (void *)
fhandler_tty_slave::fhandler_tty_slave (int num)
: fhandler_tty_common (FH_TTYS, num)
{
+ set_r_no_interrupt (1);
}
fhandler_tty_slave::fhandler_tty_slave ()
: fhandler_tty_common (FH_TTYS, 0)
{
+ set_r_no_interrupt (1);
}
/* FIXME: This function needs to close handles when it has
@@ -651,12 +653,11 @@ fhandler_tty_slave::read (void *ptr, size_t len)
if (vmin > INP_BUFFER_SIZE)
vmin = INP_BUFFER_SIZE;
vtime = get_ttyp ()->ti.c_cc[VTIME];
- if (vmin < 0) vmin = 0;
- if (vtime < 0) vtime = 0;
- if (vmin == 0)
- time_to_wait = INFINITE;
- else
- time_to_wait = (vtime == 0 ? INFINITE : 100 * vtime);
+ if (vmin < 0)
+ vmin = 0;
+ if (vtime < 0)
+ vtime = 0;
+ time_to_wait = vtime == 0 ? INFINITE : 100 * vtime;
}
else
time_to_wait = INFINITE;
@@ -895,8 +896,8 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
{
termios_printf ("ioctl (%x)", cmd);
- if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid &&
- myself->ctty == ttynum && (get_ttyp ()->ti.c_lflag & TOSTOP))
+ if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid
+ && myself->ctty == ttynum && (get_ttyp ()->ti.c_lflag & TOSTOP))
{
/* background process */
termios_printf ("bg ioctl pgid %d, tpgid %d, ctty %d",
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index f4f50e1d5d9..da559156154 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -161,9 +161,7 @@ details. */
60: MSG_NOSIGNAL
61: Export getc_unlocked, getchar_unlocked, putc_unlocked,
putchar_unlocked
- 62: Export wcscat, wcschr, wcscpy, wcscspn, wcslcat, wcslcpy, wcsncat,
- wcsncmp, wcsncpy, wcspbrk, wcsrchr, wcsspn, wcsstr, wmemchr,
- wmemcmp, wmemcpy, wmemmove, wmemset
+ 62: Erroneously bumped.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index c3c4158a406..34fa6c8b375 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -787,40 +787,6 @@ fhandler_tty_slave::select_read (select_record *s)
return s;
}
-int
-fhandler_tty_slave::ready_for_read (int fd, DWORD howlong)
-{
- HANDLE w4[2];
- if (cygheap->fdtab.not_open (fd))
- {
- set_sig_errno (EBADF);
- return 0;
- }
- if (get_readahead_valid ())
- {
- select_printf ("readahead");
- return 1;
- }
- w4[0] = signal_arrived;
- w4[1] = input_available_event;
- switch (WaitForMultipleObjects (2, w4, FALSE, howlong))
- {
- case WAIT_OBJECT_0:
- set_sig_errno (EINTR);
- return 0;
- case WAIT_OBJECT_0 + 1:
- return 1;
- case WAIT_FAILED:
- select_printf ("wait failed %E");
- set_sig_errno (EINVAL); /* FIXME: correct errno? */
- return 0;
- default:
- if (!howlong)
- set_sig_errno (EAGAIN);
- return 0;
- }
-}
-
select_record *
fhandler_dev_null::select_read (select_record *s)
{
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index b6d15f3b34c..3031ae78086 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -146,6 +146,7 @@ memory_init ()
cygheap->shared_h = shared_h;
ProtectHandleINH (cygheap->shared_h);
+ getpagesize ();
heap_init ();
mount_table = (mount_info *) open_shared (user_name, MOUNT_VERSION,
cygwin_mount_h,