Sponsored Content
Top Forums Programming why printf() function don't go work? Post 302273535 by otheus on Monday 5th of January 2009 04:13:34 AM
Old 01-05-2009
I'm not sure ( I didn't look closely at the code), but calling an IO function while handling an IO signal might be a problem. Also, when printing within signals, it's a good idea to call flush().

Also, why would you expect the program to call SIGHUP on itself when exiting? That's only the case if you're connected to a TTY which is closed on you.
 

9 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

How come sigs don't work?

They appear to be turned on, I entered mine in. The check boxes are all checked. And yet, no sigs? (4 Replies)
Discussion started by: l008com
4 Replies

2. UNIX for Dummies Questions & Answers

Things in tutorials that don't work.

I am thankful for this site and for the many links provided. I have been going through one of the tutorials, but as I try some things, they don't seem to work. I am wondering if there is something I need first before being able to use a tutorial (like version number (HP-UX) or how I am getting... (1 Reply)
Discussion started by: arungavali
1 Replies

3. Shell Programming and Scripting

Use variable in sed don't work.

Hi all. I have a script as below: cutmth=`TZ=CST+2160 date +%b` export cutmth echo $cutmth >> date.log sed -n "/$cutmth/$p" alert_sbdev1.log > alert_summ.log My purpose is to run through the alert_sbdev1.log and find the 1st occurence of 'Jan' and send everything after that line to... (4 Replies)
Discussion started by: ahSher
4 Replies

4. Programming

why daytime don't work?

Following code is detecting solaris daytime,when I run it,I can't get any result,code is follows: #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define BUFFSIZE 150 int main(){ ... (2 Replies)
Discussion started by: konvalo
2 Replies

5. Programming

why printf don't work?

I use Solaris 10, I use following code: #include <signal.h> int main(void){ printf("----------testing-----------"); if(signal(SIGUSR1,sig_usr)==SIG_ERR) err_sys("can't catch SIGUSR1"); for(;;) pause(); sig_user(int signo){ ..... } when I run above code,it print nothing... (3 Replies)
Discussion started by: konvalo
3 Replies

6. Programming

Internals of the printf function?

hey all, im a new programmer. i was wondering how you would go about writing the printf function yourself? it is my understanding that when you call printf you are calling an already written function and just providing an argument? if this is the case, is it possible to write that function... (8 Replies)
Discussion started by: Christian.B
8 Replies

7. HP-UX

awk don't work in hp-ux 11.11

Hello all! I have problem in hp-ux 11.11 in awk I want to grep sar -d 2 1 only 3 column, but have error in awk in hp-ux 11.11 Example: #echo 123 234 | awk '{print $2}' 123 234 The situattions in commands bdf | awk {print $5}' some... In hp-ux 11.31 - OK! How resolve problem (15 Replies)
Discussion started by: ostapv
15 Replies

8. UNIX for Dummies Questions & Answers

printf function

#include<stdio.h> int counter; int fibonacci(int n) { counter += 1; if ( n <= 2 ) return 1; else return fibonacci(n-1) + fibonacci(n-2); } int main(void) { int i; int sum ; for( i = 1 ; i<= 10; i++) { counter = 0; sum... (1 Reply)
Discussion started by: vincent__tse
1 Replies

9. Shell Programming and Scripting

Equivalence classes don't work

Hello: I can't get equivalence classes to work in globs or when passing them to tr. If I understood correctly, matches e, é, è, ê, etc. But when using them with utilities like tr they don't work. Here's an example found in the POSIX standard: I decided to create the aforementioned files in... (9 Replies)
Discussion started by: Cacializ
9 Replies
PCNTL_SIGNAL_DISPATCH(3)						 1						  PCNTL_SIGNAL_DISPATCH(3)

pcntl_signal_dispatch - Calls signal handlers for pending signals

SYNOPSIS
bool pcntl_signal_dispatch (void ) DESCRIPTION
The pcntl_signal_dispatch(3) function calls the signal handlers installed by pcntl_signal(3) for each pending signal. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pcntl_signal_dispatch(3) example <?php echo "Installing signal handler... "; pcntl_signal(SIGHUP, function($signo) { echo "signal handler called "; }); echo "Generating signal SIGHUP to self... "; posix_kill(posix_getpid(), SIGHUP); echo "Dispatching... "; pcntl_signal_dispatch(); echo "Done "; ?> The above example will output something similar to: Installing signal handler... Generating signal SIGHUP to self... Dispatching... signal handler called Done SEE ALSO
pcntl_signal(3), pcntl_sigprocmask(3), pcntl_sigwaitinfo(3), pcntl_sigtimedwait(3). PHP Documentation Group PCNTL_SIGNAL_DISPATCH(3)
All times are GMT -4. The time now is 02:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy