OSDN Git Service

(split) LDP: Update releases based on LDP 3.52 release
[linuxjm/LDP_man-pages.git] / release / man3 / timegm.3
index 17bace9..1a9ab7f 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
-.\" Translated Thu 3 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"*******************************************************************
 .\"
-.TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH TIMEGM 3 2013\-07\-04 GNU "Linux Programmer's Manual"
 .SH 名前
 timegm, timelocal \- gmtime と localtime の逆関数
 .SH 書式
 .nf
-.B #include <time.h>
+\fB#include <time.h>\fP
 .sp
-.BI "time_t timelocal(struct tm *" tm );
+\fBtime_t timelocal(struct tm *\fP\fItm\fP\fB);\fP
 .sp
-.BI "time_t timegm(struct tm *" tm );
+\fBtime_t timegm(struct tm *\fP\fItm\fP\fB);\fP
 .sp
 .fi
 .in -4n
-glibc 向けの機能検査マクロの要件
-.RB ( feature_test_macros (7)
-参照):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
-.BR timelocal (),
-.BR timegm ():
-_BSD_SOURCE || _SVID_SOURCE
+\fBtimelocal\fP(), \fBtimegm\fP(): _BSD_SOURCE || _SVID_SOURCE
 .SH 説明
-.BR timelocal ()
-関数と
-.BR timegm ()
-関数は、それぞれ
-.BR localtime (3)
-関数と
-.BR gmtime (3)
+\fBtimelocal\fP()  関数と \fBtimegm\fP()  関数は、それぞれ \fBlocaltime\fP(3)  関数と \fBgmtime\fP(3)
 関数の逆関数である。
 .SH 準拠
-これらの関数は非標準で GNU の拡張である。
-BSD 系にも存在する。
-これらの使用は避けること。「注意」参照。
+これらの関数は非標準で GNU の拡張である。 BSD 系にも存在する。 これらの使用は避けること。「注意」参照。
 .SH 注意
-.BR timelocal ()
-関数は POSIX の標準関数
-.BR mktime (3)
-と同じものである。
-ので、これを使う理由はないはずである。
+\fBtimelocal\fP()  関数は POSIX の標準関数 \fBmktime\fP(3)  と同じものである。 ので、これを使う理由はないはずである。
 .LP
-.BR timegm ()
-を移植性があるようなかたちで実現するには、
-.B TZ
-環境変数を UTC に設定してから
-.BR mktime (3)
-を呼んで、
-.B TZ
-の値を取得すればよい。
-例えば次のようになるだろう。
-.sp
+\fBtimegm\fP()  を移植性があるようなかたちで実現するには、 \fBTZ\fP 環境変数を UTC に設定してから \fBmktime\fP(3)
+を呼んで、 \fBTZ\fP の値を取得すればよい。 例えば次のようになるだろう。
+
 .in +4n
 .nf
 #include <time.h>
@@ -85,12 +66,15 @@ time_t my_timegm (struct tm *tm)
     char *tz;
 
     tz = getenv("TZ");
+    if (tz)
+        tz = strdup(tz);
     setenv("TZ", "", 1);
     tzset();
     ret = mktime(tm);
-    if (tz)
+    if (tz) {
         setenv("TZ", tz, 1);
-    else
+        free(tz);
+    } else
         unsetenv("TZ");
     tzset();
     return ret;
@@ -98,7 +82,8 @@ time_t my_timegm (struct tm *tm)
 .fi
 .in
 .SH 関連項目
-.BR gmtime (3),
-.BR localtime (3),
-.BR mktime (3),
-.BR tzset (3)
+\fBgmtime\fP(3), \fBlocaltime\fP(3), \fBmktime\fP(3), \fBtzset\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。