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>2002-08-27 08:10:54 +0400
committerChristopher Faylor <me@cgf.cx>2002-08-27 08:10:54 +0400
commit6d8bd861e2503d0ab3c3cb64016b50700236265b (patch)
tree653c392b174694dbac0b9056e4d87a75a2e864e1 /winsup/cygwin
parent4854ee501ebdb755be22392f8552a05284263a65 (diff)
* child_info.h: Add _PROC_WHOOPS enum value.
(CURR_CHILD_INFO_MAGIC): Update. (child_info::magic): Make 'long'. * cygheap.h: Export _cygheap_start. * cygheap.cc: Don't declare _cygheap_start. * cygmagic: Use cksum to produce checksums. Append 'U' to end of checksum. * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer. (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin version. Set child_proc_info to NULL when _PROC_WHOOPS. (multiple_cygwin_problem): If child_info specific problem, then set child_proc_info type to _PROC_WHOOPS. * shared_info.h (CURR_MOUNT_MAGIC): Update. (CURR_SHARED_MAGIC): Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog17
-rw-r--r--winsup/cygwin/child_info.h11
-rw-r--r--winsup/cygwin/cygheap.cc1
-rw-r--r--winsup/cygwin/cygheap.h1
-rwxr-xr-xwinsup/cygwin/cygmagic10
-rw-r--r--winsup/cygwin/dcrt0.cc17
-rw-r--r--winsup/cygwin/shared_info.h4
7 files changed, 42 insertions, 19 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1e37ce987..5cdfa5737 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,20 @@
+2002-08-27 Christopher Faylor <cgf@redhat.com>
+
+ * child_info.h: Add _PROC_WHOOPS enum value.
+ (CURR_CHILD_INFO_MAGIC): Update.
+ (child_info::magic): Make 'long'.
+ * cygheap.h: Export _cygheap_start.
+ * cygheap.cc: Don't declare _cygheap_start.
+ * cygmagic: Use cksum to produce checksums. Append 'U' to end of
+ checksum.
+ * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
+ (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
+ version. Set child_proc_info to NULL when _PROC_WHOOPS.
+ (multiple_cygwin_problem): If child_info specific problem, then set
+ child_proc_info type to _PROC_WHOOPS.
+ * shared_info.h (CURR_MOUNT_MAGIC): Update.
+ (CURR_SHARED_MAGIC): Ditto.
+
2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
* fhandler.h (fhandler_socket::recvfrom): Fix prototype.
diff --git a/winsup/cygwin/child_info.h b/winsup/cygwin/child_info.h
index 4b68e4281..1aca7247b 100644
--- a/winsup/cygwin/child_info.h
+++ b/winsup/cygwin/child_info.h
@@ -1,6 +1,6 @@
-/* childinfo.h: shared child info for cygwin
+/* child_info.h: shared child info for cygwin
- Copyright 2000, 2002 Red Hat, Inc.
+ Copyright 2000, 2001, 2002 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,7 +14,8 @@ enum
{
_PROC_EXEC,
_PROC_SPAWN,
- _PROC_FORK
+ _PROC_FORK,
+ _PROC_WHOOPS
};
#define OPROC_MAGIC_MASK 0xff00ff00
@@ -28,7 +29,7 @@ enum
#define EXEC_MAGIC_SIZE sizeof(child_info)
-#define CURR_CHILD_INFO_MAGIC 0x8b3c
+#define CURR_CHILD_INFO_MAGIC 0xb3836013U
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between
@@ -39,7 +40,7 @@ public:
DWORD zero[4]; // must be zeroed
DWORD cb; // size of this record
DWORD intro; // improbable string
- unsigned short magic; // magic number unique to child_info
+ unsigned long magic; // magic number unique to child_info
unsigned short type; // type of record, exec, spawn, fork
int cygpid; // cygwin pid of child process
HANDLE subproc_ready; // used for synchronization with parent
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 7ea7a39c3..937c3392c 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -45,7 +45,6 @@ struct cygheap_entry
extern "C" {
static void __stdcall _cfree (void *ptr) __attribute__((regparm(1)));
-extern void *_cygheap_start;
}
inline static void
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index 7cd5becbc..6f81eaa41 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -324,4 +324,5 @@ char *__stdcall cstrdup (const char *) __attribute__ ((regparm(1)));
char *__stdcall cstrdup1 (const char *) __attribute__ ((regparm(1)));
void __stdcall cfree_and_set (char *&, char * = NULL) __attribute__ ((regparm(2)));
void __stdcall cygheap_init ();
+extern DWORD _cygheap_start;
}
diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic
index 387593878..a8ccc8c76 100755
--- a/winsup/cygwin/cygmagic
+++ b/winsup/cygwin/cygmagic
@@ -17,16 +17,14 @@ cat <<EOF > $file_magic
/* autogenerated - do not edit */
#include "$file"
EOF
-if sum -r /dev/null >/dev/null 2>&1; then
- sumit(){ sum -r $*; }
-else
- sumit(){ sum $*; }
-fi
+sumit() {
+ cksum $*
+}
while [ -n "$1" ]; do
define=$1; shift
struct=$1; shift
- sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%x", $1}'`
+ sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%xU", $1}'`
echo "#define $define $sum"
curr=`sed -n "s/^#[ ]*define CURR_$define[ ][ ]*\([^ ][^ ]*\)/\1/p" $file`
[ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 0384275b3..003085dd1 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -796,10 +796,11 @@ initial_env ()
#ifdef DEBUGGING
if (GetEnvironmentVariable ("CYGWIN_SLEEP", buf, sizeof (buf) - 1))
{
+ DWORD ms = atoi (buf);
buf[0] = '\0';
len = GetModuleFileName (NULL, buf, MAX_PATH);
- console_printf ("Sleeping %d, pid %u %s\n", atoi (buf), GetCurrentProcessId (), buf);
- Sleep (atoi (buf));
+ console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf);
+ Sleep (ms);
}
if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1))
{
@@ -872,7 +873,11 @@ _dll_crt0 ()
multiple_cygwin_problem ("proc", child_proc_info->intro, 0);
else if (child_proc_info->intro == PROC_MAGIC_GENERIC
&& child_proc_info->magic != CHILD_INFO_MAGIC)
- multiple_cygwin_problem ("proc", child_proc_info->magic, CHILD_INFO_MAGIC);
+ multiple_cygwin_problem ("proc", child_proc_info->magic,
+ CHILD_INFO_MAGIC);
+ else if (child_proc_info->cygheap != (void *) &_cygheap_start)
+ multiple_cygwin_problem ("cygheap", (DWORD) child_proc_info->cygheap,
+ (DWORD) &_cygheap_start);
unsigned should_be_cb = 0;
switch (child_proc_info->type)
{
@@ -896,6 +901,8 @@ _dll_crt0 ()
}
default:
system_printf ("unknown exec type %d", child_proc_info->type);
+ /* intentionally fall through */
+ case _PROC_WHOOPS:
child_proc_info = NULL;
break;
}
@@ -1071,9 +1078,9 @@ __api_fatal (const char *fmt, ...)
void
multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned version)
{
- if (_cygwin_testing && strstr (what, "proc"))
+ if (_cygwin_testing && (strstr (what, "proc") || strstr (what, "cygheap")))
{
- fork_info = NULL;
+ child_proc_info->type = _PROC_WHOOPS;
return;
}
diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h
index 02a12fff5..945bc17a6 100644
--- a/winsup/cygwin/shared_info.h
+++ b/winsup/cygwin/shared_info.h
@@ -41,7 +41,7 @@ class mount_item
#define MOUNT_VERSION 27 // increment when mount table changes and
#define MOUNT_VERSION_MAGIC CYGWIN_VERSION_MAGIC (MOUNT_MAGIC, MOUNT_VERSION)
-#define CURR_MOUNT_MAGIC 0xf4e5
+#define CURR_MOUNT_MAGIC 0x4fe431cdU
#define MOUNT_INFO_CB 16488
class reg_key;
@@ -138,7 +138,7 @@ public:
#define SHARED_INFO_CB 47112
-#define CURR_SHARED_MAGIC 0x88e
+#define CURR_SHARED_MAGIC 0x29eb8ccdU
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between