Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

alarm(2) [hpux man page]

alarm(2)							System Calls Manual							  alarm(2)

alarm - set a process's alarm clock SYNOPSIS
instructs the alarm clock of the calling process to send the signal to the calling process after the number of real-time seconds specified by sec have elapsed; see signal(5). Specific implementations might place limitations on the maximum supported alarm time. The constant defined in specifies the implementation-specific maximum. Whenever sec is greater that this maximum, it is silently rounded down to it. On all implementations, is guaranteed to be at least 31 days (in seconds). Alarm requests are not stacked; successive calls reset the alarm clock of the calling process. If sec is 0, any previously made alarm request is canceled. Alarms are not inherited by a child process across a but are inherited across an On systems that support the and system calls, the timer mechanism used by is the same as that used by Thus successive calls to and set and return the state of a single timer. In addition, sets the timer interval to zero. RETURN VALUE
returns the amount of time previously remaining in the alarm clock of the calling process. WARNINGS
In some implementations, error bounds for alarm are -1, +0 seconds (for the posting of the alarm, not the restart of the process). Thus a delay of 1 second can return immediately. The routine can be used to create a more precise delay. SEE ALSO
sleep(1), exec(2), getitimer(2), pause(2), signal(5), sleep(3C). STANDARDS CONFORMANCE

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 int alarm(unsigned int 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 seconds after the call to alarm(). 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. The maximum number of seconds allowed is 2147483647. 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. If there is an error setting the timer, alarm() returns ((unsigned int) -1). SEE ALSO
setitimer(2), sigaction(2), sigsuspend(2), signal(3), sigvec(3), sleep(3), ualarm(3), usleep(3) STANDARDS
The alarm() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''). 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


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

2. 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

3. Solaris


Is there a imbedded command (Solaris v8 ksh) that will send an administrative alert/alarm. Or is it just triggering a mail message via shell script? If no, is there a good open-source code someone knows about? Thanks so much in advance for any replies. ...Gozer13 (3 Replies)
Discussion started by: gozer13
3 Replies

4. 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

5. Programming

Delay a process.

How to delay a process. I need to to delay a process from 3sec. At that 3sec other back ground processes also should stop. (just sit 3sec for idle & then starts execution as normally) I use sleep(3)-But it not stop the bg processes I try to use loop but it not gurantee to wait 3sec. ... (2 Replies)
Discussion started by: ugp
2 Replies

6. UNIX for Dummies Questions & Answers

Autosys Email Alarms

Hello, I'm kind of new to autosys, but I'm assuming there is a way to have Alarms be emailed instead of having to run jobscape and click the Alarm button to see what jobs have failed? Does anyone have an insight onto how this can be done? Thanks. (14 Replies)
Discussion started by: rpiller
14 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

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

9. Shell Programming and Scripting

Script searchs into a file

Dear Sirs, I want to write a script as an automatic action when I receive an alarm from a specific application. There are some variables attached to this alarm, one of them is an (ID) that represents some data. Example: ID Responder COS 5 6OCT2-R50C-GZ-EG Default... (2 Replies)
Discussion started by: ahmed.zaher
2 Replies

10. 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

11. 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

12. 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

13. 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

14. Shell Programming and Scripting

Creating a monitoring alarm every hour in UNIX

Hi, I need to create a monitoring alarm script which would check if the log file has been updated in the last one hour or not. I tried using -cmin however, one environment supports it where as the other does not. I would really need some help here!!! (2 Replies)
Discussion started by: Ritu245
2 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