Index: winsup/cygwin/net.cc
===================================================================
RCS file: /home/duda_admin/cvs-mirror/src/winsup/cygwin/net.cc,v
retrieving revision 1.14
diff -c -2 -r1.14 net.cc
*** winsup/cygwin/net.cc	2000/08/22 05:10:20	1.14
--- winsup/cygwin/net.cc	2000/09/02 14:53:26
***************
*** 430,434 ****
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
    sockaddr_in sin;
!   sigframe thisframe (mainthread, 0);
  
    if (get_inet_addr (to, tolen, &sin, &tolen) == 0)
--- 430,434 ----
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
    sockaddr_in sin;
!   SIGFRAME_HERE(mainthread);
  
    if (get_inet_addr (to, tolen, &sin, &tolen) == 0)
***************
*** 456,460 ****
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   sigframe thisframe (mainthread, 0);
  
    debug_printf ("recvfrom %d", h->get_socket ());
--- 456,460 ----
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   SIGFRAME_HERE(mainthread);
  
    debug_printf ("recvfrom %d", h->get_socket ());
***************
*** 613,617 ****
    fhandler_socket *sock = get (fd);
    sockaddr_in sin;
!   sigframe thisframe (mainthread, 0);
  
    if (get_inet_addr (name, namelen, &sin, &namelen) == 0)
--- 613,617 ----
    fhandler_socket *sock = get (fd);
    sockaddr_in sin;
!   SIGFRAME_HERE(mainthread);
  
    if (get_inet_addr (name, namelen, &sin, &namelen) == 0)
