OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / rtime.3
index eaf7675..aa74453 100644 (file)
@@ -9,12 +9,12 @@
 .\"
 .\" Slightly polished, aeb, 2003-04-06
 .\"
-.TH RTIME 3 2012-08-03 "GNU" "Linux Programmer's Manual"
+.TH RTIME 3 2014-05-28 "GNU" "Linux Programmer's Manual"
 .SH NAME
 rtime \- get time from a remote machine
 .SH SYNOPSIS
 .nf
-.B "#include <rpc/des_crypt.h>"
+.B "#include <rpc/auth_des.h>"
 .sp
 .BI "int rtime(struct sockaddr_in *" addrp ", struct rpc_timeval *" timep ,
 .BI "          struct rpc_timeval *" timeout );
@@ -54,20 +54,27 @@ The number of returned bytes is not 4.
 .TP
 .B ETIMEDOUT
 The waiting time as defined in timeout has expired.
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR rtime ()
+function is thread-safe.
 .SH NOTES
 Only IPv4 is supported.
 .LP
 Some
 .I in.timed
-versions only support TCP.
+versions support only TCP.
 Try the example program with
 .I use_tcp
 set to 1.
 .LP
 Libc5 uses the prototype
-.br
-int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
-.br
+.nf
+
+    int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
+
+.fi
 and requires
 .I <sys/time.h>
 instead of
@@ -81,7 +88,7 @@ You may check
 that the time entry within
 .I /etc/inetd.conf
 is not commented out.
-.br
+
 The program connects to a computer called "linux".
 Using "localhost" does not work.
 The result is the localtime of the computer "linux".
@@ -95,8 +102,8 @@ The result is the localtime of the computer "linux".
 #include <rpc/auth_des.h>
 #include <netdb.h>
 
-int use_tcp = 0;
-char *servername = "linux";
+static int use_tcp = 0;
+static char *servername = "linux";
 
 int
 main(void)
@@ -116,7 +123,7 @@ main(void)
     if (ret < 0)
         perror("rtime error");
     else {
-       time_t t = time1.tv_sec;
+        time_t t = time1.tv_sec;
         printf("%s\\n", ctime(&t));
     }
 
@@ -128,3 +135,12 @@ main(void)
 .BR ntpdate (1),
 .\" .BR rdate (1),
 .BR inetd (8)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.