leapsecs man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

leapsecs(3)							   leapsecs(3)

NAME
       leapsecs - handle UTC leap seconds

SYNTAX
       #include <leapsecs.h>

       int leapsecs_sub(&t);
       void leapsecs_add(&t,hit);

       int leapsecs_read();
       int leapsecs_init();

       struct tai t;
       int hit;

DESCRIPTION
       leapsecs_sub  changes  a seconds-since-epoch count into a non-leap-sec‐
       onds-since-epoch count.	It interprets t as a  TAI64  label,  subtracts
       from  t	the  number of leap seconds that have occurred before or at t,
       and places the result back into t.

       leapsecs_sub returns 1 if t was a leap second, 0 otherwise.

       leapsecs_add reverses the effect of leapsecs_sub.  hit must be 1 for  a
       leap second, 0 otherwise.

LEAP-SECOND TABLE
       The  current  implementation  of	 leapsecs_sub  and leapsecs_add uses a
       leap-second table read from disk.

       leapsecs_read	  reads	     the      leap-second      table	  from
       /usr/local/etc/leapsecs.dat.  It returns 0 on success, -1 on error.  If
       /usr/local/etc/leapsecs.dat does not exist, leapsecs_read treats it  as
       an empty file.

       leapsecs_init  is a one-time version of leapsecs_read.  Initially it is
       the same as  leapsecs_read;  however,  once  leapsecs_read  returns  0,
       leapsecs_init will always return 0 without calling leapsecs_read again.

       leapsecs_add   and   leapsecs_sub   call	 leapsecs_init.	  WARNING:  If
       leapsecs_init returns failure, leapsecs_add and leapsecs_sub will  pro‐
       ceed without a leap-second table.  For reliability, all programs should
       call leapsecs_init at startup and check for errors.

       WARNING: New entries are added to the leap-second table on  disk	 every
       12  to  18  months.  leapsecs_read may be called repeatedly.  It leaves
       the old table alone on error.  For reliability, all  long-running  pro‐
       grams should call leapsecs_read at least once every month.

SEE ALSO
       tai(3)

								   leapsecs(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net