View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000503 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2011-11-08 00:28 | 2019-06-10 08:55 |
Reporter | eblake | Assigned To | ajosey | ||
Priority | normal | Severity | Objection | Type | Omission |
Status | Closed | Resolution | Accepted As Marked | ||
Name | Eric Blake | ||||
Organization | Red Hat | ||||
User Reference | ebb.ptsname | ||||
Section | ptsname | ||||
Page Number | 1712 | ||||
Line Number | 54754 | ||||
Interp Status | --- | ||||
Final Accepted Text | 0000503:0001004 | ||||
Summary | 0000503: ptsname should define optional errno values | ||||
Description | Some platforms implement ptsname() in terms of an initial isatty() check on the fd, or via a use of ttyname_r(); since both of these functions have an optional but defined value for errno on failure, ptsname() should be allowed to use the same errno values. | ||||
Desired Action | At line 54750, after "shall return a null pointer", add ", and may set errno". At line 54754, replace "No errors are defined." with: The ptsname( ) function may fail if: [EBADF] The fildes argument is not a valid open file descriptor. [ENOTTY] The file associated with the fildes argument is not a terminal. | ||||
Tags | tc2-2008 |
|
At line 54750, after "shall return a null pointer", add ", and may set errno". At line 54754, replace "No errors are defined." with: The ptsname( ) function may fail if: [EBADF] The fildes argument is not a valid file descriptor. [ENOTTY] The file associated with the fildes argument is not a master pseudo-terminal device.. |
|
On further investigation, implementations differ on whether they report ENOTTY or EINVAL when using a function that requires the master side of a pseudo-terminal, whereas the standard suggests EINVAL for grantpt() and unlockpt(). This program shows that Solaris uses ENOTTY for all three methods, while Linux used ENOTTY for two and EINVAL for granpt: #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <stdio.h> #include <fcntl.h> #include <string.h> int main() { int fd = open(".", O_RDONLY); errno = 0; ptsname(fd); printf("%d %s\n", errno, strerror(errno)); errno = 0; unlockpt(fd); printf("%d %s\n", errno, strerror(errno)); errno = 0; grantpt(fd); printf("%d %s\n", errno, strerror(errno)); return 0; } I think the proposal needs to be broadened to allow either error on all three functions. Still, since all three functions use may fail rather than shall fail, I don't think any interpretation is needed. |
|
At line 36466 [grantpt], change "shall return -1 and set errno" to "shall return -1, and may set errno" At line 36471, change "[EINVAL]" to "[EINVAL] or [ENOTTY]" At line 54750 [ptsname], after "shall return a null pointer", add ", and may set errno" At line 54754, replace "No errors are defined." with: The ptsname( ) function may fail if: [EBADF] The fildes argument is not a valid file descriptor. [EINVAL] or [ENOTTY] The filedes argument is not associated with a master pseudo-terminal device. At line 68222 [unlockpt], change "shall return -1 and set errno" to "shall return -1, and may set errno" At line 68227, change "[EINVAL]" to "[EINVAL] or [ENOTTY]" |
|
For TC2, we went with 0000503:0001004; but the ideas in 0000503:0001006 and further discussion on the reflector led to the creation of 0000618 for Issue 8. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-11-08 00:28 | eblake | New Issue | |
2011-11-08 00:28 | eblake | Status | New => Under Review |
2011-11-08 00:28 | eblake | Assigned To | => ajosey |
2011-11-08 00:28 | eblake | Name | => Eric Blake |
2011-11-08 00:28 | eblake | Organization | => Red Hat |
2011-11-08 00:28 | eblake | User Reference | => ebb.ptsname |
2011-11-08 00:28 | eblake | Section | => ptsname |
2011-11-08 00:28 | eblake | Page Number | => 1712 |
2011-11-08 00:28 | eblake | Line Number | => 54754 |
2011-11-08 00:28 | eblake | Interp Status | => --- |
2011-11-10 16:25 | msbrown | Tag Attached: tc2-2008 | |
2011-11-10 16:28 | msbrown | Interp Status | --- => Pending |
2011-11-10 16:28 | msbrown | Note Added: 0001004 | |
2011-11-10 16:28 | msbrown | Status | Under Review => Resolved |
2011-11-10 16:28 | msbrown | Resolution | Open => Accepted As Marked |
2011-11-10 16:28 | msbrown | Final Accepted Text | => 0000503:0001004 |
2011-11-10 16:29 | msbrown | Interp Status | Pending => --- |
2011-11-10 17:45 | eblake | Note Added: 0001005 | |
2011-11-10 17:51 | eblake | Note Added: 0001006 | |
2011-11-10 18:12 | eblake | Relationship added | related to 0000506 |
2011-11-10 21:27 | eblake | Relationship added | related to 0000508 |
2012-10-02 19:31 | eblake | Note Added: 0001385 | |
2012-10-02 19:32 | eblake | Relationship added | parent of 0000618 |
2012-10-02 19:32 | eblake | Note Edited: 0001385 | |
2019-06-10 08:55 | agadmin | Status | Resolved => Closed |