Community
Participate
Working Groups
In openpty.c, there is the following code: int ptym_open(char * pts_name) { int fdm; char *ptr; strcpy(pts_name, "/dev/ptmx"); fdm = getpt(); Unfortunately, getpt() doesn't exist on AIX. There is no compile or link error as implicit int is assumed for the declaration of getpt(), and external symbols are not resolved during a shared library link. This means PTY support has been broken on AIX for a long, long time. We need to use it though for RDT so we stumbled upon this problem. The fix is a one liner... we need to call posix_openpt(O_RDWR) instead.
Created attachment 207695 [details] patch
Committed to cdt_7_0, cdt_8_0, and master.
*** cdt git genie on behalf of Chris Recoskie *** Bug 365142 - Linux specific API used in AIX libpty -> NULL dereference [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1d7cfbe63596cb90b5f9889c8f55b05de6c23c4c
*** cdt git genie on behalf of Chris Recoskie *** Bug 365142 - Linux specific API used in AIX libpty -> NULL dereference [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=abae07b394f4ba84c309889ee6bbeadeb2cfb20d
*** cdt git genie on behalf of Chris Recoskie *** Bug 365142 - Linux specific API used in AIX libpty -> NULL dereference [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d4ea43f6c86ad260403c8af96ddfd05e2f3beaca