Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:216] Re: Solaris Vs Netrek



> I believe it is something to do with sigalarm or sigpause, I cannot
> tell which one.

After a look at the Solaris Transition guide in the answer book, I found:

sigpause - the sigpause system call assigns its argument (sigmask) to the 
       set of masked signals while the ABI and SVID versions remove its 
       argument (sig) from the calling process's signal mask.  The SVR4 and
       Solaris 2.3 sigpause is compatible with SunOS 4.1 sigpause.

They claim to be compatible, which seems to mean only that you can get them
to perform the same function, but not necessarily in the same way.


from the Solaris sigpause man page:
     int sigpause(int sig);

     sigpause() removes sig from  the  calling  process's  signal
     mask  and  suspends  the  calling  process until a signal is
     received.
[...]
     All other functions return zero  on  success.   On  failure,
     they return -1 and set errno to indicate the error.
 
ERRORS
     These functions fail if any of the following are true:
 
     EINTR          A signal was caught during the function  sig-
                    pause().
 
     EINVAL         The value of the sig argument is not a  valid
                    signal or is equal to SIGKILL or SIGSTOP.



While the BSD sigpause manpage says:

     int sigpause(sigmask)
     int sigmask;

DESCRIPTION
     sigpause() assigns sigmask to the set of masked signals  and
     then  waits  for  a  signal  to arrive; on return the set of
     masked signals is restored.  sigmask is usually 0  to  indi-
     cate  that  no  signals  are  now to be blocked.  sigpause()
     always terminates by being interrupted, returning EINTR.


So the SVR4 one appears to return 0 or -1 while the BSD returns EINTR (?).
Could sigpause be killing the server unwittingly?

Remember, the code was written primarily on BSD, so the code ought to be
expecting EINTR, correct?


Bob Campbell