[Python-bugs-list] [ python-Bugs-534108 ] AIX 3.2.5 Has No chroot/fsync Prototypes

noreply@sourceforge.net noreply@sourceforge.net
Mon, 25 Mar 2002 05:41:26 -0800


Bugs item #534108, was opened at 2002-03-23 20:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=534108&group_id=5470

Category: Build
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
Priority: 5
Submitted By: Ralph Corderoy (ralph)
Assigned to: Michael Hudson (mwh)
Summary: AIX 3.2.5 Has No chroot/fsync Prototypes

Initial Comment:
`make' fails for Python-2.2.1c1 under AIX 3.2.5 due to
lack of prototypes for chroot and fsync in
Modules/posixmodule.c.  configure.in uses
AC_CHECK_FUNCS to check these two can be linked into
an executable, and configure correctly determines they
can.

    $ egrep 'chroot|fsync' config.cache
    ac_cv_func_chroot=${ac_cv_func_chroot='yes'}
    ac_cv_func_fsync=${ac_cv_func_fsync='yes'}
   
However, AC_CHECK_FUNCS essentially compiles and links

    #include "confdefs.h"
    #include <assert.h>
    char chroot();
    int main() {
    chroot();
    ; return 0; }
    
which under AIX 3.2.5 works fine.  But chroot isn't
prototyped in *any* system include file, nor is fsync.
Consequently, Modules/posixmodule.c has problems when
it attempts to use both chroot and fsync as an rvalue
for a pointer to a function.

    return posix_1str(args, "et:chroot", chroot);
    return posix_int(args, "i:fsync", fsync);
    
Both lines cause `Undeclared identifier' errors.
    
The solution is to conditionally add prototypes for
these two functions.  Modules/posixmodule.c has an
icky set of conditional prototypes at the start but 
they rely heavily on __IBMC__, __sun__, etc,
preprocessor symbols.  These could be expanded to
cover AIX 3.2.5's case but it may be better to use
autoconf's AC_CHECK_DECLS macro,
http://www.gnu.org/manual/autoconf/html_chapter/autoconf_5.html#SEC52.

By manually adding two prototypes at the start of the
source file I've confirmed the source file builds
successfully.


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

>Comment By: Michael Hudson (mwh)
Date: 2002-03-25 13:41

Message:
Logged In: YES 
user_id=6656

Hmm, AC_CHECK_DECLS might well be useful (and not just for
these declarations).

However, I'm not an autoconf guru, and really don't want to
have to become one.

Is there a way to identify AIX 3 using the preprocessor?  Or
does AIX 4 not have these prototypes either?

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=534108&group_id=5470