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