[Patches] [ python-Patches-731991 ] find correct socklen_t type

SourceForge.net noreply@sourceforge.net
Sun, 04 May 2003 12:18:35 -0700


Patches item #731991, was opened at 2003-05-04 01:04
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=731991&group_id=5470

Category: Build
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Rice (tim1470)
Assigned to: Nobody/Anonymous (nobody)
Summary: find correct socklen_t type

Initial Comment:
This patch adds code to configure.in to determine the
correct data type
for socklen_t if socklen_t is not defined by the
system.
Credit for the socklen_t autoconf magic goes to Albert
Chin (china@thewrittenword.com)
I've also fixed some sections of Modules/socketmodule.c
that should
have used socklen_t.


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-05-04 21:18

Message:
Logged In: YES 
user_id=21627

Why do you say "is needed for the socklen_t test"? Are you
referring to the test in your patch? In this test, u_int is
not *used* at all, it is only defined. So not defining it
should not cause problems.

----------------------------------------------------------------------

Comment By: Tim Rice (tim1470)
Date: 2003-05-04 21:05

Message:
Logged In: YES 
user_id=618097

u_int is needed for the socklen_t test by sys/socket.h on
SCO OpenServer

The u_int test towards the top of configure.in is also
needed by patch # 732284 
for UnixWare 7

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-05-04 20:56

Message:
Logged In: YES 
user_id=21627

Why do you need to define u_int? Python does not use this
type, so it should be irrelevant whether it is defined or not.

----------------------------------------------------------------------

Comment By: Tim Rice (tim1470)
Date: 2003-05-04 19:50

Message:
Logged In: YES 
user_id=618097

Looking at it again, undefing _XOPEN_SOURCE is not a good
idea.
Yes you'll miss the data types in socketmodule.c too but
they will be addressed 
in another patch to Include/pyport.h which is not included
in the configure tests.

I haven't taken the time to analize why it works (I didn't
write it). It's been
working fine on a wide range of platforms for over a year in
OpenSSH portable.
I wanted to get it in 2.2.2 but it requires autoconf 2.52 or
newer.
I've personaly tested on Linux, Solaris, UnixWare,
OpenServer.
UnixWare uses size_t and OpenServer uses int.

My new patch gets rid of AC_DEFUN and adds some data type
tests.
Two of the data type tests (u_char & u_long) are not needed
by the socklen_t
test but will be needed by a UnixWare 7 patch that I'll post
shortly.

Expect some fuz in the patch.  I'm breaking up a large patch
into understanable
chunks.





----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-05-04 14:29

Message:
Logged In: YES 
user_id=21627

Why do you #undef  _XOPEN_SOURCE? If you "miss data types
without this", won't you miss the same data types when
compiling socketmodule.c?

How does the test work? What kind of failure do you expect
when "trying the wrong type?

On what platforms has this change be tested? What platforms
did the old test fail on? What types do these systems use
for socklen_t?

Please lose the AC_DEFUN; AFAICT, it is used only once.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=731991&group_id=5470