エラー
Manpage of TIME
EFAULT
t がアクセス可能なアドレス空間の外を指している。
int main() { time_t t; t=time((void*)1); printf("%d\n",t); }
$ ./a.out セグメンテーション違反です
普通にセグメンテーション違反です
エラーどころじゃない
libcのsysdeps/unix/time.c に定義されてるっぽい
time_t time (t) time_t *t; { struct timeval tv; time_t result; if (__gettimeofday (&tv, (struct timezone *) NULL)) result = (time_t) -1; else result = (time_t) tv.tv_sec; if (t != NULL) *t = result; return result; }
まあこの期に及んで このコードで__gettimeofday()がEFAULTを返すことも無いだろうし、これ以上はどうでもいい