MS_READLEAPSECONDS(3)
β¨ MS_READLEAPSECONDS(3) β¨
okay bestie, gather round, this one's from the Library Functions Manual section of the libmseed docs and it's literally about reading leap second files. iconic behavior. π
πΈ NAME πΈ
ms_readleapseconds β read a leap second file into a global buffer. that's it, that's the whole job, and she does it flawlessly.
π SYNOPSIS π
#include <libmseed.h>
int ms_readleapseconds ( char *envvarname );
int ms_readleapsecondfile ( char *filename );
π DESCRIPTION π
so here's the tea, bestie β β these functions read a leap seconds file and stash a whole list of leap seconds into an internal, global list. very main character energy, very "I hold the truth in one place."
and what are those leap seconds even for? they get used to figure out the proper end time of a record (and consequently a trace). so yeah, kind of a big deal.
β οΈ heads up: the way that using this facility causes the leap second indication in the fixed section data header to be ignored?? yeah. no cap. it just gets ignored. π«Ά
now let's break down the two girlies:
ms_readleapsecondstakes an environment variable name, and that env var is expected to contain the name of a leap seconds file. so it's like, env var β filename β leap seconds. a little relay race. πββοΈms_readleapsecondfiletakes the name of a leap second file directly. no middleman. straight to the source. periodt.
π LEAP SECOND LIST FILE π
so what does this file actually look like? it's expected to contain a list of leap second times and TAI-UTC difference values. two columns, two jobs:
- first column β time stamps as seconds since the NTP epoch (
Jan. 1 1900) - second column β an integer number of seconds that specify the difference between TAI and UTC
usually the most recent version of this file is available here: https://www.ietf.org/timezones/data/leap-seconds.list
go get it bestie, it's giving fresh data πΈ
π¦ RETURN VALUES π¦
okay so the vibes check out on returns too, let's be precise:
ms_readleapseconds returns:
- the number of leap seconds read on success β¨
-1on file read errors π-2when the environment variable is not set π
ms_readleapsecondfile returns:
- the number of leap seconds read on success β¨
-1on errors π
π AUTHOR π
Chad Trabant IRIS Data Management Center
and that's the whole page, bestie!! this libmseed API page is dated 2016/10/01, and honestly? still slaying. read your leap seconds, respect the global list, and never forget that the fixed section data header leap second indication is getting ignored. iykyk πβ¨π
π¦ where this page comes from
- debian bookworm: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- debian trixie: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libmseed-doc 2.19.6-3 Β· LGPL-3.0-or-later
- ubuntu noble: libmseed-doc 2.19.8-1ubuntu2 Β· LGPL-3.0-or-later
- ubuntu questing: libmseed-doc 2.19.8-1ubuntu2
- ubuntu resolute: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- ubuntu stonking: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms