HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sigpause SIGUSR2
Operating System - HP-UX
1833828
Members
1984
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 09:51 PM
12-07-2004 09:51 PM
Hi,
I was just trying with sigpause program,
My system details are as follows:
Machine: HP-UX xxxxxxx B.11.11 U 9000/800 178484665 unlimited-user license
Compiler :
/usr/bin/cc:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
LINT B.11.11.10 CXREF B.11.11.10
HP92453-01 B.11.11.10 HP C Compiler
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
------------------------
#include
#include
void Signal(int sig) {
printf("-------------------------------------------->Signal Caught\n");
}
int main() {
int a_nRc;
int k,l;
printf("Process ID is %d\n",getpid());
int a_stMask;
struct sigaction a_stSigAction;
memset( &a_stSigAction, NULL, sizeof(struct sigaction));
a_stSigAction.sa_handler = Signal;
a_nRc = sigaction(SIGUSR2,&a_stSigAction,NULL);
a_nRc = sigaction(SIGUSR1,&a_stSigAction,NULL);
a_nRc = sigaction(SIGALRM,&a_stSigAction,NULL);
l=0;
if ( 0 != a_nRc ){
printf("Error\n");
}
a_stMask = sigblock (sigmask (SIGALRM) | sigmask (SIGTERM));
sigpause(&a_stMask);
printf("After Signal Suspend\n");
printf("After UnBlocking.........\n");
}
----------
Problem : If I send SIGUSR2 to above program from another terminal then signal is not handled though signal handler is defined.
But if I send SIGUSR1 it is handled.
ie., kill -USR1 ( Signal is trapped)
but kill -USR2 ( Signal not trapped)
Question:
a) Is the program correct ?
b) Though I am aware that sigblock is deprecated and we should use sigprocmask,I was just trying.
But I have a question.
Is sigpause(0) is same as sigpause(mask) where mask is union of all signal.
Please help.
Thanks in Advance
With Regards,
Srinivasan S
I was just trying with sigpause program,
My system details are as follows:
Machine: HP-UX xxxxxxx B.11.11 U 9000/800 178484665 unlimited-user license
Compiler :
/usr/bin/cc:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
LINT B.11.11.10 CXREF B.11.11.10
HP92453-01 B.11.11.10 HP C Compiler
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
------------------------
#include
#include
void Signal(int sig) {
printf("-------------------------------------------->Signal Caught\n");
}
int main() {
int a_nRc;
int k,l;
printf("Process ID is %d\n",getpid());
int a_stMask;
struct sigaction a_stSigAction;
memset( &a_stSigAction, NULL, sizeof(struct sigaction));
a_stSigAction.sa_handler = Signal;
a_nRc = sigaction(SIGUSR2,&a_stSigAction,NULL);
a_nRc = sigaction(SIGUSR1,&a_stSigAction,NULL);
a_nRc = sigaction(SIGALRM,&a_stSigAction,NULL);
l=0;
if ( 0 != a_nRc ){
printf("Error\n");
}
a_stMask = sigblock (sigmask (SIGALRM) | sigmask (SIGTERM));
sigpause(&a_stMask);
printf("After Signal Suspend\n");
printf("After UnBlocking.........\n");
}
----------
Problem : If I send SIGUSR2 to above program from another terminal then signal is not handled though signal handler is defined.
But if I send SIGUSR1 it is handled.
ie., kill -USR1
but kill -USR2
Question:
a) Is the program correct ?
b) Though I am aware that sigblock is deprecated and we should use sigprocmask,I was just trying.
But I have a question.
Is sigpause(0) is same as sigpause(mask) where mask is union of all signal.
Please help.
Thanks in Advance
With Regards,
Srinivasan S
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 10:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 10:14 PM
12-07-2004 10:14 PM
Re: sigpause SIGUSR2
Thanks.
-:) I realize the silly overlook and mistake.
-:) I realize the silly overlook and mistake.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP