python2.0 and redhat 7.0 (new issue)

D-Man dsh8290 at rit.edu
Wed Nov 15 00:13:34 EST 2000


Ok,  I tried that with the following results:

$ find / -name "*.h" -exec grep forkpty {} \; -print 2>/dev/nullextern int forkpty (int *__amaster, char *__name,
/usr/include/pty.h
pid_t  	      vt_forkpty        (struct vt_em *vt, int do_uwtmp_log);
/usr/include/zvt/vt.h
int	     zvt_term_forkpty		       (ZvtTerm *term, int do_uwtmp_log);
/usr/include/zvt/zvtterm.h
/* Define if you have the forkpty function.  */
/usr/include/python2.0/config.h
/* BSDI does not supply a prototype for the 'openpty' and 'forkpty'
extern int forkpty(int *, char *, struct termios *, struct winsize *);
/usr/include/python2.0/pyport.h


So the protoype exists.  Since glimmer compiled without any problems, I expected that.  The real issue was finding the definition of the functions in a library file.

(in /usr/lib)
$ nm * -l 2>/dev/null | grep -E "(openpty|forkpty)"
openpty.o:
         U __errno_location	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:69
         U close	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:136
         U free	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:78
         U getpt	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:98
         U grantpt	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:102
         U ioctl	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:124
         U malloc	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:65
         U open	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:111
00000000 T openpty	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:89
         U ptsname_r	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:47
         U realloc	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:63
         U tcsetattr	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:122
         U unlockpt	/usr/src/bs/BUILD/glibc-2.1.92/login/openpty.c:105
forkpty.o:
         U _exit	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:46
         U close	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:52
         U fork	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:38
00000000 T forkpty	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:32
         U login_tty	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:45
         U openpty	/usr/src/bs/BUILD/glibc-2.1.92/login/forkpty.c:35
00001904 T forkpty	/usr/src/bs/BUILD/glibc-2.1.94/login/forkpty.c:32
00001684 T openpty	/usr/src/bs/BUILD/glibc-2.1.94/login/openpty.c:89
         U openpty
000e84c4 T wine_openpty
         U openpty
000e84c4 T wine_openpty
00001eb0 T vt_forkpty
         U vt_forkpty	(null):0
00003c40 T zvt_term_forkpty
00009990 T vt_forkpty
0000e5f0 T zvt_term_forkpty
00009990 T vt_forkpty
0000e5f0 T zvt_term_forkpty
00009990 T vt_forkpty
0000e5f0 T zvt_term_forkpty


If I'm reading this right, the functions openpty and forkpty came from the source files openpty.c and forkpty.c respectively and were compiled into the files openpty.o and forkpty.o respectively.  Then I tried this:

(in /usr/lib)
$ grep -E "(openpty|forkpty)" * 2>/dev/null
Binary file libutil.a matches
Binary file libutil.so matches
Binary file libwine.so matches
Binary file libwine.so.1.0 matches
Binary file libzvt.a matches
Binary file libzvt.so matches
Binary file libzvt.so.2 matches
Binary file libzvt.so.2.2.9 matches

(in /lib)
$ grep -E "(openpty|forkpty)" * 2>/dev/null
Binary file libutil-2.1.94.so matches
Binary file libutil.so.1 matches


Would the function glimmer wants be in the libutil file?

Thanks, 
-D

On Tue, 14 Nov 2000 20:57:26 Courageous wrote:
 | 
 | >/usr/src/redhat/BUILD/Python-2.0/Modules/./posixmodule.c:1729: undefined reference to `forkpty'
 | >collect2: ld returned 1 exit status
 | >make[3]: *** [glimmer] Error 1
 | >
 | >[snip rest of make's recurisve return with error]
 | >
 | >Any suggestions?
 | 
 | The following commands and variants are your friends:
 | 
 | find / -name "*.h" -exec grep forkpty {} \; -print
 | 
 | You might also try typing nm on a .a or .so file and see
 | what you get. You can combin nm with grep and a script
 | to exaustively search all libraries for a global function
 | definition, for example, even if it's not to be found in any
 | header file.
 | 
 | 
 | C//
 | 






More information about the Python-list mailing list