time.h revision 199767f8919635c4928607450d9e0abb932109ce
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1989, 1993
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The Regents of the University of California. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * (c) UNIX System Laboratories, Inc.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * All or some portions of this file are derived from material licensed
199767f8919635c4928607450d9e0abb932109ceToomas Soome * to the University of California by American Telephone and Telegraph
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Co. or Unix System Laboratories, Inc. and are reproduced herein with
199767f8919635c4928607450d9e0abb932109ceToomas Soome * the permission of UNIX System Laboratories, Inc.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 3. Neither the name of the University nor the names of its contributors
199767f8919635c4928607450d9e0abb932109ceToomas Soome * may be used to endorse or promote products derived from this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * without specific prior written permission.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * @(#)time.h 8.3 (Berkeley) 1/21/94
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Frequency of the clock ticks reported by times(). Deprecated - use
199767f8919635c4928607450d9e0abb932109ceToomas Soome * sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.)
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Frequency of the clock ticks reported by clock(). */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * New in POSIX 1003.1b-1993.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __POSIX_VISIBLE >= 199309 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* These macros are also in sys/time.h. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int tm_sec; /* seconds after the minute [0-60] */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int tm_min; /* minutes after the hour [0-59] */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int tm_yday; /* days since January 1 [0-365] */
199767f8919635c4928607450d9e0abb932109ceToomas Soome long tm_gmtoff; /* offset from UTC in seconds */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern char *tzname[];
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* XXX missing: getdate() */
199767f8919635c4928607450d9e0abb932109ceToomas Soomesize_t strftime(char * __restrict, size_t, const char * __restrict,
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint timer_gettime(timer_t, struct itimerspec *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint timer_settime(timer_t, int, const struct itimerspec *__restrict,
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint clock_gettime(clockid_t, struct timespec *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint clock_settime(clockid_t, const struct timespec *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* XXX missing: clock_nanosleep() */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint nanosleep(const struct timespec *, struct timespec *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __POSIX_VISIBLE >= 199309 */
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct tm *gmtime_r(const time_t *, struct tm *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct tm *localtime_r(const time_t *, struct tm *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *strptime(const char * __restrict, const char * __restrict,
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *timezone(int, int); /* XXX XSI conflict */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __BSD_VISIBLE */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* !_TIME_H_ */