[Queue-developers] [Fwd: Signals and 64-bit Linux]
Brought to you by:
wkrebs
|
From: Werner G. K. <wer...@ya...> - 2001-06-09 21:28:58
|
This is also potentially relevant to a Tru64 port. James Conway <Jam...@ib...> writes: > I am very eager to try your Queue program, but unfortunately it does > not compile cleaning nor does the resulting executables run properly > on my Alpha/Linux systems. The error I get is "broken-pipe" when > invoking the example "queue -i -w -n -- hostname". In checking the > compiler output I see several warnings about "overflow in implicit > constant conversion" in "handle.c". These map to the functions > "sigmask" and "sigsetmask", and I note that the man pages state: > This interface is made obsolete by sigprocmask(2). > > Further, the system include file "signal.h" has this to say about > sigmask,sigsetmask, siggetmask, and sigblock: > > /* None of the following functions should be used anymore. They are here > only for compatibility. A single word (`int') is not guaranteed to be > enough to hold a complete signal mask and therefore these functions > simply do not work in many situations. Use `sigprocmask' instead. */ > > The code that generates the compiler warnings is as follows: > line 350: sigsetmask(~sigmask(SIGCHLD)); > line 1151: > sigsetmask(~(sigmask(SIGCHLD)|sigmask(SIGUSR1)|sigmask(SIGUSR2)|sigmask(SIGCONT)|sigmask(SIGTERM))); > I suspect that the "~" is the problem. > > Unfortunately I have no experience with the signal facility. The > recommended sigprocmask replacement is not straightforward to use. Do > you have any comments on this? > > I have also (and so far!) found two lines that require minor fixes > for my environment. These may be quite general however. > > ident.c, line 82: > oldsignal = signal(SIGALRM, do_nothing2); > The gcc compiler warns about the function do_nothing2. Prepending a > "&" fixes it: > oldsignal = signal(SIGALRM, &do_nothing2); > > ident.c. line 121: > signal(alarm, oldsignal); > The gcc compiler warns about arg 1, and I presume a call to the > "alarm" function is intended. If so, then the following would seem to > be OK: > signal(alarm(0), oldsignal); > > Finally, I would prefer to use the Compaq compilers in favor of the > GNU cc and c++. I cannot find a way to do this easily. The > documentation suggests that this would work: > env CC=ccc ./configure > where "ccc" is the Compaq C compiler. However, gcc remains in effect. > Am I on the wrong track? > > As background, the machines are Alpha XP1000 workstations running > RedHat Linux 6.2. > > Thank you for your help. > > James Conway > -- > ---------------------------------------------------------------------- > James Conway, PhD., > Laboratoire de Microscopie Electronique Structurale > Institut de Biologie Structurale > 41 rue Jules Horowitz > 38027 Grenoble Cedex 1 > FRANCE > Email: Jam...@ib... > Telephone: +33-(0)438-784568 <--** Note new prefix 438-7nnnnn *** > Fax: +33-(0)438-785494 <--** Note new prefix 438-7nnnnn *** > ---------------------------------------------------------------------- > |