Sponsored Content
Top Forums Programming select() system call takes longer than the timeout specified Post 302408767 by old_as_a_fossil on Tuesday 30th of March 2010 11:47:20 AM
Old 03-30-2010
Neither. It is struct timeval.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

2. UNIX for Advanced & Expert Users

Login Process takes longer

Hello. Since Yesterday, I notice that after giving telnet IP or SSH IP - it takes long time to display login: , I mean earlier after entering Server name It used to immediately ask for login ID and then password. But, now it takes min of 2-3 minute to ask for password. Where can I check,... (12 Replies)
Discussion started by: panchpan
12 Replies

3. UNIX for Advanced & Expert Users

how to use exceptfds argument in select system call

Hi, Can any one tell me how to use the fourth argument of select system call.I saw example "port forwarding" on the net,but it was too complex for me to understand.Can any one explain me about the usage of exceptfds argument of select system call with simple example. Thanks. (2 Replies)
Discussion started by: bvijaya
2 Replies

4. UNIX and Linux Applications

Syb15 Query takes longer, help me out

When i run the below query in syb15 (with syb 12.5.X backward compatibilty) environment it runs 45min where as the same in syb12.5.1 it takes only 7-10min. But the main thing is stld_date(in the below query) does not covered in the index of that table. Also main_table is a huge table. So is it... (1 Reply)
Discussion started by: prsam
1 Replies

5. Programming

Having some trouble with select() call in C

I have this while loop: while (notdone) { //Set the timers waitd.tv_sec = 5; waitd.tv_usec = 0; FD_ZERO(&tempreadfds); FD_ZERO(&tempwritefds); FD_ZERO(&readfds); /* initialize the read fd set */ FD_ZERO(&writefds); /* initialize the write fd set */ ... (1 Reply)
Discussion started by: Legend986
1 Replies

6. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

7. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

8. Homework & Coursework Questions

program to send messages to parent using pipes and select system call

Write a program using select, which will create some number of child processes that continuously send text messages to the parent process using pipes. Each child has its own pipe that it uses to communicate with the parent. The parent uses select () to decide what pipes should be processed to... (1 Reply)
Discussion started by: ripssingh
1 Replies

9. UNIX for Advanced & Expert Users

Issues with select system call

1. We are using client-server model communication using TCP/IP protocol 2. The TCP socket created with O_NON_BLOCK flag 3. When we make attempt to send large data to other process, the send is partially successful. It means we attempt to send 90K data, OS sent only 40K data successfully. ... (3 Replies)
Discussion started by: MasthanDudekula
3 Replies

10. Shell Programming and Scripting

Timeout to abolish ssh connection command it takes too long

Hi, I am running a ssh connection test in a script, how can I add a timeout to abolish the process if it takes too long? ssh -i ~/.ssh/ssl_key useraccount@computer1 Thank you. - j (1 Reply)
Discussion started by: hce
1 Replies
SNMP_ALARM(3)							     Net-SNMP							     SNMP_ALARM(3)

NAME
snmp_alarm_register, snmp_alarm_register_hr, snmp_alarm_unregister - alarm functions SYNOPSIS
#include <net-snmp/utilities.h> unsigned int snmp_alarm_register(unsigned int seconds, unsigned int flags, SNMPAlarmCallback *f_callback, void *clientarg); unsigned int snmp_alarm_register_hr(struct timeval t, unsigned int flags, SNMPAlarmCallback *f_callback, void *clientarg); void snmp_alarm_unregister(unsigned int reg); DESCRIPTION
These functions implement support for a generic timer handling mechanism for multiple parts of an application to register function call- backs to happen at a particular time in the future. USAGE
The usage is fairly simple and straight-forward: Simply create a function you want called back at some point in the future. The function definition should be similar to: void my_callback(unsigned int reg, void *clientarg); Then, call snmp_alarm_register() to register your callback to be called seconds from now. The flags field should either be SA_REPEAT or NULL. If flags is set with SA_REPEAT, then the registered callback function will be called every seconds. If flags is NULL then the func- tion will only be called once and then removed from the alarm system registration. The clientarg parameter in the registration function is used only by the client function and is stored and passed back directly to them on every call to the system. The snmp_alarm_register() function returns a unique unsigned int (which is also passed as the first argument of each callback), which can then be used to remove the callback from the queue at a later point in the future using the snmp_alarm_unregister() function. If the snmp_alarm_register() call fails it returns zero. In particular, note that it is entirely permissible for an alarm function to unregister itself. The snmp_alarm_register_hr() function is identical in operation to the snmp_alarm_register() function, but takes a struct timeval as a first parameter, and schedules the callback after the period represented by t (the letters hr stand for "high resolution"). The operation of this function is dependent on the provision of the setitimer(2) system call by the operating system. If this system call is not avail- able, the alarm will be scheduled as if snmp_alarm_register() had been called with a first argument equal to the value of the tv_sec member of t. See, however, the notes below. INITIALIZATION
The init_snmp() function initialises the snmp_alarm subsystem by calling init_snmp_alarm() and then init_alarm_post_config() to set up the first timer to initialise the callback function. These two functions should not be used directly by applications. NOTES
The default behaviour of the snmp_alarm subsystem is to request SIGALRM signals from the operating system via the alarm(2) or setitimer(2) system calls. This has the disadvantage, however, that no other part of the application can use the SIGLARM functionality (or, if some other part of the application does use the SIGALRM functionality, the snmp_alarm subsystem will not work correctly). If your application runs a select(2)-based event loop, however, there is no need to use SIGALRM for the snmp_alarm subsystem, leaving it available for other parts of the application. This is done by making the following call: netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_ALARM_DONT_USE_SIG, 1); before calling init_snmp(). Then, snmp_select_info() takes alarms into account when calculating the timeout value to be used for select(2). All you need to do is call run_alarms() when select(2) times out (return value of zero). This is the approach taken in the agent; see snmpd.c. Furthermore, when using this method, high resolution alarms do not depend on the presence of the setitimer(2) system call, although overall precision is of course still determined by the underlying operating system. Recommended. SEE ALSO
netsnmp_session_api(3), default_store(3), alarm(2), setitimer(2), select(2) V5.7.2 01 Aug 2002 SNMP_ALARM(3)
All times are GMT -4. The time now is 05:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy