When we implemented ptsname_r in 2020 in commit 3e7224dffe26 we returned -1 on error and set errno. POSIX has subsequently adopted ptsname_r[1] but specifies that an error number is returned on error. In a5ed6a815e38 I changed the man page to indicate that a nonzero value is returned on error, and callers should not be checking for an explicit -1. Follow up now by returning the error number (but continue to set errno). Existing software uses the previous implementation via symbol versioning. [1] https://www.austingroupbugs.net/view.php?id=508
PR: 250062