[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040129: LDM build failure on FreeBSD 5.2



>From: Unidata User Support <address@hidden>
>Organization: Unidata Program Center/UCAR
>Keywords: LDM FreeBSD 5.2

Steve,

I tried building LDM-6.0.14 on our new FreeBSD 5.2 machine, oliver
and ran into a failure associated with an apparent change in the
/usr/include/rpc/svc.h include file:

  Making `all' in directory /usr/local/ldm/ldm-6.0.14/src/protocol
  
  c89 -c -O   -I../config -I. -I../misc -I../ulog -I../protocol atofeedt.c
  c89 -c -O   -I../config -I. -I../misc -I../ulog -I../protocol h_clnt.c
  h_clnt.c: In function `h_xprt_turn':
  h_clnt.c:1211: error: structure has no member named `xp_sock'
  *** Error code 1
  
  Stop in /usr/local/ldm/ldm-6.0.14/src/protocol.
  *** Error code 1
  
  Stop in /usr/local/ldm/ldm-6.0.14/src.
  *** Error code 1
  
  Stop in /usr/local/ldm/ldm-6.0.14/src.

The same failure occurs when CC is defined as 'gcc'.

The svc.h include file on FreeBSD 5.2 defines SVCXPRT as:

/*
 * Server side transport handle
 */
typedef struct __rpc_svcxprt {
        int             xp_fd;
        u_short         xp_port;         /* associated port number */
        const struct xp_ops {
            /* receive incoming requests */
            bool_t      (*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *);
            /* get transport status */
            enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
            /* get arguments */
            bool_t      (*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
                                void *);
            /* send reply */
            bool_t      (*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
            /* free mem allocated for args */
            bool_t      (*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
                                void *);
            /* destroy this struct */
            void        (*xp_destroy)(struct __rpc_svcxprt *);
        } *xp_ops;
        int             xp_addrlen;      /* length of remote address */
        struct sockaddr_in xp_raddr;     /* remote addr. (backward ABI compat) 
*/
        /* XXX - fvdl stick this here for ABI backward compat reasons */
        const struct xp_ops2 {
                /* catch-all function */
                bool_t  (*xp_control)(struct __rpc_svcxprt *, const u_int,
                                void *);
        } *xp_ops2;
        char            *xp_tp;          /* transport provider device name */
        char            *xp_netid;       /* network token */
        struct netbuf   xp_ltaddr;       /* local transport address */
        struct netbuf   xp_rtaddr;       /* remote transport address */
        struct opaque_auth xp_verf;      /* raw response verifier */
        void            *xp_p1;          /* private: for use by svc ops */
        void            *xp_p2;          /* private: for use by svc ops */
        void            *xp_p3;          /* private: for use by svc lib */
        int             xp_type;         /* transport type */
} SVCXPRT;


The same definition on FreeBSD 4.9 is:

/*
 * Server side transport handle
 */
typedef struct __rpc_svcxprt {
        int             xp_sock;
        u_short         xp_port;         /* associated port number */   
        struct xp_ops {
            /* receive incoming requests */
            bool_t      (*xp_recv) __P((struct __rpc_svcxprt *,
 * SUN MICROSYSTEMS, INC. SHALL struct rpc_msg *));
            /* get transport status */
            enum xprt_stat (*xp_stat) __P((struct __rpc_svcxprt *));
            /* get arguments */
            bool_t      (*xp_getargs) __P((struct __rpc_svcxprt *, xdrproc_t,
 * or profits or other special, caddr_t));
            /* send reply */
            bool_t      (*xp_reply) __P((struct __rpc_svcxprt *,
 * Sun Microsystems, Inc.       struct rpc_msg *));
            /* free mem allocated for args */
            bool_t      (*xp_freeargs) __P((struct __rpc_svcxprt *, xdrproc_t,
                                caddr_t));
            /* destroy this struct */
            void        (*xp_destroy) __P((struct __rpc_svcxprt *));
        } *xp_ops;
        int             xp_addrlen;      /* length of remote address */
        struct sockaddr_in xp_raddr;     /* remote address */
        struct opaque_auth xp_verf;      /* raw response verifier */
        caddr_t         xp_p1;           /* private */
        caddr_t         xp_p2;           /* private */
} SVCXPRT;

The difference appears to be that FreeBSD 4.9 uses the name 'xp_sock'
and 5.2 uses 'xp_fd'.

Checking several different platforms, I see that SVCXPRT typically
has xp_fd defined as a structure element with a #define of xp_sock
as an xp_fd in the structure definition.  Here is the code from
zero:

struct __svcxprt {
    int     xp_fd;
#define xp_sock     xp_fd
    ushort_t    xp_port;
    /*
     * associated port number.
     * Obsolete, but still used to
     * specify whether rendezvouser
     * or normal connection
     */
    struct  xp_ops  *xp_ops;
    int     xp_addrlen; /* length of remote addr. Obsoleted */
    char        *xp_tp;     /* transport provider device name */
    char        *xp_netid;  /* network token */
    struct netbuf   xp_ltaddr;  /* local transport address */
    struct netbuf   xp_rtaddr;  /* remote transport address */
    char        xp_raddr[16];   /* remote address. Now obsoleted */
    struct opaque_auth xp_verf; /* raw response verifier */
    caddr_t     xp_p1;      /* private: for use by svc ops */
    caddr_t     xp_p2;      /* private: for use by svc ops */
    caddr_t     xp_p3;      /* private: for use by svc lib */
    int     xp_type;    /* transport type */
    /*
     * callback on client death
     * First parameter is the current structure,
     * Second parameter :
     *  - FALSE for the service listener
     *  - TRUE for a real connected socket
     */
    svc_errorhandler_t xp_closeclnt;
};

Tom
--
+-----------------------------------------------------------------------------+
* Tom Yoksas                                             UCAR Unidata Program *
* (303) 497-8642 (last resort)                                  P.O. Box 3000 *
* address@hidden                                   Boulder, CO 80307 *
* Unidata WWW Service                            http://www.unidata.ucar.edu/ *
+-----------------------------------------------------------------------------+