Actually, no I don't. ENOTSUP makes more sense.
I agree. I think we should generalize EBADF to attempts to do something fd-ish on a port without a fd. So we raise on EBADF, but otherwise return #t or #f depending on the result of isatty().
> Although there's the case when it's handed a port who's file descriptor
> is not valid, which would likely indicate something is terribly wrong,
> or the port was closed.
If these cases can be distinguished reliably, it makes sense to raise an
error for them. Setting "errno = 0" before the call may allow for that.
> Otherwise, I'll have my Chibi Scheme implementation only raise an error
> if it's not handed a port.
I agree this should raise an error. Also if it's a port that
intrinsically doesn't have an fd associated with it (e.g. your earlier
example, a string port).