svcerr_noprog Subroutine

Important: The subroutine is exported from both the libc and the libnsl libraries.

svcerr_noprog Subroutine Exported from the libc Library

Purpose

Indicates that the service dispatch routine cannot complete a remote procedure call because the requested program is not registered.

Library

C Library (libc.a)

Syntax

#include <rpc/rpc.h>

void svcerr_noprog ( xprt)
SVCXPRT *xprt;

Description

The svcerr_noprog subroutine is called by a service dispatch routine when the requested program is not registered with the Remote Procedure Call (RPC) package. This subroutine sets the status of the RPC reply message to the PROG_UNAVAIL condition, which indicates that the remote server has not exported the program.

Note: Service implementors do not usually need this subroutine.

Parameters

Item Description
xprt Points to the RPC service transport handle.

svcerr_noprog Subroutine Exported from the libnsl Library

Purpose

Indicates that the service dispatch routine cannot complete a remote procedure call because the requested program is not registered.

Library

Network Services Library (libnsl.a)

Syntax

#include <rpc/rpc.h>
void svcerr_noprog ( xprt)
const SVCXPRT *xprt;

Description

The svcerr_noprog subroutine is called by a service dispatch routine when the requested program is not registered with the remote procedure call (RPC) package. This subroutine sets the status of the RPC reply message to the RPC_PROGUNAVAIL condition, which indicates that the remote server has not exported the program.

Parameters

Item Description
xprt Points to the RPC service transport handle.

Examples

#include <rpc/rpc.h>
#include <stdlib.h>
#define PROG 0x3fffffffL
#define VERS 0x1L

static void sample_dispatch();
main()
{
  char *nettype = "tcp";
  int no_of_handles;
 
  /* Create RPC service handle and register with RPCBIND service */
  if((no_of_handles = svc_create(sample_dispatch, PROG, VERS,nettype)) == 0)
  {
    fprintf(stdout, " Error in svc_create ");
    exit(EXIT_FAILURE);
  }
  svc_run();
  return 0;
} 

/* following is the sample dispatch routine*/
static void sample_dispatch(struct svc_req *request, SVCXPRT *xprt)
{
  int args;
  /* Dispatch routine code */
  /* If requested program is not registered. */
  svcerr_noprog(xprt);     
}