Blame lib/timegm.c

Packit Service fdd496
/* Convert UTC calendar time to simple time.  Like mktime but assumes UTC.
Packit Service fdd496
Packit Service fdd496
   Copyright (C) 1994, 1997, 2003-2004, 2006-2007, 2009-2017 Free Software
Packit Service fdd496
   Foundation, Inc.  This file is part of the GNU C Library.
Packit Service fdd496
Packit Service fdd496
   This program is free software; you can redistribute it and/or modify
Packit Service fdd496
   it under the terms of the GNU General Public License as published by
Packit Service fdd496
   the Free Software Foundation; either version 3, or (at your option)
Packit Service fdd496
   any later version.
Packit Service fdd496
Packit Service fdd496
   This program is distributed in the hope that it will be useful,
Packit Service fdd496
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
   GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
   You should have received a copy of the GNU General Public License
Packit Service fdd496
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
Packit Service fdd496
Packit Service fdd496
#ifndef _LIBC
Packit Service fdd496
# include <config.h>
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
#include <time.h>
Packit Service fdd496
Packit Service fdd496
#ifdef _LIBC
Packit Service fdd496
typedef time_t mktime_offset_t;
Packit Service fdd496
#else
Packit Service fdd496
# undef __gmtime_r
Packit Service fdd496
# define __gmtime_r gmtime_r
Packit Service fdd496
# define __mktime_internal mktime_internal
Packit Service fdd496
# include "mktime-internal.h"
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
time_t
Packit Service fdd496
timegm (struct tm *tmp)
Packit Service fdd496
{
Packit Service fdd496
  static mktime_offset_t gmtime_offset;
Packit Service fdd496
  tmp->tm_isdst = 0;
Packit Service fdd496
  return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
Packit Service fdd496
}