Linux system call time() is returning ((time_t) -14) on error <p>The man page <code>man 2 time</code> says:</p> <pre><code>SYNOPSIS #include &lt;time.h&gt; time_t time(time_t *t); RETURN VALUE On success, the value of time in seconds since the Epoch is returned. On error, ((time_t) -1) is returned, and errno is set appropriately. ERRORS EFAULT t points outside your accessible address space. </code></pre> <p>I've got a simple test set up, trying to coerce an error from that function - should be the most straightforward thing ever:</p> <pre><code>time_t *ptr = (time_t *) 0xabad1dea; time_t secs = time(ptr); if (secs == ((time_t) -1)) /* Not caught */ exit(EXIT_FAILURE); printf("Number of seconds since the Epoch: %lld\n", secs); printf("It should return ((time_t) -1) on error: %lld\n", (time_t) -1); secs = *ptr; /* This *does* segfault */ </code></pre> <p>For some reason, time() is returning -14 instead of -1 on my system. I'm completely stumped. Baffled, even.</p> <p>I doubt anyone can reproduce this issue, but does anybody out there know why on earth I might be getting that behaviour? If so, I'm terribly curious!</p> <p>EDIT: I know time isn't dereferencing the bad pointer I pass it, because that crashes the program. And the man page does say it should return -1 and set errno if the address isn't reachable. EFAULT is 14, but isn't returning -EFAULT <strong>not</strong> what time() is defined as doing here?</p>