What is time_t ultimately a typedef to?

后端 未结 10 2289
陌清茗
陌清茗 2020-11-22 08:34

I searched my Linux box and saw this typedef:

typedef __time_t time_t;

But I could not find the __time_t definition.

10条回答
  •  我在风中等你
    2020-11-22 09:14

    [root]# cat time.c

    #include 
    
    int main(int argc, char** argv)
    {
            time_t test;
            return 0;
    }
    

    [root]# gcc -E time.c | grep __time_t

    typedef long int __time_t;

    It's defined in $INCDIR/bits/types.h through:

    # 131 "/usr/include/bits/types.h" 3 4
    # 1 "/usr/include/bits/typesizes.h" 1 3 4
    # 132 "/usr/include/bits/types.h" 2 3 4
    

提交回复
热议问题