[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2118.0. "sigblock()" by TKOV60::OGINO () Wed Mar 12 1997 02:24

This note is cross posted in DIGITAL_UNIX conference.

I have a question regarding signal handling.

A time watch program sends a signal once to a copy program. The copy program 
uses ftp to copy programs from remote sites. The signal is sent via socket. 
If this copy program receives a signal, it will stop. But if this copy program
is in the middle of copying, it should wait to stop until finish copying. 
For this signal handling, signal() is used. But because of spec. of socket's 
select function, ftp gets this signal instead of the copy program and  
disconnects the link. So I used sigblock() to block the signal as follows:

	signal(SIGUSR2, function)
		.
		.
		.
        for (3) {
		.
		.		
                .
	mask=0
	mask = sigmask(SIGUSR2)
	org = sigblock(mask)
	for (n) {
		cftp_get_file
			.
			.
			.
		}
	sigblock(org)
	}

I want to get the signal while copying. Is it possible to get this signal
from stack? Or is there anyway to get back the signal from sigblock() ?
I do not want to change the program structure much because this program is
customer's.

Thanks in advance.

Yoji
T.RTitleUserPersonal
Name
DateLines
2118.1See also Digital_UNIX 9124DECC::SULLIVANJeff SullivanWed Mar 12 1997 12:184
This is probably more applicable to Digital UNIX than DECC.
This info is posted there as note 9124.

-Jeff