Blame time/timegm.c

Packit Service 82fcde
/* Convert UTC calendar time to simple time.  Like mktime but assumes UTC.
Packit Service 82fcde
Packit Service 82fcde
   Copyright (C) 1994-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifdef HAVE_CONFIG_H
Packit Service 82fcde
# include <config.h>
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
#ifdef _LIBC
Packit Service 82fcde
# include <time.h>
Packit Service 82fcde
#else
Packit Service 82fcde
# include "timegm.h"
Packit Service 82fcde
Packit Service 82fcde
/* Portable standalone applications should supply a "time_r.h" that
Packit Service 82fcde
   declares a POSIX-compliant gmtime_r, for the benefit of older
Packit Service 82fcde
   implementations that lack gmtime_r or have a nonstandard one.
Packit Service 82fcde
   See the gnulib time_r module for one way to implement this.  */
Packit Service 82fcde
# include <time_r.h>
Packit Service 82fcde
# undef __gmtime_r
Packit Service 82fcde
# define __gmtime_r gmtime_r
Packit Service 82fcde
time_t __mktime_internal (struct tm *,
Packit Service 82fcde
			  struct tm * (*) (time_t const *, struct tm *),
Packit Service 82fcde
			  time_t *);
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
time_t
Packit Service 82fcde
timegm (struct tm *tmp)
Packit Service 82fcde
{
Packit Service 82fcde
  static time_t gmtime_offset;
Packit Service 82fcde
  tmp->tm_isdst = 0;
Packit Service 82fcde
  return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
Packit Service 82fcde
}