03-20-2009
Quote:
Originally Posted by
Zipi
I don't see anything special about that code at all. It's just setting up a signal handler, not going about it in any special "safe" way. I think they mean motif-compatible, not 'safe' in any general sense.
Quote:
I am thinking of moving all the "dirty" stuff to this safe handler function (with dirty i mean everything that's not allowed in a handler function).Do you think that's ok?
Is it safe to do non-signal-safe things in a signal handler? No.
Quote:
2)What do you think of the traceLog function? Can it be called from the signal handler?
Depends what it does and how it does it.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. UNIX for Dummies Questions & Answers
Consider this simple command line
bash -c 'echo $$ ; sleep 10000'This will print the newly created bash PID and sleep for a long time.
If I go to another terminal and do something like
ps -flax | grep leepI'll see something like
501 92418 91910 0 0:00.00 ttys000 0:00.00 bash -c echo $$... (5 Replies)
Discussion started by: teras
5 Replies
3. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
4. Shell Programming and Scripting
Hi
I'm trying to write some code to confirm there is only one running instance in memory like below:
/usr/ucb/ps -auxww | egrep -v 'grep |vi |tail |more |cat ' | egrep ${SCRIPT_NAME} | egrep -v " \-h| \-help| \-v"
But sometimes i found there is some child processes are are created as... (4 Replies)
Discussion started by: sleepy_11
4 Replies
5. Shell Programming and Scripting
Hi,
when i grep for the process "XYZ" , there will be some good number of processes with that name, i want to kill all the these processes at a time using shell script?
Any help needed for this action.
Thanks
Regards,
Anil (6 Replies)
Discussion started by: anilmanepu
6 Replies
6. Shell Programming and Scripting
Hi there,
I am eager to know what exactly is the use of "finger" command & how to use it to kill the online processes ? :b: (1 Reply)
Discussion started by: abhijitpaul0212
1 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT DEBIAN
semanage_bool_iterate
semanage_iterate(3) Libsemanage API documentation semanage_iterate(3)
NAME
semanage_iterate - SELinux Management API
SYNOPSIS
The following iterate function is supported for any semanage record.
Replace the function and object name as necessary.
extern int ITERATE_FUNCTION (
semanage_handle_t *handle,
int (*handler) (
const semanage_OBJECT_t *object,
void *varg),
void *handler_arg);
DESCRIPTION
Behavior:
The iterate function will execute the specified handler over all objects in the selected location. An arbitrary argument can be
passed into the handler function along with each object.
The object passed in is property of the libsemanage library, and may not be modified or preserved - use semanage_OBJECT_clone if
that is necessary.
The handler code may not invoke any semanage write requests for the same object type (i.e. modifying the underlying store is not
allowed). The iterate function is reentrant only while inside a transaction (see semanage_begin_transaction ). It is not safe to
execute other semanage read or write requests within iterate if not inside a transaction. The handler may return -1 to signal error
exit, 0 to signal continue, and 1 to signal successful exit early (the iterate function will stop accordingly).
Parameters:
The handle is used to track persistent state across semanage calls, and for error reporting. The handler is the function to execute,
with handler_arg as its second parameter, and each object as its first parameter.
Requirements:
This function requires an semanage connection to be established (see semanage_connect(3) )
RETURN VALUE
In case of failure, -1 is returned, and the semanage error callback is invoked, describing the error. Otherwise a non-negative integer is
returned (a commit number). The same number will be returned by all other semanage object read calls until the next commit.
SEE ALSO
semanage_handle_create(3), semanage_connect(3),
ivg2@cornell.edu 15 March 2006 semanage_iterate(3)