rpc interface

patch for rpc interface inconsistencies
When implementing remote procedure calls the 'rpcgen' program is tremendously useful. However, it can't produce code which accounts for the inconsistencies between the include headers in UNIX and VxWorks. Also, 'rpcgen' sometimes produces code which uses the Solaris thread library. Since GDS uses the POSIX thread library on UNIX and the native libraries on VxWorks, these calls have to patched.

The patch happens in two steps:

1) A new header file 'rpcinc.h' is inserted at the beginning of each c code file 'rpcgen' produces. The easiest way to do this is to add the following lines at the very beginning of the 'rpcgen' input file:

    #ifdef RPC_HDR
    %#define _RPC_HDR
    #endif
    #ifdef RPC_XDR
    %#define _RPC_XDR
    #endif
    #ifdef RPC_SVC
    %#define _RPC_SVC
    #endif
    #ifdef RPC_CLNT
    %#define _RPC_CLNT
    #endif
    %#include "rpcinc.h"
    

2) The old include directives have to be removed. This can be done with the following shell script (which can be integrated into the make file):

    mv myrpcfile_xxx.c dummy
    grep -v '.h>' dummy > myrpcfile_xxx.c
    rm -f dummy
    

where myrpcfile is the name of the 'rpcgen' input file and '_xxx' stands for one of the following: '_svc' (rpc server file), '_clnt' (rpc client file) and '' (rpc header file); no include directives have to be removed from the '_xdr' file.

Author:
Daniel Sigg
See Also:
Remote Procedure Call Interface

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++