"Fossies" - the Fresh Open Source Software Archive

Member "file-5.35/src/gmtime_r.c" (16 Jul 2015, 436 Bytes) of package /linux/misc/file-5.35.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gmtime_r.c" see the Fossies "Dox" file reference documentation.

    1 /*  $File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $  */
    2 
    3 #include "file.h"
    4 #ifndef lint
    5 FILE_RCSID("@(#)$File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $")
    6 #endif  /* lint */
    7 #include <time.h>
    8 #include <string.h>
    9 
   10 /* asctime_r is not thread-safe anyway */
   11 struct tm *
   12 gmtime_r(const time_t *t, struct tm *tm)
   13 {
   14     struct tm *tmp = gmtime(t);
   15     if (tmp == NULL)
   16         return NULL;
   17     memcpy(tm, tmp, sizeof(*tm));
   18     return tmp;
   19 }