gtpc2m8aC/C++ Language Support User's Guide

tpf_is_RPCServer_auto_restarted-Query If an RPC Server Is Restarted

This function queries a remote procedure call (RPC) server to see if it has been restarted automatically by the TPF 4.1 system. Whenever a loadset is activated, deactivated, or excluded by the E-type loader, all RPC servers are restarted automatically.

Format

#include <rpc.h>
void     tpf_is_RPCServer_auto_restarted();

Normal Return

The tpf_is_RPCServer_auto_restarted function returns one of the following:

0
This is the original server that was started from the Internet daemon (INETD).

1
This is a copy of the original version of the server that was restarted automatically by the TPF 4.1 system.

Error Return

Not applicable.

Programming Considerations

Use this application programming interface (API) only for RPC server applications.

Examples

The following example queries the start status of the RPC server.

void rpcsrvstrt(void) {
 
/********************************************************/
/*  If this is the original version of the RPC server,  */
/*  then perform server initialization code.            */
/********************************************************/
 
#include <rpc.h>
 
     if (!tpf_is_RPCServer_auto_restarted())  {
         server_init_fct1();
         server_init_fct2();
         server_init_fct3();
         }
    else
        printf("RPC server is restarted by TPF\n");
}
 

Related Information

None.