***************
*** 726,730 ****
  {
    int res = -1;
!   sigframe thisframe (mainthread, 0);
  
    fhandler_socket *sock = get (fd);
--- 726,730 ----
  {
    int res = -1;
!   SIGFRAME_HERE(mainthread);
  
    fhandler_socket *sock = get (fd);
***************
*** 912,916 ****
  {
    int res = -1;
!   sigframe thisframe (mainthread, 0);
  
    fhandler_socket *sock = get (fd);
--- 912,916 ----
  {
    int res = -1;
!   SIGFRAME_HERE(mainthread);
  
    fhandler_socket *sock = get (fd);
***************
*** 955,959 ****
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   sigframe thisframe (mainthread, 0);
  
    int res = recv (h->get_socket (), (char *) buf, len, flags);
--- 955,959 ----
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   SIGFRAME_HERE(mainthread);
  
    int res = recv (h->get_socket (), (char *) buf, len, flags);
***************
*** 981,985 ****
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   sigframe thisframe (mainthread, 0);
  
    int res = send (h->get_socket (), (const char *) buf, len, flags);
--- 981,985 ----
  {
    fhandler_socket *h = (fhandler_socket *) fdtab[fd];
!   SIGFRAME_HERE(mainthread);
  
    int res = send (h->get_socket (), (const char *) buf, len, flags);
***************
*** 1368,1372 ****
    int res = -1;
    SOCKET fd2s;
!   sigframe thisframe (mainthread, 0);
  
    int res_fd = fdtab.find_unused_handle ();
--- 1368,1372 ----
    int res = -1;
    SOCKET fd2s;
!   SIGFRAME_HERE(mainthread);
  
    int res_fd = fdtab.find_unused_handle ();
***************
*** 1408,1412 ****
  {
    int res = -1;
!   sigframe thisframe (mainthread, 0);
  
    int res_fd = fdtab.find_unused_handle ();
--- 1408,1412 ----
  {
    int res = -1;
!   SIGFRAME_HERE(mainthread);
  
    int res_fd = fdtab.find_unused_handle ();
***************
*** 1437,1441 ****
    int res = -1;
    SOCKET fd2s;
!   sigframe thisframe (mainthread, 0);
  
    int res_fd = fdtab.find_unused_handle ();
--- 1437,1441 ----
    int res = -1;
    SOCKET fd2s;
!   SIGFRAME_HERE(mainthread);
  
    int res_fd = fdtab.find_unused_handle ();
***************
*** 1615,1619 ****
  fhandler_socket::read (void *ptr, size_t len)
  {
!   sigframe thisframe (mainthread);
    int res = recv (get_socket (), (char *) ptr, len, 0);
    if (res == SOCKET_ERROR)
--- 1615,1619 ----
  fhandler_socket::read (void *ptr, size_t len)
  {
!   SIGFRAME_HERE(mainthread);
    int res = recv (get_socket (), (char *) ptr, len, 0);
    if (res == SOCKET_ERROR)
***************
*** 1627,1631 ****
  fhandler_socket::write (const void *ptr, size_t len)
  {
!   sigframe thisframe (mainthread);
    int res = send (get_socket (), (const char *) ptr, len, 0);
    if (res == SOCKET_ERROR)
--- 1627,1631 ----
  fhandler_socket::write (const void *ptr, size_t len)
  {
!   SIGFRAME_HERE(mainthread);
    int res = send (get_socket (), (const char *) ptr, len, 0);
    if (res == SOCKET_ERROR)
***************
*** 1643,1647 ****
  {
    int res = 0;
!   sigframe thisframe (mainthread);
  
    if (closesocket (get_socket ()))
--- 1643,1647 ----
  {
    int res = 0;
!   SIGFRAME_HERE(mainthread);
  
    if (closesocket (get_socket ()))
***************
*** 1682,1686 ****
    struct ifconf *ifc;
    struct ifreq *ifr;
!   sigframe thisframe (mainthread);
  
    switch (cmd)
--- 1682,1686 ----
    struct ifconf *ifc;
    struct ifreq *ifr;
!   SIGFRAME_HERE(mainthread);
  
    switch (cmd)
Index: winsup/cygwin/select.cc
===================================================================
RCS file: /home/duda_admin/cvs-mirror/src/winsup/cygwin/select.cc,v
retrieving revision 1.24
diff -c -2 -r1.24 select.cc
*** winsup/cygwin/select.cc	2000/08/24 21:19:14	1.24
--- winsup/cygwin/select.cc	2000/09/02 14:53:26
***************
*** 119,123 ****
    fd_set *dummy_writefds = allocfd_set (maxfds);
    fd_set *dummy_exceptfds = allocfd_set (maxfds);
!   sigframe thisframe (mainthread, 0);
  
  #if 0
--- 119,123 ----
    fd_set *dummy_writefds = allocfd_set (maxfds);
    fd_set *dummy_exceptfds = allocfd_set (maxfds);
!   SIGFRAME_HERE(mainthread);
  
  #if 0
Index: winsup/cygwin/sigproc.cc
===================================================================
RCS file: /home/duda_admin/cvs-mirror/src/winsup/cygwin/sigproc.cc,v
retrieving revision 1.35
diff -c -2 -r1.35 sigproc.cc
*** winsup/cygwin/sigproc.cc	2000/09/02 01:19:58	1.35
--- winsup/cygwin/sigproc.cc	2000/09/02 14:53:27
***************
*** 782,786 ****
  	  thiscatch = sigcatch_main;
  	  thiscomplete = sigcomplete_main;
! 	  thisframe.set (mainthread, 1, ebp);
  	}
      }
--- 782,786 ----
  	  thiscatch = sigcatch_main;
  	  thiscomplete = sigcomplete_main;
! 	  SIGFRAME_SET_HERE(thisframe, mainthread, 1, ebp);
  	}
      }
***************
*** 1405,1409 ****
  {
    DWORD ret;
!   sigframe thisframe (mainthread);
    ret = WaitForSingleObject (hHandle, dwMilliseconds);
    return ret;
--- 1405,1409 ----
  {
    DWORD ret;
!   SIGFRAME_HERE(mainthread);
    ret = WaitForSingleObject (hHandle, dwMilliseconds);
    return ret;
***************
*** 1416,1422 ****
  {
    DWORD ret;
!   sigframe thisframe (mainthread);
    ret = WaitForMultipleObjects (nCount, lpHandles, fWaitAll, dwMilliseconds);
    return ret;
  }
  }
--- 1416,1423 ----
  {
    DWORD ret;
!   SIGFRAME_HERE(mainthread);
    ret = WaitForMultipleObjects (nCount, lpHandles, fWaitAll, dwMilliseconds);
    return ret;
  }
  }
+ 
Index: winsup/cygwin/sigproc.h
===================================================================
RCS file: /home/duda_admin/cvs-mirror/src/winsup/cygwin/sigproc.h,v
retrieving revision 1.15
diff -c -2 -r1.15 sigproc.h
*** winsup/cygwin/sigproc.h	2000/09/01 20:54:22	1.15
--- winsup/cygwin/sigproc.h	2000/09/02 14:53:30
***************
*** 42,45 ****
--- 42,48 ----
  };
  
+ #define SIGFRAME_HERE(thread)	sigframe thisframe(thread, (DWORD)(__builtin_frame_address(0)) )
+ #define SIGFRAME_SET_HERE(frame,thread,up,ebp)	frame.set(thread, (ebp?:(DWORD)(__builtin_frame_address(up?1:0))) )
+ 
  class sigframe
  {
***************
*** 48,68 ****
  
  public:
!   void set (sigthread &t, int up = 1, DWORD ebp = 0)
    {
      t.lock->acquire ();
      st = &t;
!     if (ebp)
!       t.frame = ebp;
!     else
!       t.frame = (DWORD) (up ? __builtin_frame_address (1) :
! 			     __builtin_frame_address (0));
      t.lock->release ();
    }
  
    sigframe () {st = NULL;}
!   sigframe (sigthread &t, int up = 0)
    {
      if (!t.frame && t.id == GetCurrentThreadId ())
!       set (t, up);
      else
        st = NULL;
--- 51,67 ----
  
  public:
!   void set (sigthread &t, DWORD ebp)
    {
      t.lock->acquire ();
      st = &t;
!     t.frame = ebp;
      t.lock->release ();
    }
  
    sigframe () {st = NULL;}
!   sigframe (sigthread &t, DWORD ebp)
    {
      if (!t.frame && t.id == GetCurrentThreadId ())
!       set (t,ebp);
      else
        st = NULL;
Index: winsup/cygwin/syscalls.cc
===================================================================
RCS file: /home/duda_admin/cvs-mirror/src/winsup/cygwin/syscalls.cc,v
retrieving revision 1.50
diff -c -2 -r1.50 syscalls.cc
*** winsup/cygwin/syscalls.cc	2000/08/22 05:10:20	1.50
--- winsup/cygwin/syscalls.cc	2000/09/02 14:53:30
***************
*** 194,198 ****
  {
    int res;
!   sigframe thisframe (mainthread);
    fhandler_base *fh = fdtab[fd];
  
--- 194,198 ----
  {
    int res;
!   SIGFRAME_HERE(mainthread);
    fhandler_base *fh = fdtab[fd];
  
