Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Apr 1999 22:08:10 +0900 (JST)
From:      tate@spa.is.uec.ac.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/11382: generated code using rpcgen with -b option cannot be compiled
Message-ID:  <199904291308.WAA02138@unzen.spa.is.uec.ac.jp>

next in thread | raw e-mail | index | archive | help

>Number:         11382
>Category:       bin
>Synopsis:       generated code using rpcgen with -b option cannot be compiled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 29 06:10:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Takamichi Tateoka
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
University of Electro-Communications, Tokyo, JAPAN
>Environment:

	FreeBSD 3.1-RELEASE i386 and rpcgen which included in the release.
	However it happen in FreeBSD 2.2.8-RELEASE i386 and 
	seems not fixed yet even in current CVS repository.

>Description:

	Generated server side code using rpcgen with -b (Backward compatible)
	option can not be compiled.  The code includes <stropts.h> and
	<netconfig.h>, they are not exist on FreeBSD system.

	This option is not useful in FreeBSD since current rpcgen on FreeBSD
	is not support TI-RPC features and this option is turned on by default.
	However, to compile old programs for ONC RPC, we should compile them
	with -b option (existence of this option will be detected automatically
	by configure script) for portability.
	On current FreeBSD, configure script estimates -b options is available
	and generates a Makefile to use rpcgen with -b option, then
	the compilation will be failed.

>How-To-Repeat:

	Here is a simple sample rpc source (sample.c):

program SAMPLEPROG {
  version SAMPLEVERS {
    void sample_proc(void) = 0;
  } = 1;
} = 10000;

	Compile it using rpcgen with -b option:
% rpcgen -b sample.x
	Then, compile generated server side code:
% cc -c sample_svc.c
	It makes an error:
sample_svc.c:12: stropts.h: No such file or directory
sample_svc.c:13: netconfig.h: No such file or directory

>Fix:
	
	It is came from turning tirpcflag on when -b options is specified.
	As described in man page, current rpcgen on FreeBSD can not handle
	TI-RPC features and this options should simply be ignored.
	The patch should be following:

*** usr.bin/rpcgen/rpc_main.c.orig	Fri Sep 25 20:43:48 1998
--- usr.bin/rpcgen/rpc_main.c	Thu Apr 29 21:46:26 1999
***************
*** 1175,1185 ****
  					 *  generating backward compatible
  					 *  code
  					 */
- #if defined(__FreeBSD__) || defined(__NetBSD__)
- 					tirpcflag = 1;
- #else
  					tirpcflag = 0;
- #endif
  					break;
  
  				case 'I':
--- 1175,1181 ----

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904291308.WAA02138>