Both functions (isatty, ttyname) need a file descriptor as a parameter, not a file pointer. So you have to specify if (isatty(0 /*stdin */) ... rsp. if (ttyname(0) != NULL) ... ...mcvax!unido!hmueller.pad