Sponsored Content
Top Forums Programming Doubt with signals and sleep function Post 302847659 by bacesado on Tuesday 27th of August 2013 02:18:52 PM
Old 08-27-2013
Corona688 thank you ! i only need read the man of sleep...

Sleep when is interrupted , stop it and return the number of seconds that are missing.... so i put a while until sleep finish and ....it works! (or i believe that works).
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Signals...

(posted this in the scripting forum as well, but figured it should go here) So, what's going on is this: For our program, we had to create our own shell, and if the user pressed ctrl-c just at the cmdline, then this signal would be ignored, but if there is a foreground process running, let's... (0 Replies)
Discussion started by: blind melon
0 Replies

2. Shell Programming and Scripting

Function call with argument doubt

Hi all, I am having a problem with user defined function call. I am new into the concept of shell script UDFs. My function is: iterate_directory() { cd $1 k=0 for i in * do if then ARR=${i} fi done echo ${ARR } } (4 Replies)
Discussion started by: canishk
4 Replies

3. Shell Programming and Scripting

Wrapping 'sleep' with my 'resleep' function (Resettable sleep)

This is a very crude attempt in Bash at something that I needed but didn't seem to find in the 'sleep' command. However, I would like to be able to do it without the need for the temp file. Please go easy on me if this is already possible in some other way: How many times have you used the... (5 Replies)
Discussion started by: deckard
5 Replies

4. Shell Programming and Scripting

Help with sleep function

Hey everyone, just entering the linux world, I need some help with a shell script i'm trying to write, the purpose is to check every 10 minutes what was the last time a certain file was modified, and if there is a connection to the server at this moment send an email with the date of the... (2 Replies)
Discussion started by: moshe88
2 Replies

5. Programming

C Sleep function hangs @ __kernel_vsyscall ()

This is the gdb backtrace. ^C Program received signal SIGINT, Interrupt. 0xffffe424 in __kernel_vsyscall () (gdb) bt #0 0xffffe424 in __kernel_vsyscall () #1 0xb7e56a70 in __nanosleep_nocancel () from /lib/libc.so.6 #2 0xb7e568bb in __sleep (seconds=0) at sleep.c:138 #3 0x080496d5 in... (6 Replies)
Discussion started by: dragonpoint
6 Replies

6. Programming

Trivial doubt about C function pointer

Hi, In the below C code, #include <stdio.h> void print() { printf("Hello\n"); } int main() { void (*f)() = (void (*)()) print; f(); (*f)(); } I wonder, how the syntaxes "f()" and "(*f)()" are treated as same without any error? Is this an improvement or ANSI/ISO... (1 Reply)
Discussion started by: royalibrahim
1 Replies

7. Shell Programming and Scripting

How the Sleep function will work?

Hi All, I am new to Unix , there i am facing one problem with sleep command. that is .. in while loop i have defined sleep function .. my condition is like this while #i knew this is infinite loop do sleep 200 echo "hello " done. this condition will never become .. true... (3 Replies)
Discussion started by: mandlysreedhar
3 Replies

8. Programming

Sleep function not detected

Hello Im using geany to write my c codes. Below is my code to make the internal LED of beaglebone flashing. But i cant seem to use the sleep or delay to make the program wait for a couple of miliseconds. I've included all include files that i can find but none of it solve the problem. Any help is... (1 Reply)
Discussion started by: HellRyder
1 Replies

9. Shell Programming and Scripting

Oracle function invoked from shell script doubt

hi gurus, I have tried myself to invoke an oracle function. there are three different function available need to be called for differnt. can you tell me whether the below code is correct to call oracle function from shell script. Any help would be highly appreciated. cat location.sh ... (5 Replies)
Discussion started by: arun888
5 Replies
sleep(3)						     Library Functions Manual							  sleep(3)

Name
       sleep - suspend execution for interval

Syntax
       unsigned
       sleep(seconds)
       unsigned seconds;

Description
       The  current process is suspended from execution for the number of seconds specified by the argument.  The actual suspension time may be up
       to 1 second less than that requested, because scheduled wakeups occur at fixed 1-second intervals, and an arbitrary amount  longer  because
       of other activity in the system.

       The  routine  is  implemented  by  setting  an  interval  timer and pausing until it occurs.  The previous state of this timer is saved and
       restored.  If the sleep time exceeds the time to the expiration of the previous timer, the process sleeps only until the signal would  have
       occurred, and the signal is sent 1 second later.

Return Values
       The  value  returned by is the unslept amount(the requested time minus the time actually slept). This return value may be non-zero in cases
       where the caller had an alarm set to go off earlier than the end of the requested time, or where was interrupted due to a caught signal(see
       ENVIRONMENT below).

Environment
       POSIX
       SYSTEM_FIVE
       When  your  program  is compiled in POSIX or System V mode, the will be terminated by any caught signal. The function will return following
       execution of the signal's catching routine.

See Also
       setitimer(2), sigpause(2)

																	  sleep(3)
All times are GMT -4. The time now is 12:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy