Minor changes to improve compatibility with older FreeBSD releases.

This commit is contained in:
Doug Rabson 2008-03-28 09:50:32 +00:00
parent 96a6e6e6ca
commit ee31b83a3a
20 changed files with 45 additions and 24 deletions

View File

@ -8,7 +8,7 @@
#include <sys/mutex.h>
#include <sys/systm.h>
#include "nlm_prot.h"
#include <nlm/nlm_prot.h>
#include <sys/cdefs.h>
#ifndef lint
/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/

View File

@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#if __FreeBSD_version >= 700000
#include <sys/priv.h>
#endif
#include <sys/proc.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
@ -49,9 +51,9 @@ __FBSDID("$FreeBSD$");
#include <sys/unistd.h>
#include <sys/vnode.h>
#include "nlm_prot.h"
#include "sm_inter.h"
#include "nlm.h"
#include <nlm/nlm_prot.h>
#include <nlm/sm_inter.h>
#include <nlm/nlm.h>
#include <rpc/rpc_com.h>
#include <rpc/rpcb_prot.h>
@ -79,7 +81,14 @@ SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, CTLFLAG_RW, NULL, "");
*/
static int nlm_syscall_offset = SYS_nlm_syscall;
static struct sysent nlm_syscall_prev_sysent;
#if __FreeBSD_version < 700000
static struct sysent nlm_syscall_sysent = {
(sizeof(struct nlm_syscall_args) / sizeof(register_t)) | SYF_MPSAFE,
(sy_call_t *) nlm_syscall
};
#else
MAKE_SYSENT(nlm_syscall);
#endif
static bool_t nlm_syscall_registered = FALSE;
/*
@ -1209,7 +1218,11 @@ nlm_syscall(struct thread *td, struct nlm_syscall_args *uap)
{
int error;
#if __FreeBSD_version >= 700000
error = priv_check(td, PRIV_NFS_LOCKD);
#else
error = suser(td);
#endif
if (error)
return (error);

View File

@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/systm.h>
#include "nlm_prot.h"
#include "nlm.h"
#include <nlm/nlm_prot.h>
#include <nlm/nlm.h>
/**********************************************************************/

View File

@ -28,8 +28,8 @@
#include <sys/param.h>
#include <sys/systm.h>
#include "nlm_prot.h"
#include "nlm.h"
#include <nlm/nlm_prot.h>
#include <nlm/nlm.h>
#include <sys/cdefs.h>
#ifndef lint

View File

@ -3,7 +3,7 @@
* It was generated using rpcgen.
*/
#include "nlm_prot.h"
#include <nlm/nlm_prot.h>
#include <sys/cdefs.h>
#ifndef lint
/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/

View File

@ -3,7 +3,7 @@
* It was generated using rpcgen.
*/
#include "sm_inter.h"
#include <nlm/sm_inter.h>
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

View File

@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
/* auth_unix.c */
static void authunix_nextverf (AUTH *);

View File

@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/xdr.h>
#include <rpc/auth.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
/* gids compose part of a credential; there may not be more than 16 of them */
#define NGRPS 16

View File

@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#ifdef _FREEFALL_CONFIG

View File

@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
static enum clnt_stat clnt_reconnect_call(CLIENT *, rpcproc_t,
xdrproc_t, void *, xdrproc_t, void *, struct timeval);

View File

@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#define MCALL_MSG_SIZE 24

View File

@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <rpc/types.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
/*%
* WARNING: Don't even consider trying to compile this on a system where

View File

@ -27,7 +27,11 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <rpc/types.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#if __FreeBSD_version < 700000
#define strchr index
#endif
/*%
* WARNING: Don't even consider trying to compile this on a system where

View File

@ -58,7 +58,11 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include <rpc/nettype.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#if __FreeBSD_version < 700000
#define strrchr rindex
#endif
struct handle {
NCONF_HANDLE *nhandle;

View File

@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpcb_clnt.h>
#include <rpc/rpcb_prot.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
static struct timeval tottimeout = { 60, 0 };
static const struct timeval rmttimeout = { 3, 0 };

View File

@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include <rpc/rpcb_clnt.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#define SVC_VERSQUIET 0x0001 /* keep quiet about vers mismatch */
#define version_keepquiet(xp) ((u_long)(xp)->xp_p3 & SVC_VERSQUIET)

View File

@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
#define MAX_MACHINE_NAME 255
#define NGRPS 16

View File

@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
static enum xprt_stat svc_dg_stat(SVCXPRT *);
static bool_t svc_dg_recv(SVCXPRT *, struct rpc_msg *);

View File

@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpcb_clnt.h>
#include <rpc/nettype.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
extern int __svc_vc_setflag(SVCXPRT *, int);

View File

@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <rpc/rpc_com.h>
static bool_t svc_vc_rendezvous_recv(SVCXPRT *, struct rpc_msg *);
static enum xprt_stat svc_vc_rendezvous_stat(SVCXPRT *);