Anonymous | Login | 2024-04-28 12:23 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000144 | [1003.1(2008)/Issue 7] Base Definitions and Headers | Editorial | Enhancement Request | 2009-09-05 17:22 | 2022-10-20 15:27 | ||
Reporter | EdSchouten | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Rejected | ||||
Status | Closed | ||||||
Name | Ed Schouten | ||||||
Organization | |||||||
User Reference | |||||||
Section | Chapter 11: TTYs | ||||||
Page Number | n/a | ||||||
Line Number | n/a | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0000144: Standard lacks a (possibly XSI) interface to associate a session to a TTY; tcsetsid() | ||||||
Description |
According to the General Terminal Interface chapter, it is implementation defined whether a session associates to a TTY when O_NOCTTY is not passed to open(): The controlling terminal for a session is allocated by the session leader in an implementation-defined manner. If a session leader has no controlling terminal, and opens a terminal device file that is not already associated with a session without using the O_NOCTTY option (see open()), it is implementation-defined whether the terminal becomes the controlling terminal of the session leader. Unfortunately, the standard does not specify a way to associate them when the implementation does not do this by default (i.e. the BSDs). This means it's practically impossible to implement a network login service or terminal emulator only using the interfaces described in POSIX. |
||||||
Desired Action |
Standardizing things like TIOCSCTTY wouldn't be a good way to go. Some time ago I looked at this and it seems QNX has a solution for this that seems to be quite elegant: http://www.qnx.com/developers/docs/6.4.0/neutrino/lib_ref/t/tcsetsid.html [^] It's basically the counterpart of the already existing tcgetsid(). I propose adding this function to the standard, marked as XSI, where a minimal implementation only has to support the situation where the `pid' argument is equal to the session ID of the current process. This would be desirable anyway. An implementation on operating systems that have TIOCSCTTY could then look as follows: int tcsetsid(int fd, pid_t pid) { if (pid != getsid(0)) { errno = EINVAL; return -1; } return ioctl(fd, TIOCSCTTY, NULL); } |
||||||
Tags | No tags attached. | ||||||
Attached Files |
tcsetsid.txt [^] (1,665 bytes) 2011-03-30 17:53 tcsetsid_v2.txt [^] (1,871 bytes) 2011-04-03 11:14 |
||||||
|
Notes | |
(0000237) nick (manager) 2009-09-24 15:36 |
The rules for introducing new material into the standard are provided in austin-112r3 (http://www.opengroup.org/austin/docs/austin_112r3.txt). [^] The material introduced must have a copyright release from the original owner. The text needs to be fully formed ... the exact words you would propose being added to the standard. Since you have suggested that the new interface be marked XSI, the best method for moving forward would be to lobby members of The Open Group's platform working group. |
(0000388) EdSchouten (updater) 2010-02-21 00:00 |
I was just looking through my bug reports. So what is meant with "material introduced"? Say, I come up with a specification of the function with the same prototype, would that mean I introduced the material? Or is QNX in this case the originating party? I was just thinking, wouldn't it make more sense to add this to the base definitions, because if its high importance? Maybe tcsetsid() should also become a base definition while there. Are there certain templates or formats which I can use? If not, should I just write a plain-text file using certain annotation? |
(0000389) EdSchouten (updater) 2010-02-21 00:13 |
Never mind "Maybe tcsetsid() should also become a base definition while there." It seems tcsetsid() is already part of the base definitions. |
(0000730) EdSchouten (updater) 2011-03-30 17:54 |
Because tcgetsid() is part of base, it would make sense to add tcsetsid() to base as well. I've attached a proposed change to the 7th edition of the standard to include tcsetsid(). |
(0000732) msbrown (manager) 2011-03-31 15:30 |
Thanks for your submission! We are considering this for inclusion into the next revision (hence the tag "issue8"); we will not be considering this for an Issue 7 addendum as it is new function. We are currently attempting to get copyright clearance for this interface. In the meantime we will be going over the text you have submitted. |
(0000736) EdSchouten (updater) 2011-04-03 11:15 |
I've corrected some small typos and also documented that tcsetsid() shall have no effect on already associated terminals. |
(0005188) soumendraganguly (reporter) 2020-12-22 23:19 |
I was wondering if alongside tcgetwinsize() and tcsetwinsize(), we could also attempt to include tcsetsid() in issue 8. Please see https://austingroupbugs.net/view.php?id=1151. [^] As EdSchouten had mentioned, tcgetsid() is already a part of the standard. FreeBSD and QNX additionally include tcsetsid(). Some implementations such as BSDs, Glibc, Solaris, ... include a library function called login_tty(), which prepares a terminal for a new login session; that procedure involves setting a controlling terminal. I am attempting to introduce a Python version of this [os.login_tty()]. Implementing this usually involves calls to setsid(), open(), close(), ttyname(), dup2(), which are currently a part of the standard; it is only when we attempt to set the controlling tty, we have to resort to using implementation-specific methods such as ioctl()+TIOCSCTTY or passing a tty file descriptor to open() without supplying the O_NOCTTY flag. Since it is not favorable to standardize TIOCSCTTY, I request that EdSchouten's original proposal to standardize tcsetsid() be reconsidered. |
(0006007) Don Cragun (manager) 2022-10-20 15:27 |
Because we have been unable to get a copyright release for this interface in the last 11 years, this bug is being rejected. If someone can obtain copyright release, please submit a new bug with the appropriate release information. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |