OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man3 / rtime.3
1 .\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" Modified 2003-04-04 Walter Harms
4 .\" <walter.harms@informatik.uni-oldenburg.de>
5 .\"
6 .\" Slightly polished, aeb, 2003-04-06
7 .\"
8 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
9 .\"         all rights reserved.
10 .\" Translated Thu Sep  2 07:40:48 JST 2004
11 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
12 .\"
13 .TH RTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual"
14 .SH Ì¾Á°
15 rtime \- ¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë
16 .SH ½ñ¼°
17 .nf
18 .B "#include <rpc/des_crypt.h>"
19 .sp
20 .BI "int rtime(struct sockaddr_in *" addrp ", struct rpc_timeval *" timep ,
21 .BI "          struct rpc_timeval *" timeout );
22 .fi
23 .SH ÀâÌÀ
24 ¤³¤Î´Ø¿ô¤Ï RFC\ 868 ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¡¢
25 ¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é»þ¹ï¤ò¼èÆÀ¤¹¤ë¡£
26 .LP
27 ¥¿¥¤¥à¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤Ï 00:00:00 UTC, 1 Jan 1900 ¤«¤éÉÿô¤òÄ󶡤¹¤ë¤Î¤Ç¡¢
28 ¤³¤Î´Ø¿ô¤ÏŬÀÚ¤ÊÄê¿ôÃͤò°ú¤¯¤³¤È¤Ë¤è¤ê¡¢
29 Ä󶡤µ¤ì¤¿Ãͤò Unix ¤Ë¤ª¤±¤ë»þ¹ïµª¸µ (1970-01-01 00:00:00 +0000 (UTC))
30 ¤«¤éÉÿô¤ËÊÑ´¹¤¹¤ë¡£
31 .LP
32 .I timeout
33 ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢udp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£
34 ¤½¤ì°Ê³°¤Î¾ì¹ç¡¢tcp/time ¥½¥±¥Ã¥È (¥Ý¡¼¥È 37) ¤¬»ÈÍѤµ¤ì¤ë¡£
35 .SH ÊÖ¤êÃÍ
36 À®¸ù¤·¤¿¾ì¹ç¤Ï¡¢0 ¤¬ÊÖ¤µ¤ì¤Æ¡¢ÆÀ¤é¤ì¤¿ 32 ¥Ó¥Ã¥È¤Î»þ¹ïÃͤÏ
37 .I timep\->tv_sec
38 ¤Ë³ÊǼ¤µ¤ì¤ë¡£
39 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢
40 .I errno
41 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
42 .SH ¥¨¥é¡¼
43 ÆâÉô¤Ç»ÈÍѤ·¤Æ¤¤¤ë´Ø¿ô
44 .RB ( sendto (2),
45 .BR poll (2),
46 .BR recvfrom (2),
47 .BR connect (2),
48 .BR read (2))
49 ¤ÎÁ´¤Æ¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
50 ¹¹¤Ë¼¡¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë:
51 .TP
52 .B EIO
53 ÊÖ¤µ¤ì¤¿¥Ð¥¤¥È¿ô¤¬ 4 ¥Ð¥¤¥È¤Ç¤Ê¤¤¡£
54 .TP
55 .B ETIMEDOUT
56 timeout ¤ÇÄêµÁ¤µ¤ì¤¿ÂÔ¤Á»þ´Ö¤Î´ü¸Â¤¬Àڤ줿¡£
57 .SH Ãí°Õ
58 IPv4 ¤Î¤ß¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
59 .LP
60 .I in.timed
61 ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï TCP ¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤â¤¢¤ë¡£
62 .I use_tcp
63 ¤ò 1 ¤ËÀßÄꤷ¤Æ¡¢Îã¤Ë¤¢¤ë¥×¥í¥°¥é¥à¤ò»î¤¹¤³¤È¡£
64 .LP
65 libc5 ¤Ï¥×¥í¥È¥¿¥¤¥×
66 .br
67 int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
68 .br
69 ¤ò»È¤¤¡¢
70 .I <rpc/auth_des.h>
71 ¤ÎÂå¤ï¤ê¤Ë
72 .I <sys/time.h>
73 ¤òɬÍפȤ¹¤ë¡£
74 .SH ¥Ð¥°
75 glibc 2.2.5 °ÊÁ°¤Î
76 .BR rtime ()
77 ¤Ï¡¢64 ¥Ó¥Ã¥È¥Þ¥·¥ó¤ÇÀµ³Î¤ËÆ°ºî¤·¤Ê¤¤¡£
78 .SH Îã
79 ¤³¤ÎÎã¤Ç¤Ï¥Ý¡¼¥È 37 ¤¬¥¢¥Ã¥×¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
80 .I /etc/inetd.conf
81 ¤Î time ¥¨¥ó¥È¥ê¤¬¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤·¤Æ¤Û¤·¤¤¡£
82 .br
83 ¤³¤Î¥×¥í¥°¥é¥à¤Ï "linux" ¤È¤¤¤¦¥³¥ó¥Ô¥å¡¼¥¿¤ËÀܳ¤¹¤ë¡£
84 "localhost" ¤ò»È¤Ã¤¿¾ì¹ç¤ÏÆ°ºî¤·¤Ê¤¤¡£
85 ·ë²Ì¤Ï¥³¥ó¥Ô¥å¡¼¥¿ "linux" ¤Î¥í¡¼¥«¥ë»þ¹ï¤Ç¤¢¤ë¡£
86 .sp
87 .nf
88 #include <stdio.h>
89 #include <stdlib.h>
90 #include <errno.h>
91 #include <string.h>
92 #include <time.h>
93 #include <rpc/auth_des.h>
94 #include <netdb.h>
95
96 int use_tcp = 0;
97 char *servername = "linux";
98
99 int
100 main(void)
101 {
102     struct sockaddr_in name;
103     struct rpc_timeval time1 = {0,0};
104     struct rpc_timeval timeout = {1,0};
105     struct hostent *hent;
106     int ret;
107
108     memset((char *) &name, 0, sizeof(name));
109     sethostent(1);
110     hent = gethostbyname(servername);
111     memcpy((char *) &name.sin_addr, hent\->h_addr, hent\->h_length);
112
113     ret = rtime(&name, &time1, use_tcp ? NULL : &timeout);
114     if (ret < 0)
115         perror("rtime error");
116     else
117         printf("%s\\n", ctime((time_t *) &time1.tv_sec));
118
119     exit(EXIT_SUCCESS);
120 }
121 .fi
122 .SH ´ØÏ¢¹àÌÜ
123 .\" .BR netdate (1),
124 .BR ntpdate (1),
125 .\" .BR rdate (1),
126 .BR inetd (8)