Another conformance question... This time fputs().

Jordan K. Hubbard jkh at queasyweasel.com
Tue Mar 2 11:50:53 PST 2004


Thanks to everyone (not just bde) for reviewing the fix.  Linux was 
right, I was wrong, EBADF it is!

On Mar 2, 2004, at 4:03 AM, Bruce Evans wrote:

> Should be EBADF, as in Linux.
>
>>                  return (EOF);
>> +       }
>
> Otherwise, I agree with this change except for its style bugs 
> (unsorting
> of the #includes and tab lossage).

Change committed with #includes sorted and proper use of tabs (change 
is consistent with the rest of the file's style).

It's also not clear to me why ENODEV is being returned, though I'm not 
as inclined to blame isatty() since it appears to do the right thing:

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>

main() {
         int fd, ret;

         fd = open("/dev/null", O_RDONLY);
         ret = isatty(fd);
         printf("ret = %d, errno = %d\n", ret, errno);
         close(fd);
}

Prints:	ret = 0, errno = 25

All isatty() does is call tcgetattr(), it doesn't do an 
ioctl(...TIOCGETA...).

--
Jordan K. Hubbard
Engineering Manager, BSD technology group
Apple Computer


More information about the freebsd-arch mailing list