Isatty() and IO.tty?

In Ruby or via a C extension, how do I call a C program so that
isatty(stdout) returns true?
I don’t want to route it through another shell.

Daniel Brumbaugh K.