user space 的 time_t 到底是如何定義的?
原來是定義在 kernel 當中
linux/include/asm-i386/posix_types.h:typedef long __kernel_time_t;
==> 先 define __kernel_time_t 為 long
linux/include/linux/types.h:typedef __kernel_time_t time_t;
==> 再 define time_t 為 __kernel_time_t
所以 time_t 就是 long (for i386 architecture) :)
[root@localhost linux]# grep -R -H "suseconds_t" ./*
./types.h:typedef __kernel_suseconds_t suseconds_t;
[root@localhost linux]# cd ../asm-i386/
[root@localhost asm-i386]# grep -R -H "__kernel_suseconds_t" ./*
./posix_types.h:typedef long __kernel_suseconds_t;
結論是
time_t
suseconds_t
都是 long 的型態
沒有留言:
張貼留言