Back to index

nagios-plugins  1.4.16
timegm.c
Go to the documentation of this file.
00001 /* Convert UTC calendar time to simple time.  Like mktime but assumes UTC.
00002 
00003    Copyright (C) 1994, 1997, 2003, 2004, 2006, 2007, 2009, 2010 Free Software
00004    Foundation, Inc.  This file is part of the GNU C Library.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 3, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software Foundation,
00018    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 #ifndef _LIBC
00021 # include <config.h>
00022 #endif
00023 
00024 #include <time.h>
00025 
00026 #ifndef _LIBC
00027 # undef __gmtime_r
00028 # define __gmtime_r gmtime_r
00029 # define __mktime_internal mktime_internal
00030 # include "mktime-internal.h"
00031 #endif
00032 
00033 time_t
00034 timegm (struct tm *tmp)
00035 {
00036   static time_t gmtime_offset;
00037   tmp->tm_isdst = 0;
00038   return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
00039 }