Using (time_t)-1 , time() already used to report a failure, so the choice doesn't seem unreasonable:
The current calendar time, encoded as a time_t object on success, (time_t) (- 1) on error. If the argument is not NULL, the return value is equal to the value stored in the object that the argument points to.
However, if you want the caller to distinguish between a time-related IO failure or failure (or specific IO failures), you might consider adding a status type argument to your function, which can be used to return additional information about the failure.
source share