? cygserver_sem.cc
? cygserver_sem.h
? cygstrptime.patch
? daemonstate.patch
? daemonstate2.patch
? daemonstate3.patch
? exportipc.patch
? t
? getsem.patch
? how-cygwin-options-work.txt
? key_t.patch
? localworkingstuff.patch
? merge.log
? new
? sem.cc
? perthread.cc
? profiling.diff
? t.t
? how-profiling-works.txt
? run_dtors.patch
? include/sys/sem.h
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.87
diff -u -p -r1.87 Makefile.in
--- Makefile.in	18 May 2002 06:10:16 -0000	1.87
+++ Makefile.in	24 May 2002 11:29:00 -0000
@@ -47,13 +47,15 @@ INSTALL_PROGRAM:=@INSTALL_PROGRAM@
 MT_SAFE:=@MT_SAFE@
 DEFS:=@DEFS@
 
-CC:=@CC@
+CC:=@CC@ -pg -Dregparm\(x\)=unused
+CCNOPROF:=@CC@
 # FIXME: Which is it, CC or CC_FOR_TARGET?
 CC_FOR_TARGET:=$(CC)
 CFLAGS:=@CFLAGS@
 CFLAGS+=-MMD -fbuiltin
-CXX:=@CXX@
+CXX:=@CXX@ -pg -Dregparm\(x\)=unused
 CXXFLAGS:=@CXXFLAGS@
+CXXNOPROF:=@CXX@
 
 # For linking mount, etc. crt0.o isn't accessable in a fresh build.
 EXE_LDFLAGS:=@EXE_LDFLAGS@
