Sponsored Content
Top Forums UNIX for Advanced & Expert Users Not able to Display the Catched Signal Post 302697377 by DGPickett on Thursday 6th of September 2012 04:33:07 PM
Old 09-06-2012
Good error handling makes for short debug times and happier production support. That is why stderr is always open and unbuffered at the start. Point it at a log file.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

thread::signal

Hi,all! Now ,I write perl for windows platform,and will use signal for asynchronous operations ,but I find it could bring some bugs if it is used incorrectly ,pls help!!! :D (1 Reply)
Discussion started by: hhh101
1 Replies

2. UNIX for Dummies Questions & Answers

Alarm signal

Hi, when I execute a script on unix AIX, I've got an error message: "Execution: 85328 Signal d'alarme". If I edit this file with "vi", I ve got the same error after a while (about 1 minute). If I try with another user I still have the problem. But if I rename this file, no problem. My... (5 Replies)
Discussion started by: cgsteph
5 Replies

3. Shell Programming and Scripting

Signal question

Who can explain the meaning of the &2 &1 or @, #, etc in the script? Is there any document which can explain the usage of these words in details? for example: ls /etc/sysconfig/network > /dev/null 2>&1 #@ bash, ksh and sh. Thanks in advance for ur advice. (1 Reply)
Discussion started by: GCTEII
1 Replies

4. Programming

Signal Problem

I am using the signal function, and passing it a function named quit procedure...I get the following warning.... passing arg2 of signal from incompatible pointer type... void quit_procedure(void); //this is the way i define my prototype... signal(SIGINT, quit_procedure); Please guide... (5 Replies)
Discussion started by: jacques83
5 Replies

5. Shell Programming and Scripting

Killed by signal 15.

Hi all I have Master script, Main script ,and 4 Child script. Master.sh #!/bin/bash /export/home/user/Main.shMain.sh #!/bin/bash /export/home/user/Child1.sh & /export/home/user/Child2.sh & /export/home/user/Child3.sh & /export/home/user/Child4.sh &I run only Master.sh script... (1 Reply)
Discussion started by: almanto
1 Replies

6. UNIX for Dummies Questions & Answers

Trying to block signal

I have this code that doesnt do what it is suppose to do. It should block signal that I send while process is running. I press control+z while this process is running and it should be blocked but it isnt. When i press control+z it gives me this.... + Stopped When I change SIGTSP into SIGINT then... (5 Replies)
Discussion started by: joker40
5 Replies

7. UNIX for Advanced & Expert Users

DISPLAY=local_host:0.0 ; export DISPLAY

Hi, from my Windows Workstation I can connect with PUTTY to an AIX 6.1 unix server. On AIX via PUTTY I run DBCA which has a grphical interface. Then : #DISPLAY=local_host:0.0 ; export DISPLAY $(hostname) $(whoami):/appli/oracle/product/10.2.0/db_1/bin#dbca _X11TransSocketINETConnect()... (12 Replies)
Discussion started by: big123456
12 Replies

8. Programming

queue a signal

A program have to receive signals and work agreed with it, but the process have to receive more than one signal when it is attending other. Those have to be queued to be attended later recived. how can i do that? thanks. (2 Replies)
Discussion started by: marmaster
2 Replies

9. Shell Programming and Scripting

Case signal

Task 1: #!/bin/ksh if then echo "Usage : $0 Signalnumber PID" exit fi case "$1" in 1) echo "Sending SIGHUP signal" kill -SIGHUP $2 ;; 2) echo "Sending SIGINT signal" kill -SIGINT $2 ;; 3) echo "Sending SIGQUIT signal" kill -SIGQUIT $2 (3 Replies)
Discussion started by: Ramesh M
3 Replies
appender_type_stream2.h(3)					       log4c						appender_type_stream2.h(3)

NAME
appender_type_stream2.h - Log4c stream2 appender interface. SYNOPSIS
#include <log4c/defs.h> #include <log4c/appender.h> Functions LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) LOG4C_API FILE * log4c_stream2_get_fp (log4c_appender_t *a_this) LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, int flags) LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Variables __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Detailed Description Log4c stream2 appender interface. The stream2 appender uses a file handle FILE* for logging. It can be used with stdout, stderr or a normal file. It is pretty primitive as it does not do file rotation, or have a maximum configurable file size etc. It improves on the stream appender in a few ways that make it a better starting point for new stream based appenders. It enhances the stream appender by allowing the default file pointer to be used in buffered or unbuffered mode. Also when you set the file pointer stream2 will not attempt to close it on exit which avoids it fighting with the owner of the file pointer. stream2 is configured via setter functions--the udata is not exposed directly. This means that new options (eg. configure the open mode ) could be added to stream2 while maintaining backward compatability. The appender can be used with default values, for example as follows: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); In this case the appender will be configured automatically with default values: o the filename is the same as the name of the appender, '/var/logs/mymlog.log' o the file is opened in 'w+' mode o the default system buffer is used (cf; setbuf() ) in buffered mode The stream2 appender can be configured by passing it a file pointer to use. In this case you manage the file pointer yourself--open, option setting, closing. If you set the file pointer log4c will not close the file on exiting--you must do this: log4c_appender_t* myappender; FILE * fp = fopen('myfile.log', 'w'); myappender = log4c_appender_get('myappender'); log4c_appender_set_type(myappender, log4c_appender_type_get('stream2')); log4c_stream2_set_fp(stream2_appender,myfp); The default file pointer can be configured to use unbuffered mode. Buffered mode is typically 25%-50% faster than unbuffered mode but unbuffered mode is useful if your preference is for a more synchronized log file: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); log4c_stream2_set_flags(myappender, LOG4C_STREAM2_UNBUFFERED); Function Documentation LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Get the flags for this appender. Parameters: this a pointer to the appender Returns: the flags for this appender. returns -1 if there was a problem. LOG4C_API FILE* log4c_stream2_get_fp (log4c_appender_t *a_this) Get the file pointer for this appender. Parameters: this a pointer to the appender Returns: the file pointer for this appender. If there's a problem returns NULL. LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, intflags) Set the flags for this appender. Parameters: this a pointer to the appender flags ar teh flags to set. These will overwrite the existing flags. Currently supported flags: LOG4C_STREAM2_UNBUFFERED LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) Set the file pointer for this appender. Parameters: this a pointer to the appender fp the file pointer this appender will use. The caller is responsible for managing the file pointer (open, option setting, closing). Variable Documentation __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Stream2 appender type definition. This should be used as a parameter to the log4c_appender_set_type() routine to set the type of the appender. Author Generated automatically by Doxygen for log4c from the source code. Version 1.2.1 Mon May 2 2011 appender_type_stream2.h(3)
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy