summaryrefslogtreecommitdiffstats
path: root/man3/rtime.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/rtime.3')
-rw-r--r--man3/rtime.320
1 files changed, 9 insertions, 11 deletions
diff --git a/man3/rtime.3 b/man3/rtime.3
index c3c8b2b34..a866d0b81 100644
--- a/man3/rtime.3
+++ b/man3/rtime.3
@@ -8,7 +8,7 @@
.\"
.\" Slightly polished, aeb, 2003-04-06
.\"
-.TH rtime 3 2022-12-15 "Linux man-pages 6.03"
+.TH rtime 3 2023-07-20 "Linux man-pages 6.05.01"
.SH NAME
rtime \- get time from a remote machine
.SH LIBRARY
@@ -59,19 +59,17 @@ The waiting time as defined in timeout has expired.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
-.ad l
-.nh
.TS
allbox;
lbx lb lb
l l l.
Interface Attribute Value
T{
+.na
+.nh
.BR rtime ()
T} Thread safety MT-Safe
.TE
-.hy
-.ad
.sp 1
.SH NOTES
Only IPv4 is supported.
@@ -115,12 +113,12 @@ The result is the localtime of the computer "linux".
#include <stdlib.h>
#include <string.h>
#include <time.h>
-
+\&
#include <rpc/auth_des.h>
-
+\&
static int use_tcp = 0;
static const char servername[] = "linux";
-
+\&
int
main(void)
{
@@ -130,12 +128,12 @@ main(void)
struct rpc_timeval time1 = {0, 0};
struct rpc_timeval timeout = {1, 0};
struct sockaddr_in name;
-
+\&
memset(&name, 0, sizeof(name));
sethostent(1);
hent = gethostbyname(servername);
memcpy(&name.sin_addr, hent\->h_addr, hent\->h_length);
-
+\&
ret = rtime(&name, &time1, use_tcp ? NULL : &timeout);
if (ret < 0)
perror("rtime error");
@@ -143,7 +141,7 @@ main(void)
t = time1.tv_sec;
printf("%s\en", ctime(&t));
}
-
+\&
exit(EXIT_SUCCESS);
}
.EE