@@ -111,6 +113,9 @@ LIBCOS:=${sort ${addsuffix .o,${basename
 
 EXTRA_DLL_OFILES:=${addsuffix .o,${basename ${notdir ${wildcard $(CONFIG_DIR)/*.c}}}}
 
+# Profile cygwin1.dll
+EXTRA_DLL_OFILES+= $(LIBGMON_A) $(GMON_START)
+
 EXTRA_OFILES=$(bupdir1)/libiberty/random.o $(bupdir1)/libiberty/strsignal.o
 
 MALLOC_OFILES=@MALLOC_OFILES@
@@ -128,9 +133,12 @@ DLL_OFILES:=assert.o autoload.o cygheap.
 	fhandler_tape.o fhandler_termios.o fhandler_tty.o fhandler_virtual.o \
 	fhandler_windows.o fhandler_zero.o fnmatch.o fork.o glob.o grp.o \
 	heap.o init.o ioctl.o ipc.o localtime.o malloc.o miscfuncs.o mmap.o \
-	net.o ntea.o passwd.o path.o pinfo.o pipe.o poll.o pthread.o regcomp.o \
+	net.o ntea.o passwd.o path.o \
+	perthread.o \
+	pinfo.o pipe.o poll.o pthread.o regcomp.o \
 	regerror.o regexec.o regfree.o registry.o resource.o scandir.o sched.o \
-	sec_acl.o sec_helper.o security.o select.o shared.o shm.o shortcut.o \
+	sec_acl.o sec_helper.o sem.o security.o select.o shared.o shm.o \
+	shortcut.o \
 	signal.o sigproc.o smallprint.o spawn.o strace.o strsep.o sync.o \
 	syscalls.o sysconf.o syslog.o termios.o thread.o times.o tty.o uinfo.o \
 	uname.o v8_regexp.o v8_regerror.o v8_regsub.o wait.o wincap.o window.o \
@@ -138,6 +146,15 @@ DLL_OFILES:=assert.o autoload.o cygheap.
 
 GMON_OFILES:=gmon.o mcount.o profil.o
 
+mcount.o: mcount.c
+	$(CCNOPROF) $c -nostdinc $(ALL_CFLAGS) $(GCC_INCLUDE)  -o $(@D)/$(*F)$o $<
+
+gmon.o: gmon.c
+	$(CCNOPROF) $c -nostdinc $(ALL_CFLAGS) $(GCC_INCLUDE)  -o $(@D)/$(*F)$o $<
+
+profil.o: profil.c
+	$(CCNOPROF) $c -nostdinc $(ALL_CFLAGS) $(GCC_INCLUDE)  -o $(@D)/$(*F)$o $<
+
 OBSOLETE_FUNCTIONS:=regcomp regerror regexec regfree regsub
 NEW_FUNCTIONS:=regcomp posix_regcomp \
 	       regerror posix_regerror \
@@ -322,7 +339,10 @@ cygserver_client_outside.o: cygserver_cl
 cygserver_shm.o: cygserver_shm.cc
 	$(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $<
 
-cygserver.exe: cygserver.o cygserver_shm.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o
+cygserver_sem.o: cygserver_sem.cc
+	$(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $<
+
+cygserver.exe: cygserver.o cygserver_sem.o cygserver_shm.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o 
 	$(CXX) -o $@ $^
 #ifdef VERBOSE
 #	$(CXX) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,3,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS)
Index: child_info.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/child_info.h,v
retrieving revision 1.29
diff -u -p -r1.29 child_info.h
--- child_info.h	10 Feb 2002 13:50:13 -0000	1.29
+++ child_info.h	24 May 2002 11:29:01 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _CHILD_INFO_H_
+#define _CHILD_INFO_H_
+
 #include <setjmp.h>
 
 enum
@@ -109,3 +112,5 @@ public:
 void __stdcall init_child_info (DWORD, child_info *, int, HANDLE);
 
 extern child_info_fork *child_proc_info;
+
+#endif /* _CHILD_INFO_H_ */
Index: cygerrno.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/cygerrno.h,v
retrieving revision 1.7
diff -u -p -r1.7 cygerrno.h
--- cygerrno.h	22 Oct 2001 21:09:41 -0000	1.7
+++ cygerrno.h	24 May 2002 11:29:01 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _CYGERRNO_H_
+#define _CYGERRNO_H_
+
 void __stdcall seterrno_from_win_error (const char *file, int line, DWORD code) __attribute__ ((regparm(3)));
 void __stdcall seterrno (const char *, int line) __attribute__ ((regparm(2)));
 int __stdcall geterrno_from_win_error (DWORD code, int deferrno) __attribute__ ((regparm(2)));
@@ -37,3 +40,5 @@ class save_errno
 
 extern const char *__sp_fn;
 extern int __sp_ln;
+
+#endif /* _CYGERRNO_H_ */
Index: cygheap.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/cygheap.h,v
retrieving revision 1.38
diff -u -p -r1.38 cygheap.h
--- cygheap.h	8 May 2002 14:21:08 -0000	1.38
+++ cygheap.h	24 May 2002 11:29:01 -0000
@@ -8,6 +8,16 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _CYGHEAP_H_
+#define _CYGHEAP_H_
+
+#include "path.h"
+#include "dtable.h"
+/* for set_errno */
+#include "cygerrno.h"
+/* for various errnumbers */
+#include <errno.h>
+
 #undef cfree
 
 enum cygheap_types
@@ -273,3 +283,5 @@ char *__stdcall cstrdup (const char *) _
 char *__stdcall cstrdup1 (const char *) __attribute__ ((regparm(1)));
 void __stdcall cygheap_init ();
 }
+
+#endif /* _CYGHEAP_H_ */
Index: cygserver.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/cygserver.cc,v
retrieving revision 1.4
diff -u -p -r1.4 cygserver.cc
--- cygserver.cc	15 Mar 2002 21:52:05 -0000	1.4
+++ cygserver.cc	24 May 2002 11:29:02 -0000
@@ -31,6 +31,7 @@
 #include "cygwin/cygserver_process.h"
 #include "cygwin/cygserver.h"
 #include "cygserver_shm.h"
+#include "cygserver_sem.h"
 
 /* for quieter operation, set to 0 */
 #define DEBUG 0
@@ -158,6 +159,8 @@ out:
 void
 client_request::serve (transport_layer_base *conn, class process_cache *cache)
 {
+  if (header.req_id == CYGSERVER_REQUEST_INVALID)
+    return;
   printf ("*****************************************\n"
 	  "A call to the base client_request class has occured\n"
 	  "This indicates a mismatch in a virtual function definition somewhere\n");
@@ -365,7 +368,9 @@ server_request::process ()
     case CYGSERVER_REQUEST_SHUTDOWN:
       req = new client_request_shutdown (); break;
     case CYGSERVER_REQUEST_SHM_GET:
-     req = new client_request_shm (); break;
+      req = new client_request_shm (); break;
+    case CYGSERVER_REQUEST_SEM:
+      req = new client_request_sem (); break; 
     default:
       req = new client_request (CYGSERVER_REQUEST_INVALID, 0);
       req->header.error_code = ENOSYS;
@@ -374,8 +379,22 @@ server_request::process ()
 
   if (req->header.cb != req_ptr->cb)
     {
-      debug_printf ("Mismatch in request buffer sizes\n");
-      goto out;
+      if (req->header.req_id == CYGSERVER_REQUEST_INVALID)
+	{
+	  // suck the connection dry
+	  char tempbuf[req_ptr->cb];
+	  bytes_read = conn->read (&tempbuf[0], req_ptr->cb);
+	  if (bytes_read != req_ptr->cb)
+	    {
+	      debug_printf ("error reading %ld / %ld from connection (%lu)\n", bytes_read,req_ptr->cb, GetLastError ());
+	      goto out;
+	    }
+	}
+      else
+	{
+          debug_printf ("Mismatch in request buffer sizes\n");
+          goto out;
+	}
     }
 
   if (req->header.cb)
Index: cygwin.din
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/cygwin.din,v
retrieving revision 1.46
diff -u -p -r1.46 cygwin.din
--- cygwin.din	13 May 2002 19:53:46 -0000	1.46
+++ cygwin.din	24 May 2002 11:29:02 -0000
@@ -1252,3 +1252,11 @@ acltotext
 _acltotext = acltotext
 aclfromtext
 _aclfromtext = aclfromtext
+ftok
+shmat
+shmctl
+shmdt
+shmget
+semctl
+semget
+semop
Index: debug.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/debug.cc,v
retrieving revision 1.31
diff -u -p -r1.31 debug.cc
--- debug.cc	22 Feb 2002 19:33:41 -0000	1.31
+++ debug.cc	24 May 2002 11:29:02 -0000
@@ -38,6 +38,8 @@ void
 threadname_init ()
 {
   new_muto (threadname_lock);
+//  static muto threadname_lock##_storage __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy")));
+//  threadname_lock = threadname_lock##_storage (threadname_lock);
 }
 
 void __stdcall
Index: dtable.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dtable.h,v
retrieving revision 1.16
diff -u -p -r1.16 dtable.h
--- dtable.h	22 Feb 2002 19:33:41 -0000	1.16
+++ dtable.h	24 May 2002 11:29:02 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _DTABLE_H_
+#define _DTABLE_H_
+
 /* Initial and increment values for cygwin's fd table */
 #define NOFILE_INCR    32
 
@@ -85,3 +88,5 @@ extern dtable fdtab;
 
 extern "C" int getfdtabsize ();
 extern "C" void setfdtabsize (int);
+
+#endif /* _DTABLE_H_ */
Index: fhandler.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler.h,v
retrieving revision 1.116
diff -u -p -r1.116 fhandler.h
--- fhandler.h	22 May 2002 22:09:57 -0000	1.116
+++ fhandler.h	24 May 2002 11:29:05 -0000
@@ -12,6 +12,7 @@ details. */
 #define _FHANDLER_H_
 
 #include <sys/ioctl.h>
+#include "security.h"
 
 enum
 {
Index: gmon.c
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/gmon.c,v
retrieving revision 1.4
diff -u -p -r1.4 gmon.c
--- gmon.c	7 Sep 2001 21:32:04 -0000	1.4
+++ gmon.c	24 May 2002 11:29:05 -0000
@@ -44,6 +44,7 @@ static char rcsid[] = "$OpenBSD: gmon.c,
 #include <gmon.h>
 
 #include <profil.h>
+#include <windows.h>
 
 /* XXX needed? */
 //extern char *minbrk __asm ("minbrk");
@@ -58,10 +59,17 @@ static int	s_scale;
 
 void	moncontrol __P((int));
 
+HANDLE gmon_heap = INVALID_HANDLE_VALUE;
+
 static void *
 fake_sbrk(int size)
 {
-    return malloc(size);
+// does not play nice when profiling cygwin itself
+//    return malloc(size);
+    void *rv = HeapAlloc(gmon_heap, 0, size);
+    if (rv == NULL)
+      return (void *) -1;
+    return rv;
 }
 
 void
@@ -72,6 +80,8 @@ monstartup(lowpc, highpc)
 	register int o;
 	char *cp;
 	struct gmonparam *p = &_gmonparam;
+
+	gmon_heap = GetProcessHeap();
 
 	/*
 	 * round lowpc and highpc to multiples of the density we're using
Index: mcount.c
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/mcount.c,v
retrieving revision 1.3
diff -u -p -r1.3 mcount.c
--- mcount.c	24 Jun 2001 22:26:51 -0000	1.3
+++ mcount.c	24 May 2002 11:29:05 -0000
@@ -169,5 +169,10 @@ overflow:
  * Actual definition of mcount function.  Defined in <machine/profile.h>,
  * which is included by <sys/gmon.h>
  */
-MCOUNT
+// MCOUNT
 
+
+void mcount(void)
+{
+  _mcount (__builtin_return_address (1), __builtin_return_address (0));
+}
Index: path.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.h,v
retrieving revision 1.41
diff -u -p -r1.41 path.h
--- path.h	12 May 2002 03:08:59 -0000	1.41
+++ path.h	24 May 2002 11:29:05 -0000
@@ -8,6 +8,11 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _PATH_H_
+#define _PATH_H_
+
+#include "fhandler.h"
+
 struct suffix_info
 {
   const char *name;
@@ -191,3 +196,5 @@ int pathmatch (const char *path1, const 
 int pathnmatch (const char *path1, const char *path2, int len) __attribute__ ((regparm (2)));
 
 int path_prefix_p (const char *path1, const char *path2, int len1) __attribute__ ((regparm (3)));
+
+#endif /* _PATH_H_ */
Index: perthread.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/perthread.h,v
retrieving revision 1.8
diff -u -p -r1.8 perthread.h
--- perthread.h	30 Nov 2001 06:19:58 -0000	1.8
+++ perthread.h	24 May 2002 11:29:05 -0000
@@ -10,6 +10,16 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#include "winsup.h"
+#include "exceptions.h"
+#include "sync.h"
+#include "sigproc.h"
+#include "pinfo.h"
+#ifdef NEED_VFORK
+#include "cygheap.h"
+#include "child_info.h"
+#endif
+
 #define PTMAGIC 0x77366377
 
 struct _reent;
@@ -41,7 +51,7 @@ public:
 class per_thread_waitq : public per_thread
 {
 public:
-  per_thread_waitq () : per_thread (0) {}
+  per_thread_waitq ();
   void *get () {return (waitq *) this->per_thread::get ();}
   void *create () {return (waitq *) this->per_thread::create ();}
   size_t size () {return sizeof (waitq);}
@@ -61,6 +71,7 @@ struct vfork_save
 class per_thread_vfork : public per_thread
 {
 public:
+  per_thread_vfork();
   vfork_save *val () { return (vfork_save *) this->per_thread::get (); }
   vfork_save *create () {return (vfork_save *) this->per_thread::create ();}
   size_t size () {return sizeof (vfork_save);}
@@ -86,6 +97,7 @@ struct signal_dispatch
 
 struct per_thread_signal_dispatch : public per_thread
 {
+  per_thread_signal_dispatch();
   signal_dispatch *get () { return (signal_dispatch *) this->per_thread::get (); }
   signal_dispatch *create () {return (signal_dispatch *) this->per_thread::create ();}
   size_t size () {return sizeof (signal_dispatch);}
Index: pinfo.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/pinfo.h,v
retrieving revision 1.37
diff -u -p -r1.37 pinfo.h
--- pinfo.h	18 May 2002 20:27:49 -0000	1.37
+++ pinfo.h	24 May 2002 11:29:05 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _PINFO_H_
+#define _PINFO_H_
+
 /* Signal constants (have to define them here, unfortunately) */
 
 enum
@@ -206,3 +209,5 @@ int __stdcall fixup_shms_after_fork ();
 
 void __stdcall fill_rusage (struct rusage *, HANDLE);
 void __stdcall add_rusage (struct rusage *, struct rusage *);
+
+#endif /* _PINFO_H_ */
Index: security.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/security.cc,v
retrieving revision 1.90
diff -u -p -r1.90 security.cc
--- security.cc	21 May 2002 14:50:26 -0000	1.90
+++ security.cc	24 May 2002 11:29:06 -0000
@@ -1663,3 +1663,10 @@ set_file_attribute (int use_ntsec, const
 			     myself->uid, myself->gid,
 			     attribute, cygheap->user.logsrv ());
 }
+
+cygsid::cygsid () : psid ((PSID) sbuf) {}
+cygsid::cygsid (const PSID nsid) { *this = nsid; }
+cygsid::cygsid (const char *nstrsid) { *this = nstrsid; }
+
+const PSID cygsid::operator= (const char *nsidstr)
+    { return getfromstr (nsidstr); }
Index: security.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/security.h,v
retrieving revision 1.23
diff -u -p -r1.23 security.h
--- security.h	16 May 2002 09:30:48 -0000	1.23
+++ security.h	24 May 2002 11:29:06 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _SECURITY_H_
+#define _SECURITY_H_
+
 #define DONT_INHERIT (0)
 #define INHERIT_ALL  (CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)
 #define INHERIT_ONLY (INHERIT_ONLY_ACE|CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)
@@ -47,12 +50,11 @@ public:
     { return assign (nsid); }
   inline const PSID operator= (const PSID nsid)
     { return assign (nsid); }
-  inline const PSID operator= (const char *nsidstr)
-    { return getfromstr (nsidstr); }
+  const PSID operator= (const char *nsidstr);
 
-  inline cygsid () : psid ((PSID) sbuf) {}
-  inline cygsid (const PSID nsid) { *this = nsid; }
-  inline cygsid (const char *nstrsid) { *this = nstrsid; }
+  cygsid ();
+  cygsid (const PSID nsid);
+  cygsid (const char *nstrsid);
 
   inline PSID set () { return psid = (PSID) sbuf; }
 
@@ -223,3 +225,5 @@ sec_user (char sa_buf[], PSID sid = NULL
 {
   return allow_ntsec ? __sec_user (sa_buf, sid, TRUE) : &sec_none_nih;
 }
+
+#endif /* _SECURITY_H_ */
Index: sigproc.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/sigproc.h,v
retrieving revision 1.48
diff -u -p -r1.48 sigproc.h
--- sigproc.h	13 Jan 2002 20:03:03 -0000	1.48
+++ sigproc.h	24 May 2002 11:29:06 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _SIGPROC_H_
+#define _SIGPROC_H_
+
 #include <signal.h>
 
 #define EXIT_SIGNAL	 0x010000
@@ -124,3 +127,5 @@ extern char myself_nowait_nonmain_dummy[
 
 #define myself_nowait ((_pinfo *)myself_nowait_dummy)
 #define myself_nowait_nonmain ((_pinfo *)myself_nowait_nonmain_dummy)
+
+#endif /* _SIGPROG_H_ */
Index: sync.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/sync.h,v
retrieving revision 1.20
diff -u -p -r1.20 sync.h
--- sync.h	22 Feb 2002 19:33:41 -0000	1.20
+++ sync.h	24 May 2002 11:29:06 -0000
@@ -10,6 +10,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _SYNC_H_
+#define _SYNC_H_
+
 /* FIXME: Note that currently this class cannot be allocated via `new' since
    there are issues with malloc and fork. */
 class muto
@@ -47,3 +50,5 @@ extern muto muto_start;
   static muto __name##_storage __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy"))); \
   __name = __name##_storage.init (#__name); \
 })
+
+#endif /* _SYNC_H_ */
Index: thread.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/thread.cc,v
retrieving revision 1.66
diff -u -p -r1.66 thread.cc
--- thread.cc	2 May 2002 11:26:22 -0000	1.66
+++ thread.cc	24 May 2002 11:29:10 -0000
@@ -48,6 +48,14 @@ details. */
 
 extern int threadsafe;
 
+/* MTinterface */
+MTinterface::MTinterface ():reent_index (0), indexallocated (0), threadcount (1)
+{
+  pthread_prepare = NULL;
+  pthread_child   = NULL;
+  pthread_parent  = NULL;
+}
+
 /*pthread_key_destructor_list class: to-be threadsafe single linked list
  *FIXME: Put me in a dedicated file, or a least a tools area !
  */
Index: thread.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/thread.h,v
retrieving revision 1.33
diff -u -p -r1.33 thread.h
--- thread.h	10 Feb 2002 13:50:13 -0000	1.33
+++ thread.h	24 May 2002 11:29:10 -0000
@@ -381,12 +381,7 @@ public:
   void Init (int);
   void fixup_after_fork (void);
 
-    MTinterface ():reent_index (0), indexallocated (0), threadcount (1)
-  {
-    pthread_prepare = NULL;
-    pthread_child   = NULL;
-    pthread_parent  = NULL;
-  }
+    MTinterface ();
 };
 
 void __pthread_atforkprepare(void);
Index: winsup.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/winsup.h,v
retrieving revision 1.89
diff -u -p -r1.89 winsup.h
--- winsup.h	2 May 2002 04:13:48 -0000	1.89
+++ winsup.h	24 May 2002 11:29:10 -0000
@@ -8,6 +8,9 @@ This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifndef _WINSUP_H_
+#define _WINSUP_H_
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -228,9 +231,6 @@ extern void multiple_cygwin_problem (con
 extern "C" void __malloc_lock (struct _reent *);
 extern "C" void __malloc_unlock (struct _reent *);
 
-extern "C" void __malloc_lock (struct _reent *);
-extern "C" void __malloc_unlock (struct _reent *);
-
 class path_conv;
 int __stdcall stat_worker (const char *name, struct __stat64 *buf, int nofollow,
 			   path_conv *pc = NULL) __attribute__ ((regparm (3)));
@@ -289,3 +289,4 @@ extern HMODULE cygwin_hmodule;
 extern struct WSAData wsadata;
 
 #endif /* defined __cplusplus */
+#endif /* _WINSUP_H_ */
Index: include/cygwin/cygserver.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/cygserver.h,v
retrieving revision 1.3
diff -u -p -r1.3 cygserver.h
--- include/cygwin/cygserver.h	13 Mar 2002 02:34:05 -0000	1.3
+++ include/cygwin/cygserver.h	24 May 2002 11:29:10 -0000
@@ -33,6 +33,7 @@ typedef enum {
   CYGSERVER_REQUEST_ATTACH_TTY,
   CYGSERVER_REQUEST_SHUTDOWN,
   CYGSERVER_REQUEST_SHM_GET,
+  CYGSERVER_REQUEST_SEM,
   CYGSERVER_REQUEST_LAST
 } cygserver_request_code;
 
Index: include/cygwin/cygserver_transport_pipes.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/cygserver_transport_pipes.h,v
retrieving revision 1.3
diff -u -p -r1.3 cygserver_transport_pipes.h
--- include/cygwin/cygserver_transport_pipes.h	13 Mar 2002 02:34:05 -0000	1.3
+++ include/cygwin/cygserver_transport_pipes.h	24 May 2002 11:29:10 -0000
@@ -29,11 +29,11 @@ class transport_layer_pipes : public tra
   private:
     /* for pipe based communications */
     void init_security ();
-    SECURITY_DESCRIPTOR sd;
-    SECURITY_ATTRIBUTES sec_none_nih, sec_all_nih;
+    transport_layer_pipes (HANDLE new_pipe);
     char pipe_name [MAX_PATH];
     HANDLE pipe;
+    SECURITY_DESCRIPTOR sd;
+    SECURITY_ATTRIBUTES sec_none_nih, sec_all_nih;
     bool inited;
-    transport_layer_pipes (HANDLE new_pipe);
 };
 #endif /* _CYGSERVER_TRANSPORT_PIPES_ */
