Subject: RE: SML-NJ for CygWin32
From: [email-masked] (Sergey Okhapkin)

30 Aug 1997 08:50:58 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: "[email-masked]'" <[email-masked]>,
        "'Gary Fuehrer'"
	 <[email-masked]>
Original-Cc: "'Geoffrey Noer'" <[email-masked]>
Encoding: 70 TEXT
Original-Sender: [email-masked]

Gary Fuehrer wrote:
> I turns out that technique won't quite work.  The exceptions that I need
> to handle start in "__cygwin_exception_handler" such as "integer divide
> by zero".  But the current source for "call_handler" is only good for
> dispatching events starting in "ctrl_c_handler".  For Beta 18, someone
> mistakenly thought that having "__cygwin_exception_handler" call
> "ctrl_c_handler" for its implementation would be a good idea.  While it
> was a good idea to have a common signal dispatcher, the current
> "call_handler" can't dispatch both kinds of events.  The reason is that
> "call_handler" assumes the current thread is not the excepting thread;

It's already fixed, but not a good way - __cygwin_exception_handler just 
raises a corresponding signal now and returns. The failed context is lost 
when call_handler is called.

> I'd be glad to make exceptions.cc a correct, POSIX.4 compliant signal
> dispatcher.  But to do it, I need the correct versions of exceptions.cc
> and signal.cc to start from.  The Beta 18 starting point that I have now
> is missing the new beta 19 stuff and the Sergey Okhapkin patches.  How
> can we coordinate this effort?

You'll need the entire current winsup sources - there was too many changes 
after B18. Ask Geoffrey.

> According to Geoffrey Noer, setitimer() and getitimer() are implemented
> in beta 19.  If I understand it correctly, that is the virtual timer and
> therefore SIGVTALRM will be available.

Only the real, but not a virtual timer is implemented.

> > L_ctermid define should be added to stdio.h, and ctermid() call should
> > be
> > added to winsup sources for POSIX conformance.
> >
> That's the way I see it, too.  Even a stub for ctermid() would be
> helpful for beta 19.

Geoffrey, please add the following lines to termios.cc (and to cygwin.din, 
of course):

extern "C"
char *
ctermid (char *s)
{
  static char buf[L_ctermid];

  if (u->self->ctty != -1)
    {
      sprintf (buf, "/dev/tty%d", u->self->ctty);
    }
  else
    buf[0] = '\0';
  if (s)
    strcpy (s, buf);
  return buf;
}

And #define L_ctermid 16 to stdio.h.

> > The missing defines already added to headers.
> >
> Which ones?  Beta 19?  Or one of your patches?

Both B19 sources and my patches.

--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".