- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SIGCONT signal generated automatically
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО02-04-2024 02:10 PM - last edited on тАО02-09-2024 07:27 AM by support_s
тАО02-04-2024 02:10 PM - last edited on тАО02-09-2024 07:27 AM by support_s
Hi,
In this program, why is SIGCONT signal generated when only SIGUSR1 signal is sent to the process?
#include <stdio.h>
#include <signal.h>
int fib(int n)
{
if (n == 0 || n == 1)
return n;
else
return (fib(n-1) + fib(n-2));
}
void SignalHandler(int sig)
{
printf("SIGNAL: %d\n", sig);
}
int main()
{
int i;
signal(SIGUSR1, SignalHandler);
signal(SIGCONT, SignalHandler);
signal(SIGTERM, SignalHandler);
for(i=0; i< 100; ++i)
{
fib(35);
}
}
------------------------------------------------
[fraapp31_cotafac]/tmp# a.out
SIGNAL: 26
SIGNAL: 16
[fraapp31_cotafac]/tmp# uname -a
HP-UX fraapp31 B.11.23 U ia64 1849578169 unlimited-user license
Thanks in advance.
Regards, Jose Luis.
Solved! Go to Solution.
- Tags:
- Operating System
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2024 10:22 AM - edited тАО02-07-2024 10:58 AM
тАО02-07-2024 10:22 AM - edited тАО02-07-2024 10:58 AM
Re: SIGCONT signal generated automatically
Hello Jose Luis,
1) printf() is not a async sinal safe function so must not be used in a signal handler
2) with the following program you should see the signal for SIGCONT immediately
3) do you ^Z before sending a kill -USR1 to the process? ( I think I missed the initial question in my previous points), if yes, to restart a SIGCONT signal is received by the process, I don't reproduce, so how do you generate the signal
#include <stdio.h>
#include <signal.h>
int fib(int n)
{
if (n == 0 || n == 1)
return n;
else
return (fib(n-1) + fib(n-2));
}
void SignalHandlerCONT(int sig)
{
write(1,"SIGNAL: CONT \n", strlen("SIGNAL: CONT \n"));
}
void SignalHandler(int sig)
{
write(1,"SIGNAL: TERM \n", strlen("SIGNAL: CONT \n"));
}
void SignalHandlerUSR(int sig)
{
write(1,"SIGNAL: USR1 \n", strlen("SIGNAL: CONT \n"));
}
int main()
{
int i;
signal(SIGUSR1, SignalHandlerUSR);
signal(SIGCONT, SignalHandlerCONT);
signal(SIGTERM, SignalHandler);
for(i=0; i< 100; ++i)
{
fib(35);
}
}
I am an HPE Employee (HPE Community)
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2024 11:45 AM
тАО02-07-2024 11:45 AM
Re: SIGCONT signal generated automatically
Hi ,
First, the program is compiled and launched:
[fraapp31_cotafac]/tmp# cc -V
cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
[fraapp31_cotafac]/tmp# uname -a
HP-UX fraapp31 B.11.23 U ia64 1849578169 unlimited-user license
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp# cc laurentmenase_signal.c -o laurentmenase_signal
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp# laurentmenase_signal
SIGNAL: 26
SIGNAL: 16
In other terminal, SIGUSR1 signal is sent to the program:
[fraapp31_cotafac]/fac/desa/cotafac/madrid/trunk/fuentes/Procesos/src# ps -ef| grep laurentmenase_signal
cotafac 688 482 96 20:40:10 pts/0 00:05 laurentmenase_signal
cotafac 691 563 0 20:40:15 pts/1 00:00 grep laurentmenase_signal
[fraapp31_cotafac]/fac/desa/cotafac/madrid/trunk/fuentes/Procesos/src# kill -SIGUSR1 688
[fraapp31_cotafac]/fac/desa/cotafac/madrid/trunk/fuentes/Procesos/src#
Thanks for your help!!
Regards, Jose Luis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2024 01:49 AM
тАО02-08-2024 01:49 AM
Re: SIGCONT signal generated automatically
Hello Jose Luis
Even on 11.23 I do not reproduce and get only SIGUSR1. you may try to tusc the kill and the a.out ( tusc -f -o /var/tmp/xy.t ./xy
and
tusc -f -o /var/tmp/kill.t kill -USR1 <pid>
Best regards,
Laurent
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2024 07:19 AM
тАО02-08-2024 07:19 AM
SolutionHi,
The problem was that I was using ksh built in kill instead of kill command (/usr/bin/ksh). This text is an extract for "man ksh":
"Signals are given either by number or name (as given in signal(5), stripped of the prefix SIG). The signal names are listed by kill -l. No default exists; merely typing kill does not affect the current job. If the signal being sent is TERM (terminate) or HUP (hangup), the job or process is sent a CONT (continue) signal when stopped. The process argument can be either a process ID or job. If the first argument to kill is a negative integer, it is interpreted as a sig argument and not as a process group. See also kill(1)."
Thanks for your help!
Regards, Jose Luis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2024 09:01 PM
тАО02-11-2024 09:01 PM
Re: SIGCONT signal generated automatically
Hello Jose Luis,
That's excellent!
We are extremely glad to know you were able to find the solution, and we appreciate you for keeping us posted.
Thanks,
Sunitha G
I'm an HPE employee.
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
