summaryrefslogtreecommitdiff
path: root/security/tct/patches/patch-ag
blob: 59dd766fe068d415a3308609d33a8be6ed8855e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$NetBSD: patch-ag,v 1.4 2015/03/19 08:34:53 dholland Exp $

Fix Linux off_t handling.
Add NetBSD support.

--- src/fstools/fs_tools.h.orig	2001-09-07 10:06:57.000000000 -0700
+++ src/fstools/fs_tools.h
@@ -182,14 +182,20 @@ extern int optind;
   * Linux 2.whatever. We'll see how stable the interfaces are.
   */
 #if defined(LINUX2)
+#define _FILE_OFFSET_BITS 64
 #define SUPPORTED
 #include <linux/ext2_fs.h>
 #define HAVE_EXT2FS
+#if 0
 #define USE_MYLSEEK
 #define HAVE_LLSEEK
-#define HAVE_DTIME
 #define LSEEK		mylseek
 #define OFF_T		long long
+#else
+#define LSEEK		lseek
+#define OFF_T		off_t
+#endif
+#define HAVE_DTIME
 #define STRTOUL		strtoul
 #define DADDR_T		__u32
 #define EXT2FS_TYPE	"ext2fs"
@@ -203,6 +203,26 @@ extern int optind;
 #endif
 #endif
 
+#if defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD7)
+#define SUPPORTED
+#define HAVE_UFS_FFS
+#include <sys/vnode.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufs_bswap.h>
+#include <ufs/ffs/fs.h>
+#define LSEEK           lseek
+#define OFF_T           off_t
+#define STRTOUL         strtoul
+#define itod(fs,i)      ino_to_fsba(fs,i)
+#define itoo(fs,i)      ino_to_fsbo(fs,i)
+#define INOTIME(t)      (t)
+#define DADDR_T         daddr_t
+#define UFS_TYPE        "ufs"
+#define DEF_FSTYPE      UFS_TYPE
+#define INO_TO_CG       ino_to_cg
+#endif
+
  /*
   * Catch-all.
   */