librpc/src/rpc/rtime.c, librpc/src/rpc/rcmd.c

Ralf Corsepius ralf.corsepius at rtems.org
Sat Feb 25 03:54:38 UTC 2012


Hi,

RTEMS carries some ancient implementations of rtime() and rcmd(),
it has inherited via its rpc implementation (Sun-rpc, ca. 1986-1988).

These functions are multilply problematic, because they are not covered 
by common standard and because they predate ANSI-C.

Visible symptom of these problems in RTEMS is these functions causing 
GCC warnings, because there are no public prototypes/declarations rsp. 
headers.


Comparing to other OSes:

1. rcmd
1.1. Header file location:
- Linux has rcmd in <netdb/in.h>
- FreeBSD has rcmd in <unistd.h>
- RTEMS doesn't carry it in any header.

1.2. Linux and FreeBSD have:
int rcmd(char **, int, const char *, const char *, const char *, int *);
RTEMS has
int rcmd(char **, u_short, const char *, const char *, const char *,  int *)

Besides the u_short, all functions and their args seem to be identical, 
but there doesn't seem to be a common header.


2. rtime
2.1 Header file location:
- FreeBSD has rtime in rpc/auth_des.h.
- Linux has rtime in rpc/des_crypt.h
- RTEMS doesn't carry it in any header.
- The original 198x-SunOS seems to have rtime in <netdb/in.h>

2.2 Function signature
FreeBSD has:
int rtime(dev_t, struct netbuf *, int, struct timeval *,
                     struct timeval *);

Linux has:
int rtime(struct sockaddr_in *addrp, struct rpc_timeval *timep,
                  struct rpc_timeval *timeout);

RTEMS has:
int rtime( struct sockaddr_in *addrp, struct timeval *timep,
         struct timeval *timeout )

Linux's rtime is entirely different from BSD's and RTEMS's, while
RTEMS's is similar to BSD's.



Suggestions on what do about this?

I am leaning towards
a) Changing rcmd() towards Linux/FreeBSD's signature and to add it to 
RTEMS's unistd.h.
b) Dropping rtime() from RTEMS.


Ralf



More information about the devel mailing list