Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

alarm(2) [redhat man page]

ALARM(2)						     Linux Programmer's Manual							  ALARM(2)

alarm - set an alarm clock for delivery of a signal SYNOPSIS
#include <unistd.h> unsigned int alarm(unsigned int seconds); DESCRIPTION
alarm arranges for a SIGALRM signal to be delivered to the process in seconds seconds. If seconds is zero, no new alarm is scheduled. In any event any previously set alarm is cancelled. RETURN VALUE
alarm returns the number of seconds remaining until any previously scheduled alarm was due to be delivered, or zero if there was no previ- ously scheduled alarm. NOTES
alarm and setitimer share the same timer; calls to one will interfere with use of the other. sleep() may be implemented using SIGALRM; mixing calls to alarm() and sleep() is a bad idea. Scheduling delays can, as ever, cause the execution of the process to be delayed by an arbitrary amount of time. CONFORMING TO
setitimer(2), signal(2), sigaction(2), gettimeofday(2), select(2), pause(2), sleep(3) Linux 1993-07-21 ALARM(2)

Check Out this Related Man Page

ALARM(3)						   BSD Library Functions Manual 						  ALARM(3)

alarm -- set signal timer alarm LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> unsigned alarm(unsigned seconds); DESCRIPTION
This interface is made obsolete by setitimer(2). The alarm() function sets a timer to deliver the signal SIGALRM to the calling process after the specified number of seconds. If an alarm has already been set with alarm() but has not been delivered, another call to alarm() will supersede the prior call. The request alarm(0) voids the current alarm and the signal SIGALRM will not be delivered. Due to setitimer(2) restriction the maximum number of seconds allowed is 100000000. RETURN VALUES
The return value of alarm() is the amount of time left on the timer from a previous call to alarm(). If no alarm is currently set, the return value is 0. SEE ALSO
setitimer(2), sigaction(2), sigpause(2), sigvec(2), signal(3), sleep(3), ualarm(3), usleep(3) HISTORY
An alarm() function appeared in Version 7 AT&T UNIX. BSD
April 19, 1994 BSD
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help me

when i use cc command to compile a C program **.c , system gave me a alarm message:optional language package not installed,please tell me how to insovle this problem? SUN system , SunWorkshop cc may be ,i don't install c language package,do i? thanks for your instruct (2 Replies)
Discussion started by: xukai
2 Replies

2. UNIX for Dummies Questions & Answers


I have a Solaris 2.6 machine and I execute the following: while do echo looping sleep 15 done I would assume the looping would be printed every 15 seconds but it doesn't. consecutive looping gets printed without a 15 second gap. Any idea what might be the reason ? Thanks (9 Replies)
Discussion started by: brv
9 Replies

3. Programming

generating timer

I'm trying generate an interrupt every 1 seconds using itimer and My clock is not running. This is what i did : printf("about to sleep for 1 second \n"); signal(SIGALRM, wakeup); //myTimer.it_interval.tv_sec=0; //myTimer.it_interval.tv_usec =0; ... (5 Replies)
Discussion started by: Confuse
5 Replies

4. Windows & DOS: Issues & Discussions

I need a free firewall besides zone alarm for XP PRO

Please help. Reply and tell me if you find one. Lots of thanks! Computek (6 Replies)
Discussion started by: computek
6 Replies

5. Shell Programming and Scripting

Perl alarm signal

I am trying to write a signal to exit when a process times out. What I have come up with from poking around the web is this. #!/usr/bin/perl eval { local $SIG{ALRM} = sub { die "alarm clock restart" }; alarm 10; open(DSMADMC, "dsmadmc -se=tsmpc1 -id=XXXXX... (2 Replies)
Discussion started by: reggiej
2 Replies

6. SCO

Raid5 Failure

Forgive me, I do not know much about RAID so I'm going to be as detailed as possible. This morning, our server's alarm was going. I found that one of our drives have failed. (we have 3) It is an Adaptec ATA RAID 2400A controller I'm purchasing a new SCSI drive today. My questions: ... (2 Replies)
Discussion started by: gseyforth
2 Replies

7. Programming

Basic signal and alarm usage

I am trying to write a program that will; 1) Show the message "Snoozing now...zzzz" on the screen for 5 seconds 2) Then in the same position show the message "The ALARM is going off now!" for 5 seconds 3) Repeat 1) then 2) infinitely until user presses Ctrl C I can't make it work. Any hints... (17 Replies)
Discussion started by: enuenu
17 Replies

8. Shell Programming and Scripting

awk help

Discussion started by: anhtt
3 Replies

9. Shell Programming and Scripting

Need Help !!! simple query

Dear, I have a alarm text file, containing minor and major alarms, i am intrested in Mojor alarm with its alarm header and next four lines in seperate file.... Can anybody help me with this below is the alarm file output. :SEV="MAJOR": Object-Instance % unit-type % bts nbr % 25 ... (5 Replies)
Discussion started by: Danish Shakil
5 Replies

10. Shell Programming and Scripting

Filter some text

Dear experts, Below i have mentioned two alarms with MAJOR severity, i am intrested only with alarm contains text tre , actually i want to filter out alarm which is highlighted in bold text in some other file for further processing. I need all above three line of the alarm containing text tre... (3 Replies)
Discussion started by: Danish Shakil
3 Replies

11. Shell Programming and Scripting

Delete 2 months before old files when we get alarm directory size > 90%

Please Help me Question: - we manually moving/removing old files, when we are getting alarm as /dir1/dir2 size greater than 90%. we manually moving/removing old files and reduce the file size to less than 90% - I want to delete all 2months before old files once we get the thresh hold >= 90%... (3 Replies)
Discussion started by: piyus
3 Replies

12. Shell Programming and Scripting

crontab+mplayer alarm clock

I'm trying to run a using crontab, which play a song as an alarm at 6.15 am. I'm using amixer so that volume increases by 10% in every loop. My script is the following. SHELL=/bin/bash PLAYER=/usr/bin/mplayer SONG=/home/hbar/Music/song.mp3 DISPLAY=:0.0 15 06 * * *... (10 Replies)
Discussion started by: hbar
10 Replies

13. UNIX for Dummies Questions & Answers

Print events from two lines with a common identifier

Hi Unix Gurus, I have a long text file, where alarms events are logged and alarm clear event are logged. Both events alarm and alarm clear has common identifier as{xxxxxxxxxx} I need to analyse the time-period for which the alarm sustained. i.e Output: timestamp from both event has... (3 Replies)
Discussion started by: vanand420
3 Replies

14. Shell Programming and Scripting

Need help in restarting process

Hi friends, I have one unix command which is used to check the network status manually. followig is the command check_Network this command give follwoing status Network 1 is ok Network 2 is ok network 3 is ok network 4 is ok . . . . Network 10 is... (8 Replies)
Discussion started by: Nakul_sh
8 Replies

15. Shell Programming and Scripting

Add command line argument

I would like to add the ability to change the message that is displayed when timer is finished. At present it just asks for the time I want for the alarm. I think what I need is another command line argument. soundfile="/usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3"... (5 Replies)
Discussion started by: drew77
5 Replies

Featured Tech Videos