| @@ -1,123 +1,136 @@ | | | @@ -1,123 +1,136 @@ |
1 | $NetBSD: patch-af,v 1.18 2020/04/11 15:22:52 tnn Exp $ | | 1 | $NetBSD: patch-af,v 1.19 2020/04/16 09:47:26 manu Exp $ |
2 | | | 2 | |
3 | --- dialects/n+obsd/dlsof.h.orig 2006-03-28 21:54:15.000000000 +0000 | | 3 | |
4 | +++ dialects/n+obsd/dlsof.h | | 4 | --- dialects/n+obsd/dlsof.h.orig 2006-03-28 23:54:15.000000000 +0200 |
5 | @@ -46,6 +46,7 @@ | | 5 | +++ dialects/n+obsd/dlsof.h 2020-04-10 16:35:54.222640631 +0200 |
6 | #include <signal.h> | | 6 | @@ -94,8 +94,12 @@ |
7 | #include <string.h> | | 7 | #define _KERNEL |
8 | #include <unistd.h> | | | |
9 | +#include <sys/ptrace.h> /* pulled in by procfs.h, but needs to be pulled in before _KERNEL is defined */ | | | |
10 | | | | |
11 | # if defined(HASGETBOOTFILE) | | | |
12 | #include <util.h> | | | |
13 | @@ -95,6 +96,10 @@ struct uio; /* dummy for function protot | | | |
14 | # endif /* (defined(OPENBSDV) && OPENBSDV<3030) | | 8 | # endif /* (defined(OPENBSDV) && OPENBSDV<3030) |
15 | || (defined(NETBSDV) && __NetBSD_Version__>=106060000) */ | | 9 | || (defined(NETBSDV) && __NetBSD_Version__>=106060000) */ |
16 | | | 10 | |
17 | +# if defined(NETBSDV) && NETBSDV>=1003000 | | 11 | +# if defined(NETBSDV) && NETBSDV>=1003000 |
18 | +#define sockproto NETBSD_sockproto | | 12 | +#define sockproto NETBSD_sockproto |
19 | +# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ | | 13 | +# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ |
20 | + | | 14 | + |
21 | #include <sys/mount.h> | | 15 | #include <sys/mount.h> |
22 | | | 16 | |
23 | # if (defined(OPENBSDV) && OPENBSDV>=3030) \ | | 17 | # if (defined(OPENBSDV) && OPENBSDV>=3030) \ |
24 | @@ -106,10 +111,6 @@ struct uio; /* dummy for function protot | | 18 | || (defined(NETBSDV) && __NetBSD_Version__>=106060000) |
| | | 19 | @@ -105,12 +109,8 @@ |
| | | 20 | |
25 | #include <rpc/types.h> | | 21 | #include <rpc/types.h> |
26 | #include <sys/protosw.h> | | 22 | #include <sys/protosw.h> |
27 | | | 23 | |
28 | -# if defined(NETBSDV) && NETBSDV>=1003000 | | 24 | -# if defined(NETBSDV) && NETBSDV>=1003000 |
29 | -#define sockproto NETBSD_sockproto | | 25 | -#define sockproto NETBSD_sockproto |
30 | -# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ | | 26 | -# endif /* defined(NETBSDV) && NETBSDV>=1003000 */ |
31 | - | | 27 | - |
32 | #include <sys/socket.h> | | 28 | #include <sys/socket.h> |
33 | | | 29 | |
34 | # if defined(HASMSDOSFS) | | 30 | # if defined(HASMSDOSFS) |
35 | @@ -147,6 +148,9 @@ struct uio; /* dummy for function protot | | 31 | # if HASMSDOSFS==1 |
| | | 32 | @@ -146,8 +146,11 @@ |
| | | 33 | # endif /* (defined(OPENBSDV) && OPENBSDV<3030) |
36 | || (defined(NETBSDV) && __NetBSD_Version__<106060000) */ | | 34 | || (defined(NETBSDV) && __NetBSD_Version__<106060000) */ |
37 | | | 35 | |
38 | #define _KERNEL | | 36 | #define _KERNEL |
39 | +#ifndef VFS_PROTOS | | 37 | +#ifndef VFS_PROTOS |
40 | +#define VFS_PROTOS(x) | | 38 | +#define VFS_PROTOS(x) |
41 | +#endif | | 39 | +#endif |
42 | struct nameidata; /* to satisfy a function prototype in msdosfsmount.h */ | | 40 | struct nameidata; /* to satisfy a function prototype in msdosfsmount.h */ |
43 | #include <msdosfs/msdosfsmount.h> | | 41 | #include <msdosfs/msdosfsmount.h> |
44 | #undef _KERNEL | | 42 | #undef _KERNEL |
45 | @@ -161,6 +165,7 @@ struct nameidata; /* to satisfy a functi | | 43 | #include <msdosfs/direntry.h> |
| | | 44 | @@ -160,8 +163,9 @@ |
| | | 45 | |
46 | #include <sys/socketvar.h> | | 46 | #include <sys/socketvar.h> |
47 | #include <sys/un.h> | | 47 | #include <sys/un.h> |
48 | #include <sys/unpcb.h> | | 48 | #include <sys/unpcb.h> |
49 | +#include <net/route.h> | | 49 | +#include <net/route.h> |
50 | #include <netinet/in.h> | | 50 | #include <netinet/in.h> |
51 | #include <netinet/in_systm.h> | | 51 | #include <netinet/in_systm.h> |
52 | #include <netinet/ip.h> | | 52 | #include <netinet/ip.h> |
53 | @@ -170,7 +175,6 @@ struct nameidata; /* to satisfy a functi | | 53 | |
| | | 54 | @@ -169,9 +173,8 @@ |
| | | 55 | #include <netinet/ip6.h> |
54 | #include <netinet6/in6_pcb.h> | | 56 | #include <netinet6/in6_pcb.h> |
55 | # endif /* defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6) */ | | 57 | # endif /* defined(HASIPv6) && defined(NETBSDV) && !defined(HASINRIAIPv6) */ |
56 | | | 58 | |
57 | -#include <net/route.h> | | 59 | -#include <net/route.h> |
58 | #include <netinet/in_pcb.h> | | 60 | #include <netinet/in_pcb.h> |
59 | #include <netinet/ip_var.h> | | 61 | #include <netinet/ip_var.h> |
60 | #include <netinet/tcp.h> | | 62 | #include <netinet/tcp.h> |
61 | @@ -264,6 +268,9 @@ struct sockproto { | | 63 | #include <netinet/tcpip.h> |
| | | 64 | @@ -263,8 +266,11 @@ |
| | | 65 | #endif /* defined(HASBUFQ_H) */ |
62 | | | 66 | |
63 | #undef KERNEL | | 67 | #undef KERNEL |
64 | #include <ufs/mfs/mfsnode.h> | | 68 | #include <ufs/mfs/mfsnode.h> |
65 | +# if defined(HASTMPFS) | | 69 | +# if defined(HASTMPFS) |
66 | +#include <fs/tmpfs/tmpfs.h> | | 70 | +#include <fs/tmpfs/tmpfs.h> |
67 | +# endif /* defined(HASTMPFS) */ | | 71 | +# endif /* defined(HASTMPFS) */ |
68 | | | 72 | |
69 | # if defined(HASNFSPROTO) | | 73 | # if defined(HASNFSPROTO) |
70 | #include <nfs/rpcv2.h> | | 74 | #include <nfs/rpcv2.h> |
71 | @@ -370,7 +377,6 @@ struct sockproto { | | 75 | #include <nfs/nfsproto.h> |
| | | 76 | @@ -359,8 +365,9 @@ |
| | | 77 | # if defined(HASPROCFS) |
| | | 78 | # if defined(HASPROCFS_PFSROOT) |
| | | 79 | #define _KERNEL |
| | | 80 | # endif /* defined(HASPROCFS_PFSROOT) */ |
| | | 81 | +#include <sys/ptrace.h> |
| | | 82 | #include <miscfs/procfs/procfs.h> |
| | | 83 | # if defined(HASPROCFS_PFSROOT) |
| | | 84 | #undef _KERNEL |
| | | 85 | #define Proot PFSroot |
| | | 86 | @@ -369,9 +376,8 @@ |
| | | 87 | #define Pmem PFSmem |
72 | #define Pregs PFSregs | | 88 | #define Pregs PFSregs |
73 | #define Pfile PFSfile | | 89 | #define Pfile PFSfile |
74 | #define Pfpregs PFSfpregs | | 90 | #define Pfpregs PFSfpregs |
75 | -#define Pctl PFSctl | | 91 | -#define Pctl PFSctl |
76 | #define Pstatus PFSstatus | | 92 | #define Pstatus PFSstatus |
77 | #define Pnote PFSnote | | 93 | #define Pnote PFSnote |
78 | #define Pnotepg PFSnotepg | | 94 | #define Pnotepg PFSnotepg |
79 | @@ -382,6 +388,9 @@ struct sockproto { | | 95 | # if defined(NetBSDV) |
| | | 96 | @@ -381,8 +387,11 @@ |
| | | 97 | # if NETBSDV>=1006000 |
80 | #define Pmap PFSmap | | 98 | #define Pmap PFSmap |
81 | #define Pmaps PFSmaps | | 99 | #define Pmaps PFSmaps |
82 | # endif /* NETBSDV>=1006000 */ | | 100 | # endif /* NETBSDV>=1006000 */ |
83 | +# if NETBSDV<8099000 | | 101 | +# if NETBSDV<8099000 |
84 | +#define Pctl PFSctl | | 102 | +#define Pctl PFSctl |
85 | +# endif /* NETBSDV<8099000 */ | | 103 | +# endif /* NETBSDV<8099000 */ |
86 | # endif /* defined(NetBSDV) */ | | 104 | # endif /* defined(NetBSDV) */ |
87 | # endif /* defined(HASPROCFS_PFSROOT) */ | | 105 | # endif /* defined(HASPROCFS_PFSROOT) */ |
88 | #include <machine/reg.h> | | 106 | #include <machine/reg.h> |
89 | @@ -489,7 +498,12 @@ extern KA_T Kpa; | | 107 | # endif /* defined(HASPROCFS) */ |
| | | 108 | @@ -488,9 +497,14 @@ |
| | | 109 | |
90 | struct l_vfs { | | 110 | struct l_vfs { |
91 | KA_T addr; /* kernel address */ | | 111 | KA_T addr; /* kernel address */ |
92 | fsid_t fsid; /* file system ID */ | | 112 | fsid_t fsid; /* file system ID */ |
93 | +#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500 | | 113 | +#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500 |
94 | + /* MFSNAMELEN was removed from the kernel source after 4.99.24 */ | | 114 | + /* MFSNAMELEN was removed from the kernel source after 4.99.24 */ |
95 | + char type[sizeof(((struct statvfs *)NULL)->f_fstypename)]; /* type of file system */ | | 115 | + char type[sizeof(((struct statvfs *)NULL)->f_fstypename)]; /* type of file system */ |
96 | +#else | | 116 | +#else |
97 | char type[MFSNAMELEN]; /* type of file system */ | | 117 | char type[MFSNAMELEN]; /* type of file system */ |
98 | +#endif | | 118 | +#endif |
99 | char *dir; /* mounted directory */ | | 119 | char *dir; /* mounted directory */ |
100 | char *fsname; /* file system name */ | | 120 | char *fsname; /* file system name */ |
101 | struct l_vfs *next; /* forward link */ | | 121 | struct l_vfs *next; /* forward link */ |
102 | @@ -565,7 +579,7 @@ struct sfile { | | 122 | }; |
103 | #define NCACHE_NODEADDR nc_vp /* node address in NCACHE */ | | 123 | @@ -580,5 +594,13 @@ |
104 | #define NCACHE_PARADDR nc_dvp /* parent node address in NCACHE */ | | 124 | #define NCACHE_NODEID nc_vpid /* node ID in NCACHE */ |
105 | | | | |
106 | -# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) | | | |
107 | +# if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000 && __NetBSD_Version__ < 999005400) | | | |
108 | #define NCACHE_NXT nc_hash.le_next /* link in NCACHE */ | | | |
109 | # else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1002000) */ | | | |
110 | # if defined(NetBSD1_0) && NetBSD<1994101 | | | |
111 | @@ -581,4 +595,12 @@ struct sfile { | | | |
112 | # endif /* defined(HASNCVPID) */ | | 125 | # endif /* defined(HASNCVPID) */ |
113 | # endif /* defined(HASNCACHE) */ | | 126 | # endif /* defined(HASNCACHE) */ |
114 | | | 127 | |
115 | +#if defined(VV_ROOT) /* NetBSD >= 4.99.33 */ | | 128 | +#if defined(VV_ROOT) /* NetBSD >= 4.99.33 */ |
116 | +#define VNODE_VFLAG v_vflag | | 129 | +#define VNODE_VFLAG v_vflag |
117 | +#define NCACHE_VROOT VV_ROOT | | 130 | +#define NCACHE_VROOT VV_ROOT |
118 | +#else | | 131 | +#else |
119 | +#define VNODE_VFLAG v_flag | | 132 | +#define VNODE_VFLAG v_flag |
120 | +#define NCACHE_VROOT VROOT | | 133 | +#define NCACHE_VROOT VROOT |
121 | +#endif /* VV_ROOT */ | | 134 | +#endif /* VV_ROOT */ |
122 | + | | 135 | + |
123 | #endif /* NETBSD_LSOF_H */ | | 136 | #endif /* NETBSD_LSOF_H */ |