RTIME(3)
π RTIME(3) β Library Functions Manual π
okay bestie, gather round, we're talking about rtime from the RTIME(3) manual, and it's giving "old-school internet magic" β¨
πΈ NAME πΈ
rtime β get remote time π°οΈβ¨
π SYNOPSIS π
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
int
rtime(struct sockaddr_in *addrp, struct timeval *timep,
struct timeval *timeout);
π DESCRIPTION π
so basically, the rtime() function goes and consults the Internet Time Server at the address that addrp points to, and then it hands you back the remote time in the timeval struct that timep points to. no cap, that's the whole vibe π
normally? it uses the UDP protocol when it's consulting the Time Server. periodt.
the timeout argument is the "how long are we waiting before we give up on a reply" girlie β it says how long the routine should wait before giving up when waiting for a reply. β³
but if timeout is specified as NULL? plot twist π«’ β the routine switches to TCP instead, and it will block until a reply is received from the time server. like, full commitment, no leaving, it's waiting right there. main character energy fr fr π
π₯ RETURN VALUES π₯
- returns the value
0if successful π₯³ - otherwise the value
-1is returned, and the global variableerrnois set to indicate the error π
bestie if you see a-1, go checkerrnoimmediately, that's where the tea is π΅
β¨ AVAILABILITY β¨
the rtime() function is part of libtirpc. π
and that's the whole page, bestie π¦ this little slice of Debian history is dated November 22, 1987, and it's from the Library Functions Manual β RTIME(3), no cap π
β¨
π¦ where this page comes from
- alpine 3.22: libtirpc-doc 1.3.5-r0 Β· BSD-3-Clause
- alpine 3.23: libtirpc-doc 1.3.5-r1 Β· BSD-3-Clause
- alpine 3.24: libtirpc-doc 1.3.5-r1 Β· BSD-3-Clause
- arch rolling: libtirpc 1.3.8-1 Β· SISSL AND BSD-3-Clause
- centos-stream 10: libtirpc-devel 1.3.5-1.el10 Β· SISSL AND BSD-3-Clause
- centos-stream 9: libtirpc-devel 1.3.3-9.el9 Β· SISSL and BSD
- centos-stream 9: libtirpc-devel 1.3.3-9.el9 Β· SISSL and BSD
- debian bookworm: libtirpc-dev 1.3.3+ds-1 Β· BSD-3-Clause
- debian trixie: libtirpc-dev 1.3.6+ds-1 Β· BSD-3-Clause
- fedora 43: libtirpc-devel 1.3.7-0.fc43 Β· SISSL AND BSD-3-Clause
- fedora 43: libtirpc-devel 1.3.7-0.fc43 Β· SISSL AND BSD-3-Clause
- fedora 43: libtirpc-devel 1.3.7-1.rc1.fc43 Β· SISSL AND BSD-3-Clause
- fedora 43: libtirpc-devel 1.3.7-1.rc1.fc43 Β· SISSL AND BSD-3-Clause
- fedora 44: libtirpc-devel 1.3.7-2.fc44 Β· SISSL AND BSD-3-Clause
- fedora 44: libtirpc-devel 1.3.7-2.fc44 Β· SISSL AND BSD-3-Clause
- fedora 44: libtirpc-devel 1.3.8-0.fc44 Β· SISSL AND BSD-3-Clause
- fedora 44: libtirpc-devel 1.3.8-0.fc44 Β· SISSL AND BSD-3-Clause
- nixos 26.05: libtirpc 1.3.7
- nixpkgs unstable: libtirpc 1.3.7
- opensuse-leap 16.0: libtirpc-devel 1.3.6-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libtirpc-devel 1.3.6-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libtirpc-devel 1.3.6-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libtirpc-devel 1.3.6-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtirpc-dev 1.3.2-2build1 Β· BSD-3-Clause
- ubuntu jammy: libtirpc-dev 1.3.2-2ubuntu0.1 Β· BSD-3-Clause
- ubuntu noble: libtirpc-dev 1.3.4+ds-1.1build1 Β· BSD-3-Clause
- ubuntu questing: libtirpc-dev 1.3.6+ds-1
- ubuntu resolute: libtirpc-dev 1.3.7-0.1 Β· BSD-3-Clause
- ubuntu stonking: libtirpc-dev 1.3.7+ds-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms