Operating System - HP-UX
1830939 Members
2740 Online
110017 Solutions
New Discussion

Re: Porting from IBM-AIX to HP-Unix

 
SOLVED
Go to solution
Raj_3
New Member

Porting from IBM-AIX to HP-Unix

Hello,

I am porting a C system from AIX to HP-Unix. I just would like to know what is the corresponding signal in HP-Unix as opposed to SIGDANGER in IBM-AIX, which is used when System crash is imminent and page space is needed. I am not a computer-whiz, so a minimum input from your side would be most appreciated.

Thank you,
Raj.
4 REPLIES 4
Sam Nicholls
Trusted Contributor
Solution

Re: Porting from IBM-AIX to HP-Unix

Hi Raj,

I believe AIX is the only Unix that supports SIGDANGER. This signal is sent to all processes when the system is running out of page space. The default action is to ignore the signal. However, it sounds like your C app has defined a signal handler routine for it.

Really, the only way to port it to HP-UX, or any other Unix that doesn't support SIGDANGER, is to remove the signal handler routine and the corresponding signal() call.

-sam
Devbinder Singh Marway
Valued Contributor

Re: Porting from IBM-AIX to HP-Unix

just a quicky , To view / list the signals use the kill -l ( this is on both systems )

Seek and you shall find
Raj_3
New Member

Re: Porting from IBM-AIX to HP-Unix

Hi Sam,

Thank u very much for getting me such an early reply. If u could spare some more time, i have one other doubt.

The sa_mask structure in AIX has two unsigned long variables, losigs and hisigs, whereas in HP-Unix sa_mask structure contains an array of 8 unsigned int sigset[8]. sa_mask structure is initialised before passing it to sigaction() function. Now that the system is put in HP, is it enough if i change the initialisation of losigs and hisigs with sigset[0]=0; It might be a very silly question but still if u could reply it would be very nice of u.

Thanks,
Raj.
Sam Nicholls
Trusted Contributor

Re: Porting from IBM-AIX to HP-Unix

Hi Raj,

It sounds like the application is creating an empty mask by doing something like...

struct sigaction action;

action.sa_mask.losigs = 0;
action.sa_mask.hisigs = 0;

As you've found, this isn't portable because sa_mask is supposed to be opaque. You're not supposed to fiddle directly with its members.

Instead, use the following functions to initialize and manipulate signal sets (sigset_t structures)...

int sigemptyset(sigset_t *set);
int sigfillset(sigset_t *set);
int sigaddset(sigset_t *set, int signo);
int sigdelset(sigset_t *set, int signo);
int sigismember(const sigset_t *set, int signo);

Just do a "man" on any of these. So, to initialize an empty sigset and pass to sigaction, you should do something like...

struct sigaction action;

sigemptyset(&action.sa_mask);
action.sa_flags = 0;
action.sa_handler = sighandler_func;
sigaction(SIGUSR1, &action, NULL);

If there are any signals that you want to block during execution of sighandler_func, add them to action.sa_mask with sigaddset before calling segaction.

good luck,
-sam