Skip to content

Commit 8ed9501

Browse files
committed
[netbsd] fix compilation on netbsd 10.1
1 parent 96d65e5 commit 8ed9501

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

lib/dialects/netbsd/Mksrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ L="dlsof.h dmnt.c dnode.c dnode1.c dproc.c dproto.h dsock.c dstore.c machine.h"
2626

2727
mksrc
2828

29+
D=lib
30+
L="node.c"
31+
32+
mksrc
33+
2934
D=src
30-
L="arg.c main.c node.c print.c ptti.c store.c usage.c util.c"
35+
L="arg.c main.c print.c ptti.c store.c usage.c util.c"
3136

3237
mksrc

lib/dialects/netbsd/dlsof.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ struct mounts {
498498
extern int Np; /* number of kernel processes */
499499

500500
# if defined(HASKVMGETPROC2)
501-
struct kinfo_proc2 *P; /* local process table copy */
501+
extern struct kinfo_proc2 *P; /* local process table copy */
502502
# else /* ! defined(HASKVMGETPROC2) */
503-
struct kinfo_proc *P; /* local process table copy */
503+
extern struct kinfo_proc *P; /* local process table copy */
504504
# endif /* defined(HASKVMGETPROC2) */
505505

506506
extern int pgshift; /* kernel's page shift */

lib/dialects/netbsd/dnode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ void process_node(struct lsof_context *ctx, /* context */
439439
ksb.st_ino = (ino_t)2;
440440
ksb.st_size = DEV_BSIZE;
441441
ksbs = 1;
442-
} else if (Namech[0] && statsafely(Namech, &ksb) == 0)
442+
} else if (Namech[0] && statsafely(ctx, Namech, &ksb) == 0)
443443
ksbs = 1;
444444
nty = KERNFSNODE;
445445
break;

lib/rnmt.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,21 @@ static void ncache_walk(struct lsof_context *ctx, KA_T ncp,
137137
if (sanity_check_vnode_impl(&vi) == 0 && sanity_check_namecache(&nc) == 0) {
138138
lnc = ncache_enter_local(vp, plnc, &nc);
139139
if (vi.vi_vnode.v_type == VDIR && vi.vi_nc_tree.rbt_root != NULL) {
140-
ncache_walk((KA_T)vi.vi_nc_tree.rbt_root, lnc);
140+
ncache_walk(ctx, (KA_T)vi.vi_nc_tree.rbt_root, lnc);
141141
}
142142
}
143143
if (left)
144-
ncache_walk(left, plnc);
144+
ncache_walk(ctx, left, plnc);
145145
if (right)
146-
ncache_walk(right, plnc);
146+
ncache_walk(ctx, right, plnc);
147147
}
148148

149149
void ncache_load(struct lsof_context *ctx) {
150150
KA_T rootvnode_addr;
151151
struct vnode_impl vi;
152152

153153
rootvnode_addr = (KA_T)0;
154-
if (get_Nl_value("rootvnode", (struct drive_Nl *)NULL, &rootvnode_addr) <
154+
if (get_Nl_value(ctx, "rootvnode", (struct drive_Nl *)NULL, &rootvnode_addr) <
155155
0 ||
156156
!rootvnode_addr ||
157157
kread(ctx, (KA_T)rootvnode_addr, (char *)&rootvnode_addr,
@@ -161,7 +161,7 @@ void ncache_load(struct lsof_context *ctx) {
161161
}
162162

163163
rb_tree_init(&lnc_rbtree, &lnc_rbtree_ops);
164-
ncache_walk((KA_T)vi.vi_nc_tree.rbt_root, 0);
164+
ncache_walk(ctx, (KA_T)vi.vi_nc_tree.rbt_root, 0);
165165
}
166166

167167
static void build_path(char **buf, size_t *remaining, const struct lnc *lnc) {
@@ -187,7 +187,7 @@ static void build_path(char **buf, size_t *remaining, const struct lnc *lnc) {
187187
*buf += len;
188188
}
189189

190-
char *ncache_lookup(char *buf, int blen, int *fp) {
190+
char *ncache_lookup(struct lsof_context *ctx, char *buf, int blen, int *fp) {
191191
const struct lnc *lnc;
192192
char *p;
193193
size_t remaining;

0 commit comments

Comments
 (0)