OpenSSH 2.4.0 patch call..

Chiaki Ishikawa Chiaki.Ishikawa at personal-media.co.jp
Tue Jan 2 00:02:50 EST 2001


X-PMC-CI-e-mail-id: 14375 

Sorry to respond so late:

|> Please add handling for
|> SA_INTERRUPT and SA_RESTART and many will be greatful
|> for that.
|
|why? what is the rationale?
|even stevens APUE has 2 versions. on with SA_RESTART and
|one without.

I could be more specific if I can access APUE at the office.
But a quick glance at Unix Network Programming and
my lame try to refresh my memory led to the following observation.

- System calls can be interrupted by signals.

- Under certain conditions, the system calls are
  automatically restarted after the interruption.

SA_RESTART (when it is available, and set ) makes a system
call interrupted by this signal automatically restarted
by the kernel.

Old systems such as SunOS 4.x (and old BSD, too?)
automatically restart an interrupted
system call by default. (SA_INTERRUPT is defined to be the
complement of SA_RESTART(?). [I am hazy on this. Need to read
APUE to be sure.]).
 
- Special handling of SIGALRM is due to the following reason:
  we are quite likely to want to interrupt a blocked system call since
  SIGALRM is used often to place a timeout value on read/write.

  (And for this purpose, I think we don't want automatic restart for
   system calls interrupted by SIGALRM.)

So short summary is that for SIGALRM, we want to
make sure that the interrupted system call is NOT
automatically restarted.
For other signals (other than SIGALRM), we want the
interrupted system calls to be restarted automatically.

That is the gist of the change I put in and it is
essentially based on the code from Steven's Unix Network Programming.
(Only variable name changes, etc..)

APUE, which I can't access for another few days, may have a clear
explanation if there are two different versions for signal().




-- 
     Ishikawa, Chiaki        ishikawa at personal-media.co.jp.NoSpam  or         
 (family name, given name) Chiaki.Ishikawa at personal-media.co.jp.NoSpam
    Personal Media Corp.      ** Remove .NoSpam at the end before use **     
  Shinagawa, Tokyo, Japan 142-0051







More information about the openssh-unix-dev mailing list