ttyname_r

David Xu davidxu at freebsd.org
Mon Jul 7 19:51:04 PDT 2003


I found our ttyname_r has different return type than POSIX:
http://www.opengroup.org/onlinepubs/007904975/functions/ttyname.html
and POSIX says:
    If successful, the ttyname_r() function shall return zero.
    Otherwise, an error number shall be returned to indicate the error.

libc implements it as following format:
char * ttyname_r(int fd, char *buf, size_t len);
and when success, it returns non-NULL pointer, it almost has opposite
meaning with POSIX.
This causes some pthread tests failed here.

David Xu



More information about the freebsd-threads mailing list