The return value points to a statically allocated struct which might be
overwritten by subsequent calls to any of the date and time functions.
The localtime_r() function does the same, but stores the data in a
user-supplied struct.
Linux Programmer's Manual (April 26, 1996) にはこの記述がないです。
ぼくが今使っている /usr/lib/libc には localtime_r() が入っているようですが、
localtime_r() の移植性はどんなものなのでしょうね。
% nm /usr/lib/libc.so | grep localtime
nm: /usr/lib/libc.so: File format not recognized (あれ?)
% nm /usr/lib/libc.a | grep localtime
U localtime
U __localtime_r
localtime.o:
00000020 T __localtime_r
00000000 T localtime
00000020 W localtime_r
U __localtime_r
00000000 b localtime_offset
U __localtime_r
U __localtime_r
U __localtime_r
%
man localtime (スコア:1)
overwritten by subsequent calls to any of the date and time functions.
The localtime_r() function does the same, but stores the data in a
user-supplied struct.
wild wild computing
Re:man localtime (スコア:1)
これはBSD系のman pageでしょうか。
Linux Programmer's Manual (April 26, 1996) にはこの記述がないです。
ぼくが今使っている /usr/lib/libc には localtime_r() が入っているようですが、
localtime_r() の移植性はどんなものなのでしょうね。
% nm /usr/lib/libc.so | grep localtime
nm: /usr/lib/libc.so: File format not recognized (あれ?)
% nm /usr/lib/libc.a | grep localtime
U localtime
U __localtime_r
localtime.o:
00000020 T __localtime_r
00000000 T localtime
00000020 W localtime_r
U __localtime_r
00000000 b localtime_offset
U __localtime_r
U __localtime_r
U __localtime_r
%
love && peace && free_software
t-nissie
Re:man localtime (スコア:1)
Thread-safeバージョンである localtime_r の移植性はあゃしぃのでは?
とりあぇず、cygwin にある(あたりまえ)のは確認しましたが。
wild wild computing