summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/Makefile1
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--lib/libc/stdtime/Makefile.inc13
-rw-r--r--lib/libc/stdtime/ctime.3258
-rw-r--r--lib/libc/stdtime/private.h10
-rw-r--r--lib/libc/stdtime/strftime.3186
-rw-r--r--lib/libc/stdtime/tzfile.5117
-rw-r--r--lib/libc/string/Makefile.inc4
8 files changed, 524 insertions, 71 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 6740ee6..0ca19f8 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -22,6 +22,7 @@ PRECIOUSLIB= yes
.include "${.CURDIR}/regex/Makefile.inc"
.include "${.CURDIR}/stdio/Makefile.inc"
.include "${.CURDIR}/stdlib/Makefile.inc"
+.include "${.CURDIR}/stdtime/Makefile.inc"
.include "${.CURDIR}/string/Makefile.inc"
.include "${.CURDIR}/sys/Makefile.inc"
.include "${.CURDIR}/rpc/Makefile.inc"
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index f74983e..6d5027d 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -4,7 +4,7 @@
.PATH: ${.CURDIR}/${MACHINE}/gen ${.CURDIR}/gen
SRCS+= alarm.c assert.c clock.c closedir.c confstr.c crypt.c ctermid.c \
- ctime.c daemon.c devname.c difftime.c disklabel.c err.c errlst.c \
+ daemon.c devname.c disklabel.c err.c errlst.c \
exec.c fnmatch.c frexp.c fstab.c fts.c getbsize.c getcap.c getcwd.c \
getdomainname.c getgrent.c getgrouplist.c gethostname.c getloadavg.c \
getlogin.c getmntinfo.c getnetgrent.c getosreldate.c getpagesize.c \
@@ -30,7 +30,7 @@ errlst.o errlst.po:
.endif
MAN3+= gen/alarm.3 gen/clock.3 gen/confstr.3 gen/crypt.3 gen/ctermid.3 \
- gen/ctime.3 gen/daemon.3 gen/devname.3 gen/directory.3 gen/err.3 \
+ gen/daemon.3 gen/devname.3 gen/directory.3 gen/err.3 \
gen/exec.3 gen/fnmatch.3 gen/frexp.3 gen/fts.3 gen/getbsize.3 \
gen/getcap.3 gen/getcwd.3 gen/getdiskbyname.3 gen/getfsent.3 \
gen/getgrent.3 gen/getgrouplist.3 gen/gethostname.3 gen/getloadavg.3 \
@@ -46,8 +46,6 @@ MAN3+= gen/alarm.3 gen/clock.3 gen/confstr.3 gen/crypt.3 gen/ctermid.3 \
gen/uname.3 gen/unvis.3 gen/usleep.3 gen/utime.3 gen/valloc.3 gen/vis.3
MLINKS+=crypt.3 encrypt.3 crypt.3 setkey.3
-MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
- ctime.3 localtime.3 ctime.3 mktime.3
MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \
directory.3 readdir.3 directory.3 rewinddir.3 directory.3 seekdir.3 \
directory.3 telldir.3
diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc
index a47379e..f72048b 100644
--- a/lib/libc/stdtime/Makefile.inc
+++ b/lib/libc/stdtime/Makefile.inc
@@ -1,9 +1,10 @@
-# $Id$
+# $Id: Makefile.inc,v 1.1 1994/09/13 03:50:55 wollman Exp $
-SRCS+= stdtime/asctime.c stdtime/localtime.c stdtime/strftime.c \
- stdtime/difftime.c
-MAN5+= tzfile.5
+.PATH: ${.CURDIR}/stdtime
-CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS
-CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\"
+SRCS+= asctime.c localtime.c strftime.c difftime.c
+MAN5+= stdtime/tzfile.5
+MAN3+= stdtime/ctime.3 stdtime/strftime.3 stdtime/time2posix.3
+MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \
+ ctime.3 localtime.3 ctime.3 mktime.3
diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3
new file mode 100644
index 0000000..ff6a8ef
--- /dev/null
+++ b/lib/libc/stdtime/ctime.3
@@ -0,0 +1,258 @@
+.\" Copyright (c) 1989, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Arthur Olson.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)ctime.3 8.1 (Berkeley) 6/4/93
+.\"
+.Dd June 4, 1993
+.Dt CTIME 3
+.Os BSD 4.3
+.Sh NAME
+.Nm asctime ,
+.Nm ctime ,
+.Nm difftime ,
+.Nm gmtime ,
+.Nm localtime ,
+.Nm mktime
+.Nd transform binary date and time value to
+.Tn ASCII
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <time.h>
+.Vt extern char *tzname[2];
+.Ft char *
+.Fn ctime "const time_t *clock"
+.Ft double
+.Fn difftime "time_t time1" "time_t time0"
+.Ft char *
+.Fn asctime "const struct tm *tm"
+.Ft struct tm *
+.Fn localtime "const time_t *clock"
+.Ft struct tm *
+.Fn gmtime "const time_t *clock"
+.Ft time_t
+.Fn mktime "struct tm *tm"
+.Sh DESCRIPTION
+The functions
+.Fn ctime ,
+.Fn gmtime
+and
+.Fn localtime
+all take as an argument a time value representing the time in seconds since
+the Epoch (00:00:00
+.Tn UTC ,
+January 1, 1970; see
+.Xr time 3 ) .
+.Pp
+The function
+.Fn localtime
+converts the time value pointed at by
+.Fa clock ,
+and returns a pointer to a
+.Dq Fa struct tm
+(described below) which contains
+the broken-out time information for the value after adjusting for the current
+time zone (and any other factors such as Daylight Saving Time).
+Time zone adjustments are performed as specified by the
+.Ev TZ
+environmental variable (see
+.Xr tzset 3 ) .
+The function
+.Fn localtime
+uses
+.Xr tzset
+to initialize time conversion information if
+.Xr tzset
+has not already been called by the process.
+.Pp
+After filling in the tm structure,
+.Fn localtime
+sets the
+.Fa tm_isdst Ns 'th
+element of
+.Fa tzname
+to a pointer to an
+.Tn ASCII
+string that's the time zone abbreviation to be
+used with
+.Fn localtime Ns 's
+return value.
+.Pp
+The function
+.Fn gmtime
+similarly converts the time value, but without any time zone adjustment,
+and returns a pointer to a tm structure (described below).
+.Pp
+The
+.Fn ctime
+function
+adjusts the time value for the current time zone in the same manner as
+.Fn localtime ,
+and returns a pointer to a 26-character string of the form:
+.Bd -literal -offset indent
+Thu Nov 24 18:22:48 1986\en\e0
+.Ed
+.Pp
+All the fields have constant width.
+.Pp
+The
+.Fn asctime
+function
+converts the broken down time in the structure
+.Fa tm
+pointed at by
+.Fa *tm
+to the form
+shown in the example above.
+.Pp
+The function
+.Fn mktime
+converts the broken-down time, expressed as local time, in the structure
+pointed to by tm into a time value with the same encoding as that of the
+values returned by the
+.Xr time 3
+function, that is, seconds from the Epoch,
+.Tn UTC .
+.Pp
+The original values of the
+.Fa tm_wday
+and
+.Fa tm_yday
+components of the structure are ignored, and the original values of the
+other components are not restricted to their normal ranges.
+(A positive or zero value for
+.Fa tm_isdst
+causes
+.Fn mktime
+to presume initially that summer time (for example, Daylight Saving Time)
+is or is not in effect for the specified time, respectively.
+A negative value for
+.Fa tm_isdst
+causes the
+.Fn mktime
+function to attempt to divine whether summer time is in effect for the
+specified time.)
+.Pp
+On successful completion, the values of the
+.Fa tm_wday
+and
+.Fa tm_yday
+components of the structure are set appropriately, and the other components
+are set to represent the specified calendar time, but with their values
+forced to their normal ranges; the final value of
+.Fa tm_mday
+is not set until
+.Fa tm_mon
+and
+.Fa tm_year
+are determined.
+.Fn Mktime
+returns the specified calendar time; if the calendar time cannot be
+represented, it returns \-1;
+.Pp
+The
+.Fn difftime
+function
+returns the difference between two calendar times,
+.Pf ( Fa time1
+-
+.Fa time0 ) ,
+expressed in seconds.
+.Pp
+External declarations as well as the tm structure definition are in the
+.Aq Pa time.h
+include file.
+The tm structure includes at least the following fields:
+.Bd -literal -offset indent
+int tm_sec; /\(** seconds (0 - 60) \(**/
+int tm_min; /\(** minutes (0 - 59) \(**/
+int tm_hour; /\(** hours (0 - 23) \(**/
+int tm_mday; /\(** day of month (1 - 31) \(**/
+int tm_mon; /\(** month of year (0 - 11) \(**/
+int tm_year; /\(** year \- 1900 \(**/
+int tm_wday; /\(** day of week (Sunday = 0) \(**/
+int tm_yday; /\(** day of year (0 - 365) \(**/
+int tm_isdst; /\(** is summer time in effect? \(**/
+char \(**tm_zone; /\(** abbreviation of timezone name \(**/
+long tm_gmtoff; /\(** offset from UTC in seconds \(**/
+.Ed
+.Pp
+The
+field
+.Fa tm_isdst
+is non-zero if summer time is in effect.
+.Pp
+The field
+.Fa tm_gmtoff
+is the offset (in seconds) of the time represented from
+.Tn UTC ,
+with positive
+values indicating east of the Prime Meridian.
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr gettimeofday 2 ,
+.Xr getenv 3 ,
+.Xr time 3 ,
+.Xr tzset 3 ,
+.Xr tzfile 5
+.Sh HISTORY
+This manual page is derived from
+the time package contributed to Berkeley by
+Arthur Olsen and which appeared in
+.Bx 4.3 .
+.Sh BUGS
+Except for
+.Fn difftime
+and
+.Fn mktime ,
+these functions leaves their result in an internal static object and return
+a pointer to that object. Subsequent calls to these
+function will modify the same object.
+.Pp
+The
+.Fa tm_zone
+field of a returned tm structure points to a static array of characters,
+which will also be overwritten by any subsequent calls (as well as by
+subsequent calls to
+.Xr tzset 3
+and
+.Xr tzsetwall 3 ) .
+.Pp
+Use of the external variable
+.Fa tzname
+is discouraged; the
+.Fa tm_zone
+entry in the tm structure is preferred.
+.Pp
+Avoid using out-of-range values with
+.Fn mktime
+when setting up lunch with promptness sticklers in Riyadh.
diff --git a/lib/libc/stdtime/private.h b/lib/libc/stdtime/private.h
index 5af259c..8ddb74d 100644
--- a/lib/libc/stdtime/private.h
+++ b/lib/libc/stdtime/private.h
@@ -2,6 +2,16 @@
#define PRIVATE_H
+/* Stuff moved from Makefile.inc to reduce clutter */
+#ifndef TM_GMTOFF
+#define TM_GMTOFF tm_gmtoff
+#define TM_ZONE tm_zone
+#define STD_INSPIRED 1
+#define PCTS 1
+#define HAVE_LONG_DOUBLE 1
+#define TZDIR "/usr/share/zoneinfo"
+#endif /* ndef TM_GMTOFF */
+
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3
new file mode 100644
index 0000000..3da35a1
--- /dev/null
+++ b/lib/libc/stdtime/strftime.3
@@ -0,0 +1,186 @@
+.\" Copyright (c) 1989, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" the American National Standards Committee X3, on Information
+.\" Processing Systems.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)strftime.3 8.1 (Berkeley) 6/4/93
+.\"
+.Dd June 4, 1993
+.Dt STRFTIME 3
+.Os
+.Sh NAME
+.Nm strftime
+.Nd format date and time
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <time.h>
+.Fd #include <string.h>
+.Ft size_t
+.Fn strftime "char *buf" "size_t maxsize" "const char *format" "const struct tm *timeptr"
+.Sh DESCRIPTION
+The
+.Fn strftime
+function formats the information from
+.Fa timeptr
+into the buffer
+.Fa buf
+according to the string pointed to by
+.Fa format .
+.Pp
+The
+.Fa format
+string consists of zero or more conversion specifications and
+ordinary characters.
+All ordinary characters are copied directly into the buffer.
+A conversion specification consists of a percent sign
+.Dq Ql %
+and one other character.
+.Pp
+No more than
+.Fa maxsize
+characters will be placed into the array.
+If the total number of resulting characters, including the terminating
+null character, is not more than
+.Fa maxsize ,
+.Fn strftime
+returns the number of characters in the array, not counting the
+terminating null.
+Otherwise, zero is returned.
+.Pp
+Each conversion specification is replaced by the characters as
+follows which are then copied into the buffer.
+.Bl -tag -width "xxxx"
+.It Cm \&%A
+is replaced by the full weekday name.
+.It Cm %a
+is replaced by the abbreviated weekday name, where the abbreviation
+is the first three characters.
+.It Cm \&%B
+is replaced by the full month name.
+.It Cm %b or %h
+is replaced by the abbreviated month name, where the abbreviation is
+the first three characters.
+.It Cm \&%C
+is equivalent to
+.Dq Li %a %b %e %H:%M:%S %Y
+(the format produced by
+.Xr asctime 3 .
+.It Cm %c
+is equivalent to
+.Dq Li %m/%d/%y .
+.It Cm \&%D
+is replaced by the date in the format
+.Dq Ql mm/dd/yy .
+.It Cm %d
+is replaced by the day of the month as a decimal number (01-31).
+.It Cm %e
+is replaced by the day of month as a decimal number (1-31); single
+digits are preceded by a blank.
+.It Cm \&%H
+is replaced by the hour (24-hour clock) as a decimal number (00-23).
+.It Cm \&%I
+is replaced by the hour (12-hour clock) as a decimal number (01-12).
+.It Cm %j
+is replaced by the day of the year as a decimal number (001-366).
+.It Cm %k
+is replaced by the hour (24-hour clock) as a decimal number (0-23);
+single digits are preceded by a blank.
+.It Cm %l
+is replaced by the hour (12-hour clock) as a decimal number (1-12);
+single digits are preceded by a blank.
+.It Cm \&%M
+is replaced by the minute as a decimal number (00-59).
+.It Cm %m
+is replaced by the month as a decimal number (01-12).
+.It Cm %n
+is replaced by a newline.
+.It Cm %p
+is replaced by either
+.Dq Tn AM
+or
+.Dq Tn PM
+as appropriate.
+.It Cm \&%R
+is equivalent to
+.Dq Li %H:%M
+.It Cm %r
+is equivalent to
+.Dq Li %I:%M:%S %p .
+.It Cm %t
+is replaced by a tab.
+.It Cm \&%S
+is replaced by the second as a decimal number (00-60).
+.It Cm %s
+is replaced by the number of seconds since the Epoch, UCT (see
+.Xr mktime 3 ) .
+.It Cm \&%T No or Cm \&%X
+is equivalent to
+.Dq Li %H:%M:%S .
+.It Cm \&%U
+is replaced by the week number of the year (Sunday as the first day of
+the week) as a decimal number (00-53).
+.It Cm \&%W
+is replaced by the week number of the year (Monday as the first day of
+the week) as a decimal number (00-53).
+.It Cm %w
+is replaced by the weekday (Sunday as the first day of the week)
+as a decimal number (0-6).
+.It Cm %x
+is equivalent to
+.Dq Li %m/%d/%y %H:%M:%S .
+.It Cm \&%Y
+is replaced by the year with century as a decimal number.
+.It Cm %y
+is replaced by the year without century as a decimal number (00-99).
+.It Cm \&%Z
+is replaced by the time zone name.
+.It Cm %%
+is replaced by
+.Ql % .
+.El
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr ctime 3 ,
+.Xr printf 1 ,
+.Xr printf 3
+.Sh STANDARDS
+The
+.Fn strftime
+function
+conforms to
+.St -ansiC .
+The
+.Ql %s
+conversion specification is an extension.
+.Sh BUGS
+There is no conversion specification for the phase of the moon.
diff --git a/lib/libc/stdtime/tzfile.5 b/lib/libc/stdtime/tzfile.5
index 1d47033..4bff7de 100644
--- a/lib/libc/stdtime/tzfile.5
+++ b/lib/libc/stdtime/tzfile.5
@@ -1,123 +1,122 @@
-.TH TZFILE 5
-.SH NAME
-tzfile \- time zone information
-.SH SYNOPSIS
-.B
-#include <tzfile.h>
-.SH DESCRIPTION
+.Dd September 13, 1994
+.Dt TZFILE 5
+.Os FreeBSD 2.0
+.Sh NAME
+.Nm tzfile
+.Nd time zone information
+.Sh SYNOPSIS
+.Fd #include <tzfile.h>
+.Sh DESCRIPTION
The time zone information files used by
-.IR tzset (3)
+.Xr tzset 3
begin with bytes reserved for future use,
followed by four four-byte values of type
-.BR long ,
+.Fa long ,
written in a ``standard'' byte order
(the high-order byte of the value is written first).
These values are,
in order:
-.TP
-.I tzh_ttisstdcnt
+.Pp
+.Bl -tag -compact -width tzh_ttisstdcnt
+.It Li tzh_ttisstdcnt
The number of standard/wall indicators stored in the file.
-.TP
-.I tzh_leapcnt
+.It Li tzh_leapcnt
The number of leap seconds for which data is stored in the file.
-.TP
-.I tzh_timecnt
-The number of "transition times" for which data is stored
+.It Li tzh_timecnt
+The number of ``transition times'' for which data is stored
in the file.
-.TP
-.I tzh_typecnt
-The number of "local time types" for which data is stored
+.It Li tzh_typecnt
+The number of ``local time types'' for which data is stored
in the file (must not be zero).
-.TP
-.I tzh_charcnt
-The number of characters of "time zone abbreviation strings"
+.It Li tzh_charcnt
+The number of characters of ``time zone abbreviation strings''
stored in the file.
-.PP
+.El
+.Pp
The above header is followed by
-.I tzh_timecnt
+.Li tzh_timecnt
four-byte values of type
-.BR long ,
+.Fa long ,
sorted in ascending order.
These values are written in ``standard'' byte order.
Each is used as a transition time (as returned by
-.IR time (2))
+.Xr time 2 )
at which the rules for computing local time change.
Next come
-.I tzh_timecnt
+.Li tzh_timecnt
one-byte values of type
-.BR "unsigned char" ;
+.Fa "unsigned char" ;
each one tells which of the different types of ``local time'' types
described in the file is associated with the same-indexed transition time.
These values serve as indices into an array of
-.I ttinfo
+.Fa ttinfo
structures that appears next in the file;
these structures are defined as follows:
-.in +.5i
-.sp
-.nf
-.ta .5i +\w'unsigned int\0\0'u
+.Pp
+.Bd -literal -offset indent
struct ttinfo {
long tt_gmtoff;
int tt_isdst;
unsigned int tt_abbrind;
};
-.in -.5i
-.fi
-.sp
+.Ed
+.Pp
Each structure is written as a four-byte value for
-.I tt_gmtoff
+.Li tt_gmtoff
of type
-.BR long ,
+.Fa long ,
in a standard byte order, followed by a one-byte value for
-.I tt_isdst
+.Li tt_isdst
and a one-byte value for
-.IR tt_abbrind .
+.Li tt_abbrind .
In each structure,
-.I tt_gmtoff
+.Li tt_gmtoff
gives the number of seconds to be added to GMT,
-.I tt_isdst
+.Li tt_isdst
tells whether
-.I tm_isdst
+.Li tm_isdst
should be set by
-.I localtime (3)
+.Xr localtime 3
and
-.I tt_abbrind
+.Li tt_abbrind
serves as an index into the array of time zone abbreviation characters
that follow the
-.I ttinfo
+.Li ttinfo
structure(s) in the file.
-.PP
+.Pp
Then there are
-.I tzh_leapcnt
+.Li tzh_leapcnt
pairs of four-byte values, written in standard byte order;
the first value of each pair gives the time
(as returned by
-.IR time(2))
+.Xr time 2 )
at which a leap second occurs;
the second gives the
-.I total
+.Em total
number of leap seconds to be applied after the given time.
The pairs of values are sorted in ascending order by time.
-.PP
+.Pp
Finally there are
-.I tzh_ttisstdcnt
+.Li tzh_ttisstdcnt
standard/wall indicators, each stored as a one-byte value;
they tell whether the transition times associated with local time types
were specified as standard time or wall clock time,
and are used when a time zone file is used in handling POSIX-style
time zone environment variables.
-.PP
-.I Localtime
+.Pp
+.Nm localtime
uses the first standard-time
-.I ttinfo
+.Li ttinfo
structure in the file
(or simply the first
-.I ttinfo
+.Li ttinfo
structure in the absence of a standard-time structure)
if either
-.I tzh_timecnt
+.Li tzh_timecnt
is zero or the time argument is less than the first transition time recorded
in the file.
-.SH SEE ALSO
-newctime(3)
+.Sh SEE ALSO
+.Xr ctime 3 ,
+.Xr time2posix 3 ,
+.Xr zic 8
.\" @(#)tzfile.5 7.2
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index 0b77067..d0a9b01 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -4,7 +4,7 @@
# machine-independent string sources
SRCS+= memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \
- strftime.c strmode.c strtok.c strxfrm.c swab.c
+ strmode.c strtok.c strxfrm.c swab.c
# machine-dependent string sources
.include "${.CURDIR}/${MACHINE}/string/Makefile.inc"
@@ -84,7 +84,7 @@ MAN3+= string/bcmp.3 string/bcopy.3 string/bstring.3 string/bzero.3 \
string/memcmp.3 string/memcpy.3 string/memmove.3 string/memset.3 \
string/rindex.3 string/strcasecmp.3 string/strcat.3 string/strchr.3 \
string/strcmp.3 string/strcoll.3 string/strcpy.3 string/strcspn.3 \
- string/strftime.3 string/string.3 string/strlen.3 string/strmode.3 \
+ string/string.3 string/strlen.3 string/strmode.3 \
string/strdup.3 string/strerror.3 string/strpbrk.3 string/strrchr.3 \
string/strsep.3 string/strspn.3 string/strstr.3 string/strtok.3 \
string/strxfrm.3 string/swab.3
OpenPOWER on IntegriCloud