---
name: "ms_readleapsecondfile"
section: "3"
platform: "linux"
package: "libmseed-doc"
version: "2.19.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ms_readleapsecondfile"
---

# ms\_readleapsecondfile(3)

Read a leap second file into a global buffer

## NAME

ms\_readleapseconds - Read a leap second file into a global buffer

## SYNOPSIS

```
#include <libmseed.h>
int  ms_readleapseconds ( char *envvarname );
int  ms_readleapsecondfile ( char *filename );
```

## DESCRIPTION

These functions read a leap seconds file and store a list of leap seconds in an internal, global list.  The leap seconds are used to determine the proper end time of a record (and consquently a trace). The use of this facility causes the leap second indication in the fixed section data header to be ignored.

The **ms\_readleapseconds** function takes and environment variable name that is expected to contain the name of a leap seconds file.  The **ms\_readleapsecondfile** function takes the name of a leap second file.

## LEAP SECOND LIST FILE

The leap second list file is expected to contain a list of leap second times and TAI-UTC difference values.  The first column should be time stamps as seconds since the NTP epoch (Jan. 1 1900).  The second column should be 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

## RETURN VALUES

**ms\_readleapseconds** returns the number of leap seconds read on success, -1 on file read errors and -2 when the environment variable is not set.

**ms\_readleapsecondfile** returns the number leap seconds read on success and -1 on errors.

## AUTHOR

```
Chad Trabant
IRIS Data Management Center
```
