- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ANother script horror
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
Forums
Discussions
Discussions
Discussions
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
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
05-12-2003 07:50 PM
05-12-2003 07:50 PM
static void alarm_response(int sig)
{
(void) signal(sig,SIG_IGN);
longjmp(jump,sig);
return;
} /* alarm_response */
static void (*oldalrmsig)(int sig) = SIG_DFL;
oldalrmsig = signal(SIGALRM,SIG_IGN);
if (setjmp(mail_jump) == 0)
{
(void) signal(SIGALRM,alarm_response);
(void) alarm(120);
popen(...)
fgets();
pclose();
(void) alarm(0);
}
else
{
(void) fprintf(stderr,"Poopen timed out\n");
}
(void) signal(SIGALRM,oldalrmsig);
Hi Guru's
Above I taken out from Mr Clay reply from below :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x173563f96280d711abdc0090277a778c,00.html
Could anybody shed some light on all those called function.What is it do ?.
OR how do I run above.Do I need to comply it or just insert it in the file and just run it.
p/s: Look like C programming.Ooooo!!! Now I know why I not passed my C,C++ exam during school days.
still learning,
mB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 10:38 PM
05-12-2003 10:38 PM
Re: ANother script horror
using the system calls provided by HP-UX.
The mentioned functions are well defined in the manuals
e.g. man popen
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 10:53 PM
05-12-2003 10:53 PM
Re: ANother script horror
I didn't mean to give you 0 point.Miss click.If you reply again then I assign correct points.
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 11:13 PM
05-12-2003 11:13 PM
Re: ANother script horror
using the system calls provided by HP-UX.
The mentioned functions are well defined in the manuals
e.g. man popen
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2003 03:01 AM
05-13-2003 03:01 AM
Re: ANother script horror
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2003 04:17 AM
05-13-2003 04:17 AM
SolutionThe setjump() function saves the current stack environment... then a signal handler (alarm_response) is set and a 120sec alarm is armed, before actually calling the popen().
If the popen times out (takes longer than 120sec) then the alarm pops, the kernel sends SIGALARM, which triggers the signal handler. This handler uses longjmp() to jump to the old stack environment, which is just the else branch of the if statement.
In the original thread a code fragment was posted as question... so Clay assumed that posting another fragment as answer would be OK (it is, IMHO).
See
man signal(2)
man alarm(2)
man popen(3S) pclose(3S)
man setjmp(3C)
man longjmp(3C)
Best regard...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2003 04:22 AM
05-13-2003 04:22 AM
Re: ANother script horror
This code comes from another thread and the question in that thread was not yours and was a very specific question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2003 04:42 AM
05-13-2003 04:42 AM
Re: ANother script horror
Well I want to pick up new skill.That the first/foremost reason why I join this forum.
Also I did not post the question in the first thread because generating the new thread give me a power to assign a point for those who help.
your humble servant,
mB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2003 04:53 AM
05-13-2003 04:53 AM
Re: ANother script horror
Just kick some ass :)
You're absolutely right, a forum is to learn things. This is something I always wanted to learn.
I do think, they gave you some good answers already. It's probably some part of C (C++), and "man
But he, I am not easily satisfied as well :
http://computer.howstuffworks.com/c.htm
Will tell you more. I think it's quiet a course you're asking for right now. But you awoke me, I am looking into the same course as well right now.
Never stop learning !!
Best Regs David