Skip to content

Commit 2748fda

Browse files
committed
[freebsd] Fix freebsd 15 comopat due to rpc and sysctl changes
1 parent fe21ac7 commit 2748fda

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

lib/dialects/freebsd/dlsof.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,49 @@ int getmntinfo(struct statfs **, int);
168168

169169
# include <sys/domain.h>
170170
# define pmap RPC_pmap
171+
/* fix missing sysctl_ctx_list definition in FreeBSD 15 */
172+
# if FREEBSDV >= 15000
173+
# define _KERNEL
174+
# include <sys/sysctl.h>
175+
# undef _KERNEL
176+
# endif
171177
# include <rpc/rpc.h>
172178
# include <rpc/pmap_prot.h>
173179
# undef pmap
174180

181+
# if FREEBSDV >= 15000
182+
/* The kernel headers dropped user space libc header compat in commit 3a0cdb2,
183+
* undo it. The following code is copied and modified from
184+
* /usr/src/include/rpc/clnt.h. */
185+
typedef struct __rpc_client_user {
186+
AUTH *cl_auth; /* authenticator */
187+
struct clnt_ops_user {
188+
/* call remote procedure */
189+
enum clnt_stat (*cl_call)(struct __rpc_client *, rpcproc_t, xdrproc_t,
190+
void *, xdrproc_t, void *, struct timeval);
191+
/* abort a call */
192+
void (*cl_abort)(struct __rpc_client *);
193+
/* get specific error code */
194+
void (*cl_geterr)(struct __rpc_client *, struct rpc_err *);
195+
/* frees results */
196+
bool_t (*cl_freeres)(struct __rpc_client *, xdrproc_t, void *);
197+
/* destroy this structure */
198+
void (*cl_destroy)(struct __rpc_client *);
199+
/* the ioctl() of rpc */
200+
bool_t (*cl_control)(struct __rpc_client *, u_int, void *);
201+
} *cl_ops;
202+
void *cl_private; /* private stuff */
203+
char *cl_netid; /* network token */
204+
char *cl_tp; /* device name */
205+
} CLIENT_USER;
206+
# define CLIENT CLIENT_USER
207+
# undef clnt_call
208+
# define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
209+
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
210+
extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
211+
const char *);
212+
# endif
213+
175214
# include <paths.h>
176215
# include <ufs/ufs/quota.h>
177216

0 commit comments

Comments
 (0)