This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: termios module on IRIX
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: loewis, poinot
Priority: normal Keywords: patch

Created on 2003-08-12 06:45 by poinot, last changed 2022-04-10 16:10 by admin. This issue is now closed.

Messages (4)
msg44438 - (view) Author: Marc Poinot (poinot) Date: 2003-08-12 06:45
The termios.c module includes sys/termios.h 
in which a CTRL macro is present, but not defined
because of the pre-processing switches:

#if (_NO_POSIX && _NO_XOPEN4) || _ABIAPI
#define	CTRL(c)	((c)&037)

Then, the sys/ioctl.h is included (at least by
 termios.c module) and this uses CTRL() macro !
This looks like a problem on the IRIX side, they
should be consistent with their own headers.

The simplest way I found was to add into termios.c
the definition of CTRL:


#if defined(__sgi)
#define	CTRL(c)	((c)&037)
#endif



Has to be put *before* the #include <termios.h>
in Modules/termios.c
msg44439 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-18 22:09
Logged In: YES 
user_id=21627

In what cases would _ABIAPI be defined?
msg44440 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-31 13:01
Logged In: YES 
user_id=21627

Committed as termios.c 2.37.8.1 and 2.38.
msg44441 - (view) Author: Marc Poinot (poinot) Date: 2003-11-03 13:30
Logged In: YES 
user_id=28416

I've had a look at /usr/include/standards.h on my SGI, the
definition of ABIAPI
is located here. I cannot really understand what it is used
for (_ABIAPI), but
I guess it's something to allow binary compatibility
(o32/n32/64) for old libs.

The final point is the _ABIAPI *SHOULD NOT* been defined,
because it
forces the *old* termio structure. Python v2.3 uses the new
termio structure,
containing c_ospeed and c_ispeed.

About termios, the termio(7) man page says:  
     Old termio and termios
     For compatibility with existing binaries, MIPS ABI
programs, and programs
     that cannot be ported to use the new termio or termios
structures, the
     old interfaces are retained.  Existing binaries
automatically use the old
     interfaces.  By defining _OLD_TERMIOS at compile time
(before including
     <termios.h>, <termio.h>, or <sys/ttydev.h>), the old
interfaces are in
     effect.

As a matter of fact, recompiling Python v2.3 with
_ABI_SOURCE (i.e. _ABIAPI)
fails with the same error on Python termio module
(un-patched).
History
Date User Action Args
2022-04-10 16:10:36adminsetgithub: 39052
2003-08-12 06:45:21poinotcreate