[comp.lang.perl] Problems on PS/2 AIX 1.2

ckclark@athena.mit.edu (Calvin Clark) (04/22/91)

Two problems with building perl on the PS/2 model 70 running AIX 1.2 
compelled me to make code changes to the following files:

Files which use O_OPENDIR:     Files which use f_next:
--------------------------     -----------------------
arg.h			       cons.c
doio.c                         form.c
eval.c                         form.h
toke.c                         toke.c

The problem with O_OPENDIR is that <sys/fcntl.h> defines it:

fcntl.h:#define       O_OPENDIR    04000      /* no longer used */
 
which overrides the value in arg.h that the perl code expects: 

arg.h:#define O_OPENDIR 259

A possible solution is to change the name O_OPENDIR in the perl code.

Another problem occurs because 'f_next' has a macro definition in
<sys/file.h>:  

struct        file
{
      long    f_flag;
      short   f_count;                /* reference count */
      short   f_tcbdes;               /* TCB descriptor */
      short   f_type;                 /* descriptor type */
      siteno_t f_tmgrsite;            /* token manager site */
      char    f_wnttok;               /* token semaphore */
      char    f_tlckcnt;              /* token lock semaphore */
      union {
              struct inode *F_inode;  /* pointer to inode structure */
              caddr_t F_data;         /* pointer to socket */
      } f_ISP;
#define f_inode       f_ISP.F_inode
#define f_data        f_ISP.F_data
      union {
              off_t   F_offset;       /* read/write char pointer */
              short F_msgcount;       /* references from msg queue */
#define f_msgcount    f_UN.F_msgcount
              struct  file *F_next;   /* pointer for free list */
#define f_next  f_UN.F_next
      } f_UN;
#define f_offset      f_UN.F_offset
};

This causes compile time errors in files which use 'f_next' as a structure
element.  Possible solutions are to rename 'f_next' in the perl code, or
to include something like the following in those files:

#ifdef f_next
#undef f_next
#endif

I need <sys/file.h>, which includes <sys/fcntl.h> on this system, so there
is no way to avoid making these changes to the perl source code.

-Calvin 
                                            
INTERNET ckclark@athena.mit.edu           
UUCP     ...!mit-eddie!mit-athena!ckclark
BITNET   Use a ouija board.