Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / sysutils / strace / patches / patch-ah
blob5edd95afad40841982549997f589bc2b931ec512
1 $NetBSD$
3 --- file.c.orig 2007-01-15 15:25:52.000000000 -0500
4 +++ file.c      2007-12-05 11:22:56.000000000 -0500
5 @@ -1,5 +1,4 @@
6  /*
7 -#ifdef LINUX
8   * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
9   * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
10   * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
11 @@ -44,6 +43,13 @@
12  #else
13  #define kernel_dirent dirent
14  #endif
15 +#ifdef NETBSD
16 +#include <sys/statvfs.h>
17 +#define statfs statvfs
18 +#define __val __fsid_val
19 +#define f_fsid f_fsidx
20 +#endif
23  #ifdef LINUX
24  #  ifdef LINUXSPARC
25 @@ -162,7 +168,7 @@
26  #define XATTR_REPLACE 2
27  #endif
29 -#ifdef FREEBSD
30 +#ifdef ALLBSD
31  #include <sys/param.h>
32  #include <sys/mount.h>
33  #include <sys/stat.h>
34 @@ -831,16 +837,20 @@
35  #endif /* LINUXSPARC */
37  static const struct xlat fileflags[] = {
38 -#ifdef FREEBSD
39 +#ifdef ALLBSD
40         { UF_NODUMP,    "UF_NODUMP"     },
41         { UF_IMMUTABLE, "UF_IMMUTABLE"  },
42         { UF_APPEND,    "UF_APPEND"     },
43         { UF_OPAQUE,    "UF_OPAQUE"     },
44 +#ifdef UF_NOUNLINK
45         { UF_NOUNLINK,  "UF_NOUNLINK"   },
46 +#endif
47         { SF_ARCHIVED,  "SF_ARCHIVED"   },
48         { SF_IMMUTABLE, "SF_IMMUTABLE"  },
49         { SF_APPEND,    "SF_APPEND"     },
50 +#ifdef SF_NOUNLINK
51         { SF_NOUNLINK,  "SF_NOUNLINK"   },
52 +#endif
53  #elif UNIXWARE >= 2
54  #ifdef         _S_ISMLD
55         { _S_ISMLD,     "_S_ISMLD"      },
56 @@ -852,7 +862,7 @@
57         { 0,            NULL            },
58  };
60 -#ifdef FREEBSD
61 +#ifdef ALLBSD
62  int
63  sys_chflags(tcp)
64  struct tcb *tcp;
65 @@ -1058,7 +1068,7 @@
66  #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
67                 break;
68         default:
69 -               tprintf("st_size=%llu, ", statbuf.st_size);
70 +               tprintf("st_size=%llu, ", (unsigned long long)statbuf.st_size);
71                 break;
72         }
73         if (!abbrev(tcp)) {
74 @@ -1546,6 +1556,7 @@
75  #endif /* LINUX */
77  #ifndef SVR4
78 +#ifndef NETBSD
80  static const char *
81  sprintfstype(magic)
82 @@ -1564,6 +1575,7 @@
83         sprintf(buf, "%#x", magic);
84         return buf;
85  }
86 +#endif
88  static void
89  printstatfs(tcp, addr)
90 @@ -1591,7 +1603,11 @@
91                 statbuf.f_namelen);
92  #else /* !ALPHA */
93         tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
94 +#ifndef NETBSD
95                 sprintfstype(statbuf.f_type),
96 +#else
97 +               statbuf.f_fstypename,
98 +#endif
99                 (unsigned long)statbuf.f_bsize,
100                 (unsigned long)statbuf.f_blocks,
101                 (unsigned long)statbuf.f_bfree);
102 @@ -1846,7 +1862,7 @@
103         return 0;
106 -#if defined(SUNOS4) || defined(SVR4)
107 +#if defined(SUNOS4) || defined(SVR4) || defined(NETBSD)
108  int
109  sys_fchroot(tcp)
110  struct tcb *tcp;
111 @@ -1856,7 +1872,7 @@
112         }
113         return 0;
115 -#endif /* SUNOS4 || SVR4 */
116 +#endif /* SUNOS4 || SVR4 || NETBSD */
118  int
119  sys_link(tcp)
120 @@ -2188,7 +2204,7 @@
122  #endif
124 -#ifdef FREEBSD
125 +#ifdef ALLBSD
126  int
127  sys_mkfifo(tcp)
128  struct tcb *tcp;
129 @@ -2199,7 +2215,7 @@
130         }
131         return 0;
133 -#endif /* FREEBSD */
134 +#endif /* ALLBSD */
136  int
137  sys_fsync(tcp)
138 @@ -2254,7 +2270,7 @@
140  #endif /* LINUX */
142 -#if defined FREEBSD || defined LINUX
143 +#if defined ALLBSD || defined LINUX
144  static const struct xlat direnttypes[] = {
145         { DT_UNKNOWN,   "DT_UNKNOWN"    },
146         { DT_FIFO,      "DT_FIFO"       },
147 @@ -2327,15 +2343,16 @@
148                                 d->d_namlen, d->d_namlen, d->d_name);
149                 }
150  #endif /* SUNOS4 */
151 -#ifdef FREEBSD
152 +#ifdef ALLBSD
153                 if (!abbrev(tcp)) {
154 -                       tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
155 -                               i ? " " : "", d->d_fileno, d->d_reclen);
156 +                       tprintf("%s{d_fileno=%llu, d_reclen=%u, d_type=",
157 +                               i ? " " : "", (unsigned long long)d->d_fileno,
158 +                               d->d_reclen);
159                         printxval(direnttypes, d->d_type, "DT_???");
160                         tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
161                                 d->d_namlen, d->d_namlen, d->d_name);
162                 }
163 -#endif /* FREEBSD */
164 +#endif /* ALLBSD */
165                 if (!d->d_reclen) {
166                         tprintf("/* d_reclen == 0, problem here */");
167                         break;
168 @@ -2421,7 +2438,7 @@
170  #endif
172 -#ifdef FREEBSD
173 +#ifdef ALLBSD
174  int
175  sys_getdirentries(tcp)
176  struct tcb * tcp;
177 @@ -2454,8 +2471,9 @@
178         for (i = 0; i < len;) {
179                 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
180                 if (!abbrev(tcp)) {
181 -                       tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
182 -                               i ? " " : "", d->d_fileno, d->d_reclen);
183 +                       tprintf("%s{d_fileno=%llu, d_reclen=%u, d_type=",
184 +                               i ? " " : "", (unsigned long long)d->d_fileno,
185 +                               d->d_reclen);
186                         printxval(direnttypes, d->d_type, "DT_???");
187                         tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
188                                 d->d_namlen, d->d_namlen, d->d_name);
189 @@ -2493,7 +2511,7 @@
191  #endif /* LINUX */
193 -#ifdef FREEBSD
194 +#ifdef ALLBSD
195  int
196  sys___getcwd(tcp)
197  struct tcb *tcp;