From 9880635f2e642380b69b85e00271649b3a2fc2de Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 9 Jun 2016 10:48:05 +0200 Subject: RPC(3): Port to RTEMS --- freebsd/include/rpc/clnt_stat.h | 3 ++- freebsd/include/rpc/rpc_msg.h | 12 ++++++++---- freebsd/include/rpc/svc.h | 3 ++- freebsd/include/rpcsvc/nis_db.h | 6 ++++-- freebsd/include/rpcsvc/yp_prot.h | 3 ++- freebsd/lib/libc/include/namespace.h | 5 +++++ freebsd/lib/libc/rpc/rpcb_clnt.c | 2 +- 7 files changed, 24 insertions(+), 10 deletions(-) (limited to 'freebsd') diff --git a/freebsd/include/rpc/clnt_stat.h b/freebsd/include/rpc/clnt_stat.h index 6148b4eb..a0cf01bb 100644 --- a/freebsd/include/rpc/clnt_stat.h +++ b/freebsd/include/rpc/clnt_stat.h @@ -73,7 +73,8 @@ enum clnt_stat { RPC_STALERACHANDLE = 25, RPC_CANTCONNECT = 26, /* couldn't make connection (cots) */ RPC_XPRTFAILED = 27, /* received discon from remote (cots) */ - RPC_CANTCREATESTREAM = 28 /* can't push rpc module (cots) */ + RPC_CANTCREATESTREAM = 28, /* can't push rpc module (cots) */ + _CLNT_STAT = 0xffffffff }; #ifdef __cplusplus diff --git a/freebsd/include/rpc/rpc_msg.h b/freebsd/include/rpc/rpc_msg.h index 6e8d0745..fdde3875 100644 --- a/freebsd/include/rpc/rpc_msg.h +++ b/freebsd/include/rpc/rpc_msg.h @@ -53,12 +53,14 @@ enum msg_type { CALL=0, - REPLY=1 + REPLY=1, + _MSG_TYPE = 0xffffffff }; enum reply_stat { MSG_ACCEPTED=0, - MSG_DENIED=1 + MSG_DENIED=1, + _REPLY_STAT = 0xffffffff }; enum accept_stat { @@ -67,12 +69,14 @@ enum accept_stat { PROG_MISMATCH=2, PROC_UNAVAIL=3, GARBAGE_ARGS=4, - SYSTEM_ERR=5 + SYSTEM_ERR=5, + _ACCEPT_STAT = 0xffffffff }; enum reject_stat { RPC_MISMATCH=0, - AUTH_ERROR=1 + AUTH_ERROR=1, + _REJECT_STAT = 0xffffffff }; /* diff --git a/freebsd/include/rpc/svc.h b/freebsd/include/rpc/svc.h index 2af5550f..51f278ae 100644 --- a/freebsd/include/rpc/svc.h +++ b/freebsd/include/rpc/svc.h @@ -81,7 +81,8 @@ enum xprt_stat { XPRT_DIED, XPRT_MOREREQS, - XPRT_IDLE + XPRT_IDLE, + _XPRT_STAT = 0xffffffff }; /* diff --git a/freebsd/include/rpcsvc/nis_db.h b/freebsd/include/rpcsvc/nis_db.h index 9dcc7837..ff5e64f2 100644 --- a/freebsd/include/rpcsvc/nis_db.h +++ b/freebsd/include/rpcsvc/nis_db.h @@ -69,7 +69,8 @@ enum db_status { DB_BADOBJECT = 5, DB_MEMORY_LIMIT = 6, DB_STORAGE_LIMIT = 7, - DB_INTERNAL_ERROR = 8 + DB_INTERNAL_ERROR = 8, + _DB_STATUS = 0xffffffff }; typedef enum db_status db_status; @@ -80,7 +81,8 @@ enum db_action { DB_FIRST = 3, DB_NEXT = 4, DB_ALL = 5, - DB_RESET_NEXT = 6 + DB_RESET_NEXT = 6, + _DB_ACTION = 0xffffffff }; typedef enum db_action db_action; diff --git a/freebsd/include/rpcsvc/yp_prot.h b/freebsd/include/rpcsvc/yp_prot.h index 960cab63..6b2e28af 100644 --- a/freebsd/include/rpcsvc/yp_prot.h +++ b/freebsd/include/rpcsvc/yp_prot.h @@ -235,7 +235,8 @@ struct dom_binding { /* error code in ypbind_resp.ypbind_status */ enum ypbind_resptype { YPBIND_SUCC_VAL = 1, - YPBIND_FAIL_VAL = 2 + YPBIND_FAIL_VAL = 2, + _YPBIND_RESPTYPE = 0xffffffff }; /* network order, of course */ diff --git a/freebsd/lib/libc/include/namespace.h b/freebsd/lib/libc/include/namespace.h index 83be334e..8b2f04b1 100644 --- a/freebsd/lib/libc/include/namespace.h +++ b/freebsd/lib/libc/include/namespace.h @@ -67,5 +67,10 @@ #define _getpeername getpeername #define _getprogname getprogname #define _getsockname getsockname +#ifdef __rtems__ +#define _pthread_mutex_lock pthread_mutex_lock +#define _getsockopt getsockopt +#define _bind bind +#endif /* __rtems__ */ #endif /* _NAMESPACE_H_ */ diff --git a/freebsd/lib/libc/rpc/rpcb_clnt.c b/freebsd/lib/libc/rpc/rpcb_clnt.c index 120b792c..ffee9659 100644 --- a/freebsd/lib/libc/rpc/rpcb_clnt.c +++ b/freebsd/lib/libc/rpc/rpcb_clnt.c @@ -1038,7 +1038,7 @@ done: * * Assuming that the address is all properly allocated */ -int +bool_t rpcb_getaddr(program, version, nconf, address, host) rpcprog_t program; rpcvers_t version; -- cgit v1.2.3