I've been using this patch for unix98 ptys. Would you guys like to
include this? Do you think it needs to be modified before it will be
accepted?
As far as I know, it should work correctly on all systems.
If (glibc > 2.0) {
if (kernel support for pty98)
getpt should work
else
glibc should emulate with old pty behaviour
// or so I'm told
else
doesn't do anything
Index: src/process-unix.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.11.2.5
diff -c -r1.11.2.5 process-unix.c
*** process-unix.c 1998/12/29 10:54:27 1.11.2.5
--- process-unix.c 1999/09/20 13:29:18
***************
*** 265,271 ****
if (access (pty_name, 6) != 0)
{
close (fd);
! #if !defined(IRIS) && !defined(__sgi)
continue;
#else
return -1;
--- 265,271 ----
if (access (pty_name, 6) != 0)
{
close (fd);
! #if !defined(IRIS) && !defined(__sgi) && !defined (HAVE_GETPT)
continue;
#else
return -1;
Index: src/process.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/process.h,v
retrieving revision 1.8
diff -c -r1.8 process.h
*** process.h 1998/04/11 05:37:05 1.8
--- process.h 1999/09/20 13:29:18
***************
*** 134,137 ****
--- 134,149 ----
#endif /* emacs */
+ #if defined (__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >=
1)
+ # define HAVE_GETPT
+ #endif
+
+ #ifdef HAVE_GETPT
+ #define PTY_ITERATION
+ #define PTY_OPEN \
+ if ((fd = getpt()) < 0 || grantpt (fd) < 0 || unlockpt (fd) < 0) \
+ return -1;
+ #define PTY_TTY_NAME_SPRINTF ptsname_r (fd, pty_name, sizeof (pty_name));
+ #endif
+
#endif /* _XEMACS_PROCESS_H_ */
Show replies by date