OSDN Git Service

324ca6cc57dbeaf624299859bef69a3618707b79
[linuxjm/LDP_man-pages.git] / draft / man2 / alarm.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\"                               1993 Michael Haardt, Ian Jackson.
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Modified Wed Jul 21 19:42:57 1993, Rik Faith <faith@cs.unc.edu>
27 .\" Modified Sun Jul 21 21:25:26 1996, Andries Brouwer <aeb@cwi.nl>
28 .\" Modified Wed Nov  6 03:46:05 1996 by Eric S. Raymond <esr@thyrsus.com>
29 .\"
30 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
31 .\"         all rights reserved.
32 .\" Translated Wed Feb 22 20:02:18 JST 1997
33 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
34 .\"
35 .\"WORD:        alarm                   ¥¢¥é¡¼¥à
36 .\"WORD:        signal                  ¥·¥°¥Ê¥ë
37 .\"WORD:        clock                   ¥¯¥í¥Ã¥¯
38 .\"WORD:        process                 ¥×¥í¥»¥¹
39 .\"WORD:        timer                   ¥¿¥¤¥Þ¡¼
40 .\"WORD:        scheduling              ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°
41 .\"
42 .TH ALARM 2 2008-06-12 "Linux" "Linux Programmer's Manual"
43 .\"O .SH NAME
44 .SH Ì¾Á°
45 .\"O alarm \- set an alarm clock for delivery of a signal
46 alarm \- ¥·¥°¥Ê¥ëÇÛÁ÷¤Î¤¿¤á¤Î¥¢¥é¡¼¥à¡¦¥¯¥í¥Ã¥¯¤òÀßÄꤹ¤ë
47 .\"O .SH SYNOPSIS
48 .SH ½ñ¼°
49 .nf
50 .B #include <unistd.h>
51 .sp
52 .BI "unsigned int alarm(unsigned int " seconds );
53 .fi
54 .\"O .SH DESCRIPTION
55 .SH ÀâÌÀ
56 .\"O .BR alarm ()
57 .\"O arranges for a
58 .\"O .B SIGALRM
59 .\"O signal to be delivered to the calling process in
60 .\"O .I seconds
61 .\"O seconds.
62 .BR alarm ()
63 ¤Ï
64 .B SIGALRM
65 ¥·¥°¥Ê¥ë¤ò
66 .I seconds
67 Éøå¤Ë¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤ËÇÛÁ÷¤¹¤ë¤è¤¦¤Ë¼êÇÛ¤¹¤ë¡£
68
69 .\"O If
70 .\"O .I seconds
71 .\"O is zero, no new
72 .\"O .BR alarm ()
73 .\"O is scheduled.
74 .I seconds
75 ¤¬¥¼¥í¤Ê¤é¤Ð¡¢¿·¤¿¤Ê
76 .BR alarm ()
77 ¤Ï¼êÇÛ¤µ¤ì¤Ê¤¤¡£
78
79 .\"O In any event any previously set
80 .\"O .BR alarm ()
81 .\"O is canceled.
82 º£¤Þ¤Ç¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿
83 .BR alarm ()
84 ¤ÏÃæÃǤµ¤ì¤ë¡£
85 .\"O .SH "RETURN VALUE"
86 .SH ÊÖ¤êÃÍ
87 .\"O .BR alarm ()
88 .\"O returns the number of seconds remaining until any previously scheduled
89 .\"O alarm was due to be delivered, or zero if there was no previously
90 .\"O scheduled alarm.
91 .BR alarm ()
92 ¤Ï°ÊÁ°¤ËͽÄꤵ¤ì¤Æ¤¤¤¿¥¢¥é¡¼¥à¤ÎÇÛÁ÷¤Þ¤Ç¤Î»Ä¤ê»þ´Ö¤òÊÖ¤¹¡£°ÊÁ°¤Ë
93 ¥¢¥é¡¼¥à¤¬Í½Äꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¼¥í¤òÊÖ¤¹¡£
94 .\"O .SH "CONFORMING TO"
95 .SH ½àµò
96 SVr4, POSIX.1-2001, 4.3BSD.
97 .\"O .SH NOTES
98 .SH Ãí°Õ
99 .\"O .BR alarm ()
100 .\"O and
101 .\"O .BR setitimer (2)
102 .\"O share the same timer; calls to one will interfere with use of the
103 .\"O other.
104 .BR alarm ()
105 ¤È
106 .BR setitimer (2)
107 ¤ÏƱ¤¸¥¿¥¤¥Þ¡¼¤ò¶¦Í­¤·¤Æ¤¤¤ë; ÊÒÊý¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤â¤¦°ìÊý¤Î
108 »ÈÍѤ˱ƶÁ¤òÍ¿¤¨¤ë¡£
109 .PP
110 .\"O .BR sleep (3)
111 .\"O may be implemented using
112 .\"O .BR SIGALRM ;
113 .\"O mixing calls to
114 .\"O .BR alarm ()
115 .\"O and
116 .\"O .BR sleep (3)
117 .\"O is a bad idea.
118 .BR sleep (3)
119 ¤Ï
120 .B SIGALRM
121 ¤òÍøÍѤ·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
122 .BR alarm ()
123 ¤È
124 .BR sleep (3)
125 ¤òº®¤¼¤Æ»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
126
127 .\"O Scheduling delays can, as ever, cause the execution of the process to
128 .\"O be delayed by an arbitrary amount of time.
129 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°(scheduling)¤ÎÃÙ±ä¤Ë¤è¤ê¡¢¥×¥í¥»¥¹¤Î¼Â¹Ô¤ËÉÔÄêÎ̤Î
130 Ãٱ䤬µ¯¤­¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
131 .\"O .SH "SEE ALSO"
132 .SH ´ØÏ¢¹àÌÜ
133 .BR gettimeofday (2),
134 .BR pause (2),
135 .BR select (2),
136 .BR setitimer (2),
137 .BR sigaction (2),
138 .BR signal (2),
139 .BR sleep (3),
140 .BR time (7)