What is time_t ultimately a typedef to?

后端 未结 10 2067
陌清茗
陌清茗 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条回答
  •  -上瘾入骨i
    2020-11-22 09:29

    It's a 32-bit signed integer type on most legacy platforms. However, that causes your code to suffer from the year 2038 bug. So modern C libraries should be defining it to be a signed 64-bit int instead, which is safe for a few billion years.

提交回复
热议问题