View | Details | Raw Unified | Return to bug 218320 | Differences between
and this patch

Collapse All | Expand All

(-)devel/libgtop/files/patch-ino64 (+41 lines)
Line 0 Link Here
1
--- sysdeps/freebsd/procopenfiles.c.orig	2014-10-12 07:17:26.000000000 +0000
2
+++ sysdeps/freebsd/procopenfiles.c	2017-04-22 17:17:54.862169000 +0000
3
@@ -322,12 +322,12 @@
4
 				struct sockaddr_un *sun;
5
 
6
 				entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET;
7
-				sun = (struct sockaddr_un *)&kif->kf_sa_local;
8
+				sun = (struct sockaddr_un *)&kif->kf_un.kf_sock.kf_sa_local;
9
 
10
 				if (sun->sun_path[0]) {
11
 					char *addrstr;
12
 
13
-					addrstr = addr_to_string(&kif->kf_sa_local);
14
+					addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_local);
15
 					g_strlcpy(entry.info.localsock.name,
16
 						  addrstr,
17
 						  sizeof(entry.info.localsock.name));
18
@@ -335,7 +335,7 @@
19
 				} else {
20
 					char *addrstr;
21
 
22
-					addrstr = addr_to_string(&kif->kf_sa_peer);
23
+					addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_peer);
24
 					g_strlcpy(entry.info.localsock.name,
25
 						  addrstr,
26
 						  sizeof(entry.info.localsock.name));
27
@@ -349,12 +349,12 @@
28
 					entry.type = GLIBTOP_FILE_TYPE_INETSOCKET;
29
 				else
30
 					entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET;
31
-				addrstr = addr_to_string(&kif->kf_sa_peer);
32
+				addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_peer);
33
 				g_strlcpy(entry.info.sock.dest_host,
34
 					  addrstr,
35
 					  sizeof(entry.info.sock.dest_host));
36
 				g_free(addrstr);
37
-				entry.info.sock.dest_port = addr_to_port(&kif->kf_sa_peer);
38
+				entry.info.sock.dest_port = addr_to_port(&kif->kf_un.kf_sock.kf_sa_peer);
39
 			}
40
 		} else if (kif->kf_type == KF_TYPE_PIPE) {
41
 			entry.type = GLIBTOP_FILE_TYPE_PIPE;
(-)devel/llvm39/Makefile (+1 lines)
Lines 339-344 Link Here
339
339
340
post-patch-COMPILER_RT-on:
340
post-patch-COMPILER_RT-on:
341
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-294806
341
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-svn-294806
342
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-ino64
342
343
343
post-build-COMPILER_RT-on:
344
post-build-COMPILER_RT-on:
344
	${MKDIR} ${WRKDIR}/compiler-rt-build
345
	${MKDIR} ${WRKDIR}/compiler-rt-build
(-)devel/llvm39/files/compiler-rt-patch-ino64 (+49 lines)
Line 0 Link Here
1
diff --git lib/sanitizer_common/sanitizer_linux.cc lib/sanitizer_common/sanitizer_linux.cc
2
index 7328a5c0ac1..4b59a39ee27 100644
3
--- lib/sanitizer_common/sanitizer_linux.cc
4
+++ lib/sanitizer_common/sanitizer_linux.cc
5
@@ -223,7 +223,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) {
6
 
7
 uptr internal_stat(const char *path, void *buf) {
8
 #if SANITIZER_FREEBSD
9
-  return internal_syscall(SYSCALL(stat), path, buf);
10
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
11
+                          (uptr)buf, 0);
12
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
13
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
14
                           (uptr)buf, 0);
15
@@ -247,7 +248,8 @@ uptr internal_stat(const char *path, void *buf) {
16
 
17
 uptr internal_lstat(const char *path, void *buf) {
18
 #if SANITIZER_FREEBSD
19
-  return internal_syscall(SYSCALL(lstat), path, buf);
20
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
21
+                         (uptr)buf, AT_SYMLINK_NOFOLLOW);
22
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
23
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
24
                          (uptr)buf, AT_SYMLINK_NOFOLLOW);
25
@@ -590,7 +592,9 @@ uptr internal_getppid() {
26
 }
27
 
28
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
29
-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
30
+#if SANITIZER_FREEBSD
31
+  return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
32
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
33
   return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
34
 #else
35
   return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
36
diff --git lib/sanitizer_common/sanitizer_platform_limits_posix.h lib/sanitizer_common/sanitizer_platform_limits_posix.h
37
index 5cbd78d3c1b..d7ce7b501f7 100644
38
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
39
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
40
@@ -489,7 +489,8 @@ namespace __sanitizer {
41
   };
42
 #elif SANITIZER_FREEBSD
43
   struct __sanitizer_dirent {
44
-    unsigned int d_fileno;
45
+    unsigned long long d_fileno;
46
+    unsigned long long d_off;
47
     unsigned short d_reclen;
48
     // more fields that we don't care about
49
   };
(-)devel/llvm40/Makefile (+3 lines)
Lines 338-343 Link Here
338
post-extract-OPENMP-on:
338
post-extract-OPENMP-on:
339
	${MV} ${WRKSRC_openmp} ${PATCH_WRKSRC}/tools/openmp
339
	${MV} ${WRKSRC_openmp} ${PATCH_WRKSRC}/tools/openmp
340
340
341
post-patch-COMPILER_RT-on:
342
	cd ${WRKSRC_compiler_rt} && patch < ${PATCHDIR}/compiler-rt-patch-ino64
343
341
post-patch:
344
post-patch:
342
	${REINPLACE_CMD} -e 's|import lit|import lit${LLVM_SUFFIX}|' \
345
	${REINPLACE_CMD} -e 's|import lit|import lit${LLVM_SUFFIX}|' \
343
	    -e 's|from lit|from lit${LLVM_SUFFIX}|' \
346
	    -e 's|from lit|from lit${LLVM_SUFFIX}|' \
(-)devel/llvm40/files/compiler-rt-patch-ino64 (+49 lines)
Line 0 Link Here
1
diff --git lib/sanitizer_common/sanitizer_linux.cc lib/sanitizer_common/sanitizer_linux.cc
2
index 7328a5c0ac1..4b59a39ee27 100644
3
--- lib/sanitizer_common/sanitizer_linux.cc
4
+++ lib/sanitizer_common/sanitizer_linux.cc
5
@@ -223,7 +223,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in, struct stat *out) {
6
 
7
 uptr internal_stat(const char *path, void *buf) {
8
 #if SANITIZER_FREEBSD
9
-  return internal_syscall(SYSCALL(stat), path, buf);
10
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
11
+                          (uptr)buf, 0);
12
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
13
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
14
                           (uptr)buf, 0);
15
@@ -247,7 +248,8 @@ uptr internal_stat(const char *path, void *buf) {
16
 
17
 uptr internal_lstat(const char *path, void *buf) {
18
 #if SANITIZER_FREEBSD
19
-  return internal_syscall(SYSCALL(lstat), path, buf);
20
+  return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path,
21
+                         (uptr)buf, AT_SYMLINK_NOFOLLOW);
22
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
23
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
24
                          (uptr)buf, AT_SYMLINK_NOFOLLOW);
25
@@ -590,7 +592,9 @@ uptr internal_getppid() {
26
 }
27
 
28
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
29
-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
30
+#if SANITIZER_FREEBSD
31
+  return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL);
32
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
33
   return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
34
 #else
35
   return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
36
diff --git lib/sanitizer_common/sanitizer_platform_limits_posix.h lib/sanitizer_common/sanitizer_platform_limits_posix.h
37
index 5cbd78d3c1b..d7ce7b501f7 100644
38
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
39
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
40
@@ -489,7 +489,8 @@ namespace __sanitizer {
41
   };
42
 #elif SANITIZER_FREEBSD
43
   struct __sanitizer_dirent {
44
-    unsigned int d_fileno;
45
+    unsigned long long d_fileno;
46
+    unsigned long long d_off;
47
     unsigned short d_reclen;
48
     // more fields that we don't care about
49
   };
(-)lang/ghc/Makefile (+10 lines)
Lines 239-244 Link Here
239
	@${REINPLACE_CMD} -e 's|@SettingsCCompilerFlags@|& -Qunused-arguments|' ${BOOT_DIR}/settings.in
239
	@${REINPLACE_CMD} -e 's|@SettingsCCompilerFlags@|& -Qunused-arguments|' ${BOOT_DIR}/settings.in
240
.endif
240
.endif
241
.endif
241
.endif
242
.if empty(PORT_OPTIONS:MBOOT)
243
	@${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in
244
.endif
242
245
243
post-install-script:
246
post-install-script:
244
	@${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E -e \
247
	@${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E -e \
Lines 266-271 Link Here
266
		s|%%AR%%|${AR}|; \
269
		s|%%AR%%|${AR}|; \
267
		s|%%LD%%|${LD}|' \
270
		s|%%LD%%|${LD}|' \
268
		${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs
271
		${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs
272
.if empty(PORT_OPTIONS:MBOOTH)
273
	${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c
274
	for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \
275
	    ${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \
276
	done
277
	rm ${BOOT_DIR}/wrap.o
278
.endif
269
279
270
pre-configure:
280
pre-configure:
271
	@${MKDIR} ${TMPDIR}
281
	@${MKDIR} ${TMPDIR}
(-)lang/ghc/files/wrap.c (+54 lines)
Line 0 Link Here
1
/* -*- ugly-hack-mode -*- */
2
3
#include <sys/stat.h>
4
5
struct old_dirent;
6
struct old_stat;
7
8
__asm(".symver	old_readdir_r, readdir_r@FBSD_1.0");
9
int old_readdir_r(void *dirp, struct old_dirent *entry,
10
    struct old_dirent **result);
11
__asm(".symver	old_stat, stat@FBSD_1.0");
12
int old_stat(const char * restrict path, struct old_stat * restrict sb);
13
__asm(".symver	old_lstat, lstat@FBSD_1.0");
14
int old_lstat(const char * restrict path, struct old_stat * restrict sb);
15
__asm(".symver	old_fstat, fstat@FBSD_1.0");
16
int old_fstat(int fd, struct old_stat *sb);
17
__asm(".symver	old_mknod, mknod@FBSD_1.0");
18
int old_mknod(const char *path, mode_t mode, uint32_t dev);
19
20
int
21
__wrap_readdir_r(void *dirp, struct old_dirent *entry,
22
    struct old_dirent **result)
23
{
24
25
	return (old_readdir_r(dirp, entry, result));
26
}
27
28
int
29
__wrap_stat(const char * restrict path, struct old_stat * restrict sb)
30
{
31
32
	return (old_stat(path, sb));
33
}
34
35
int
36
__wrap_lstat(const char * restrict path, struct old_stat * restrict sb)
37
{
38
39
	return (old_lstat(path, sb));
40
}
41
42
int
43
__wrap_fstat(int fd, struct old_stat *sb)
44
{
45
46
	return (old_fstat(fd, sb));
47
}
48
49
int
50
__wrap_mknod(const char *path, mode_t mode, uint32_t dev)
51
{
52
53
	return (old_mknod(path, mode, dev));
54
}
(-)lang/rust/Makefile (-2 / +11 lines)
Lines 129-134 Link Here
129
		exit 1;\
129
		exit 1;\
130
	fi
130
	fi
131
131
132
LIBSTD=	rust-std-1.15.1-x86_64-unknown-freebsd/rust-std-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-2057375968b67ddb.rlib
133
STDF=	std-2057375968b67ddb.0.o
134
132
post-extract:
135
post-extract:
133
	@${MKDIR} \
136
	@${MKDIR} \
134
		${WRKSRC}/build/cache/${RUST_BOOTSTRAP_DIR} \
137
		${WRKSRC}/build/cache/${RUST_BOOTSTRAP_DIR} \
Lines 135-144 Link Here
135
		${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR}
138
		${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR}
136
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUSTC_BOOTSTRAP} \
139
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUSTC_BOOTSTRAP} \
137
		${WRKSRC}/build/cache/${RUST_BOOTSTRAP_DIR}
140
		${WRKSRC}/build/cache/${RUST_BOOTSTRAP_DIR}
138
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${RUST_STD_BOOTSTRAP} \
139
		${WRKSRC}/build/cache/${RUST_BOOTSTRAP_DIR}
140
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${CARGO_BOOTSTRAP} \
141
	${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${CARGO_BOOTSTRAP} \
141
		${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR}
142
		${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR}
143
	${TAR} -x -C ${WRKSRC} -f ${DISTDIR}/${DIST_SUBDIR}/${RUST_STD_BOOTSTRAP}
144
	${CC} ${CFLAGS} -fPIC -c -o ${WRKSRC}/old_fstat.o ${FILESDIR}/old_fstat.c
145
	(cd ${WRKSRC} && ${AR} x ${WRKSRC}/${LIBSTD} ${STDF})
146
	${LD} -r -o ${WRKSRC}/std.xx.o ${WRKSRC}/${STDF} ${WRKSRC}/old_fstat.o
147
	${MV} ${WRKSRC}/std.xx.o ${WRKSRC}/${STDF}
148
	(cd ${WRKSRC} && ${AR} r ${WRKSRC}/${LIBSTD} ${STDF})
149
	${TAR} -cy -C ${WRKSRC} -f ${WRKSRC}/rustc.tbz rust-std-1.15.1-x86_64-unknown-freebsd
150
	${MV} ${WRKSRC}/rustc.tbz ${WRKSRC}/build/cache/${RUST_STD_BOOTSTRAP}
142
151
143
post-patch:
152
post-patch:
144
	@test ! -f ${WRKSRC}/mk/main.mk || \
153
	@test ! -f ${WRKSRC}/mk/main.mk || \
(-)lang/rust/files/old_fstat.c (+101 lines)
Line 0 Link Here
1
#include <sys/syscall.h>
2
#include <dlfcn.h>
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <unistd.h>
6
7
struct stat;
8
9
int
10
fstat(int fd, struct stat *sb)
11
{
12
13
	return (syscall(SYS_freebsd11_fstat, fd, sb));
14
}
15
16
int
17
stat(const char *path, struct stat *sb)
18
{
19
20
	return (syscall(SYS_freebsd11_stat, path, sb));
21
}
22
23
int
24
lstat(const char *path, struct stat *sb)
25
{
26
27
	return (syscall(SYS_freebsd11_lstat, path, sb));
28
}
29
30
int
31
fstatat(int fd, const char *path, struct stat *sb, int flag)
32
{
33
34
	return (syscall(SYS_freebsd11_fstatat, fd, path, sb, flag));
35
}
36
37
struct ODIR;
38
struct freebsd11_dirent;
39
40
/*
41
__asm(".symver  old_readdir, readdir@FBSD_1.0");
42
int old_readdir(struct ODIR *);
43
int
44
readdir(struct ODIR *dirp)
45
{
46
47
	return (old_readdir(dirp));
48
}
49
*/
50
51
__asm(".symver  old_readdir_r, readdir_r@FBSD_1.0");
52
int old_readdir_r(struct ODIR *, struct freebsd11_dirent *,
53
    struct freebsd11_dirent **);
54
int
55
readdir_r(struct ODIR *dirp, struct freebsd11_dirent *entry,
56
    struct freebsd11_dirent **result)
57
{
58
	void *libc;
59
	void *fptr;
60
	int error;
61
62
	libc = dlopen("libc.so.7", RTLD_LAZY | RTLD_GLOBAL);
63
	if (libc == NULL) {
64
		fprintf(stderr, "libc open: %s\n", dlerror());
65
		abort();
66
	}
67
	fptr = dlvsym(libc, "readdir_r", "FBSD_1.0");
68
	if (fptr == NULL) {
69
		fprintf(stderr, "readdir_r: %s\n", dlerror());
70
		abort();
71
	}
72
	error = ((int (*)(struct ODIR *, struct freebsd11_dirent *,
73
	    struct freebsd11_dirent **))fptr)(dirp, entry, result);
74
	dlclose(libc);
75
	return (error);
76
}
77
78
/*
79
__asm(".symver	old_scandir, scandir@FBSD_1.0");
80
int old_scandir(const char *, struct freebsd11_dirent ***,
81
    int (*)(const struct freebsd11_dirent *),
82
    int (*)(const struct freebsd11_dirent **,
83
	const struct freebsd11_dirent **));
84
int
85
scandir(const char *dirname, struct freebsd11_dirent ***namelist,
86
    int (*select)(const struct freebsd11_dirent *),
87
    int (*dcomp)(const struct freebsd11_dirent **,
88
	const struct freebsd11_dirent **))
89
{
90
91
	return (old_scandir(dirname, namelist, select, dcomp));
92
}
93
*/
94
95
struct old_statfs;
96
int
97
fstatfs(int fd, struct old_statfs *buf)
98
{
99
100
	return (syscall(SYS_freebsd11_fstatfs, fd, buf));
101
}
(-)lang/rust/files/patch-ino64 (+308 lines)
Line 0 Link Here
1
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig	2017-03-10 22:56:40.000000000 +0000
2
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs	2017-05-05 10:03:39.644990000 +0000
3
@@ -1,8 +1,8 @@
4
 pub type fflags_t = u32;
5
 pub type clock_t = i32;
6
-pub type ino_t = u32;
7
+pub type ino_t = u64;
8
 pub type lwpid_t = i32;
9
-pub type nlink_t = u16;
10
+pub type nlink_t = u64;
11
 pub type blksize_t = u32;
12
 pub type clockid_t = ::c_int;
13
 pub type sem_t = _sem;
14
@@ -39,10 +39,12 @@
15
     }
16
 
17
     pub struct dirent {
18
-        pub d_fileno: u32,
19
+        pub d_fileno: u64,
20
+        pub d_off: u64,
21
         pub d_reclen: u16,
22
         pub d_type: u8,
23
         pub d_namlen: u8,
24
+        pub d_pad0: u32,
25
         pub d_name: [::c_char; 256],
26
     }
27
 
28
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86.rs.orig	2017-03-10 22:56:40.000000000 +0000
29
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86.rs	2017-05-05 10:13:49.091702000 +0000
30
@@ -7,25 +7,30 @@
31
     pub struct stat {
32
         pub st_dev: ::dev_t,
33
         pub st_ino: ::ino_t,
34
-        pub st_mode: ::mode_t,
35
         pub st_nlink: ::nlink_t,
36
+        pub st_mode: ::mode_t,
37
+        pub st_pad0: ::uint16_t,
38
         pub st_uid: ::uid_t,
39
         pub st_gid: ::gid_t,
40
+        pub st_pad1: ::uint32_t,
41
         pub st_rdev: ::dev_t,
42
+        pub st_atime_ext ::i32,
43
         pub st_atime: ::time_t,
44
         pub st_atime_nsec: ::c_long,
45
+        pub st_mtime_ext ::i32,
46
         pub st_mtime: ::time_t,
47
         pub st_mtime_nsec: ::c_long,
48
+        pub st_ctime_ext ::i32,
49
         pub st_ctime: ::time_t,
50
         pub st_ctime_nsec: ::c_long,
51
+        pub st_birthtime_ext ::i32,
52
+        pub st_birthtime: ::time_t,
53
+        pub st_birthtime_nsec: ::c_long,
54
         pub st_size: ::off_t,
55
         pub st_blocks: ::blkcnt_t,
56
         pub st_blksize: ::blksize_t,
57
         pub st_flags: ::fflags_t,
58
-        pub st_gen: ::uint32_t,
59
-        pub st_lspare: ::int32_t,
60
-        pub st_birthtime: ::time_t,
61
-        pub st_birthtime_nsec: ::c_long,
62
-        __unused: [u8; 8],
63
+        pub st_gen: ::uint64_t,
64
+        pub st_lspare: [::uint64_t; 10],
65
     }
66
 }
67
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig	2017-03-10 22:56:40.000000000 +0000
68
+++ ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs	2017-05-05 10:03:39.645576000 +0000
69
@@ -7,10 +7,12 @@
70
     pub struct stat {
71
         pub st_dev: ::dev_t,
72
         pub st_ino: ::ino_t,
73
-        pub st_mode: ::mode_t,
74
         pub st_nlink: ::nlink_t,
75
+        pub st_mode: ::mode_t,
76
+        pub st_pad0: ::uint16_t,
77
         pub st_uid: ::uid_t,
78
         pub st_gid: ::gid_t,
79
+        pub st_pad1: ::uint32_t,
80
         pub st_rdev: ::dev_t,
81
         pub st_atime: ::time_t,
82
         pub st_atime_nsec: ::c_long,
83
@@ -18,13 +20,13 @@
84
         pub st_mtime_nsec: ::c_long,
85
         pub st_ctime: ::time_t,
86
         pub st_ctime_nsec: ::c_long,
87
+        pub st_birthtime: ::time_t,
88
+        pub st_birthtime_nsec: ::c_long,
89
         pub st_size: ::off_t,
90
         pub st_blocks: ::blkcnt_t,
91
         pub st_blksize: ::blksize_t,
92
         pub st_flags: ::fflags_t,
93
-        pub st_gen: ::uint32_t,
94
-        pub st_lspare: ::int32_t,
95
-        pub st_birthtime: ::time_t,
96
-        pub st_birthtime_nsec: ::c_long,
97
+        pub st_gen: ::uint64_t,
98
+        pub st_spare: [::int64_t; 10],
99
     }
100
 }
101
--- ./src/liblibc/src/unix/bsd/freebsdlike/mod.rs.orig	2017-03-10 22:56:40.000000000 +0000
102
+++ ./src/liblibc/src/unix/bsd/freebsdlike/mod.rs	2017-05-05 10:03:39.646020000 +0000
103
@@ -1,4 +1,4 @@
104
-pub type dev_t = u32;
105
+pub type dev_t = u64;
106
 pub type mode_t = u16;
107
 pub type pthread_attr_t = *mut ::c_void;
108
 pub type rlim_t = i64;
109
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig	2017-03-10 22:55:22.000000000 +0000
110
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs	2017-05-05 10:03:39.646330000 +0000
111
@@ -7,10 +7,12 @@
112
     pub struct stat {
113
         pub st_dev: ::dev_t,
114
         pub st_ino: ::ino_t,
115
-        pub st_mode: ::mode_t,
116
         pub st_nlink: ::nlink_t,
117
+        pub st_mode: ::mode_t,
118
+        pub st_pad0: u16,
119
         pub st_uid: ::uid_t,
120
         pub st_gid: ::gid_t,
121
+        pub st_pad1: ::u32,
122
         pub st_rdev: ::dev_t,
123
         pub st_atime: ::time_t,
124
         pub st_atime_nsec: ::c_long,
125
@@ -18,13 +20,13 @@
126
         pub st_mtime_nsec: ::c_long,
127
         pub st_ctime: ::time_t,
128
         pub st_ctime_nsec: ::c_long,
129
+        pub st_birthtime: ::time_t,
130
+        pub st_birthtime_nsec: ::c_long,
131
         pub st_size: ::off_t,
132
         pub st_blocks: ::blkcnt_t,
133
         pub st_blksize: ::blksize_t,
134
         pub st_flags: ::fflags_t,
135
-        pub st_gen: ::uint32_t,
136
-        pub st_lspare: ::int32_t,
137
-        pub st_birthtime: ::time_t,
138
-        pub st_birthtime_nsec: ::c_long,
139
+        pub st_gen: ::uint64_t,
140
+        pub st_spare: [u64; 10],
141
     }
142
 }
143
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig	2017-03-10 22:55:22.000000000 +0000
144
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs	2017-05-05 10:03:39.646697000 +0000
145
@@ -1,7 +1,7 @@
146
 pub type fflags_t = u32;
147
 pub type clock_t = i32;
148
-pub type ino_t = u32;
149
-pub type nlink_t = u16;
150
+pub type ino_t = u64;
151
+pub type nlink_t = u64;
152
 pub type blksize_t = u32;
153
 pub type clockid_t = ::c_int;
154
 
155
@@ -10,10 +10,12 @@
156
 
157
 s! {
158
     pub struct dirent {
159
-        pub d_fileno: u32,
160
+        pub d_fileno: u64,
161
+        pub d_off: u64,
162
         pub d_reclen: u16,
163
         pub d_type: u8,
164
         pub d_namlen: u8,
165
+        pub d_pad0: u32,
166
         pub d_name: [::c_char; 256],
167
     }
168
 
169
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs.orig	2017-03-10 22:55:22.000000000 +0000
170
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs	2017-05-05 10:13:34.699604000 +0000
171
@@ -7,25 +7,30 @@
172
     pub struct stat {
173
         pub st_dev: ::dev_t,
174
         pub st_ino: ::ino_t,
175
-        pub st_mode: ::mode_t,
176
         pub st_nlink: ::nlink_t,
177
+        pub st_mode: ::mode_t,
178
+        pub st_pad0: u16,
179
         pub st_uid: ::uid_t,
180
         pub st_gid: ::gid_t,
181
+        pub st_pad1: u32,
182
         pub st_rdev: ::dev_t,
183
+        pub st_atime_ext: ::i32,
184
         pub st_atime: ::time_t,
185
         pub st_atime_nsec: ::c_long,
186
+        pub st_mtime_ext: ::i32,
187
         pub st_mtime: ::time_t,
188
         pub st_mtime_nsec: ::c_long,
189
+        pub st_ctime_ext: ::i32,
190
         pub st_ctime: ::time_t,
191
         pub st_ctime_nsec: ::c_long,
192
+        pub st_birthtime_ext: ::i32,
193
+        pub st_birthtime: ::time_t,
194
+        pub st_birthtime_nsec: ::c_long,
195
         pub st_size: ::off_t,
196
         pub st_blocks: ::blkcnt_t,
197
         pub st_blksize: ::blksize_t,
198
         pub st_flags: ::fflags_t,
199
-        pub st_gen: ::uint32_t,
200
-        pub st_lspare: ::int32_t,
201
-        pub st_birthtime: ::time_t,
202
-        pub st_birthtime_nsec: ::c_long,
203
-        __unused: [u8; 8],
204
+        pub st_gen: ::uint64_t,
205
+        pub st_spare: [u64; 10],
206
     }
207
 }
208
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig	2017-03-10 22:55:22.000000000 +0000
209
+++ ./src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs	2017-05-05 10:03:39.647404000 +0000
210
@@ -1,4 +1,4 @@
211
-pub type dev_t = u32;
212
+pub type dev_t = u64;
213
 pub type mode_t = u16;
214
 pub type pthread_attr_t = *mut ::c_void;
215
 pub type rlim_t = i64;
216
--- ./src/libstd/os/freebsd/raw.rs.orig	2017-03-10 22:55:21.000000000 +0000
217
+++ ./src/libstd/os/freebsd/raw.rs	2017-05-05 10:24:00.391639000 +0000
218
@@ -38,32 +38,48 @@
219
 #[stable(feature = "raw_ext", since = "1.1.0")]
220
 pub struct stat {
221
     #[stable(feature = "raw_ext", since = "1.1.0")]
222
-    pub st_dev: u32,
223
+    pub st_dev: u64,
224
     #[stable(feature = "raw_ext", since = "1.1.0")]
225
-    pub st_ino: u32,
226
+    pub st_ino: u64,
227
     #[stable(feature = "raw_ext", since = "1.1.0")]
228
+    pub st_nlink: u64,
229
+    #[stable(feature = "raw_ext", since = "1.1.0")]
230
     pub st_mode: u16,
231
     #[stable(feature = "raw_ext", since = "1.1.0")]
232
-    pub st_nlink: u16,
233
+    pub st_pad0: u16,
234
     #[stable(feature = "raw_ext", since = "1.1.0")]
235
     pub st_uid: u32,
236
     #[stable(feature = "raw_ext", since = "1.1.0")]
237
     pub st_gid: u32,
238
     #[stable(feature = "raw_ext", since = "1.1.0")]
239
-    pub st_rdev: u32,
240
+    pub st_pad1: u32,
241
     #[stable(feature = "raw_ext", since = "1.1.0")]
242
+    pub st_rdev: u64,
243
+    #[cfg(target_arch = "x86")]
244
+    pub st_atime_ext: c_long,
245
+    #[stable(feature = "raw_ext", since = "1.1.0")]
246
     pub st_atime: c_long,
247
     #[stable(feature = "raw_ext", since = "1.1.0")]
248
     pub st_atime_nsec: c_long,
249
+    #[cfg(target_arch = "x86")]
250
+    pub st_mtime_ext: c_long,
251
     #[stable(feature = "raw_ext", since = "1.1.0")]
252
     pub st_mtime: c_long,
253
     #[stable(feature = "raw_ext", since = "1.1.0")]
254
     pub st_mtime_nsec: c_long,
255
+    #[cfg(target_arch = "x86")]
256
+    pub st_ctime_ext: c_long,
257
     #[stable(feature = "raw_ext", since = "1.1.0")]
258
     pub st_ctime: c_long,
259
     #[stable(feature = "raw_ext", since = "1.1.0")]
260
     pub st_ctime_nsec: c_long,
261
+    #[cfg(target_arch = "x86")]
262
+    pub st_birthtime_ext: c_long,
263
     #[stable(feature = "raw_ext", since = "1.1.0")]
264
+    pub st_birthtime: c_long,
265
+    #[stable(feature = "raw_ext", since = "1.1.0")]
266
+    pub st_birthtime_nsec: c_long,
267
+    #[stable(feature = "raw_ext", since = "1.1.0")]
268
     pub st_size: i64,
269
     #[stable(feature = "raw_ext", since = "1.1.0")]
270
     pub st_blocks: i64,
271
@@ -72,14 +88,7 @@
272
     #[stable(feature = "raw_ext", since = "1.1.0")]
273
     pub st_flags: u32,
274
     #[stable(feature = "raw_ext", since = "1.1.0")]
275
-    pub st_gen: u32,
276
+    pub st_gen: u64,
277
     #[stable(feature = "raw_ext", since = "1.1.0")]
278
-    pub st_lspare: i32,
279
-    #[stable(feature = "raw_ext", since = "1.1.0")]
280
-    pub st_birthtime: c_long,
281
-    #[stable(feature = "raw_ext", since = "1.1.0")]
282
-    pub st_birthtime_nsec: c_long,
283
-    #[cfg(target_arch = "x86")]
284
-    #[stable(feature = "raw_ext", since = "1.1.0")]
285
-    pub __unused: [u8; 8],
286
+    pub st_spare: [u64; 10],
287
 }
288
--- ./src/libstd/os/freebsd/fs.rs.orig	2017-03-10 22:55:21.000000000 +0000
289
+++ ./src/libstd/os/freebsd/fs.rs	2017-05-05 10:03:39.647976000 +0000
290
@@ -74,8 +74,6 @@
291
     fn st_flags(&self) -> u32;
292
     #[stable(feature = "metadata_ext2", since = "1.8.0")]
293
     fn st_gen(&self) -> u32;
294
-    #[stable(feature = "metadata_ext2", since = "1.8.0")]
295
-    fn st_lspare(&self) -> u32;
296
 }
297
 
298
 #[stable(feature = "metadata_ext", since = "1.1.0")]
299
@@ -146,9 +144,6 @@
300
     }
301
     fn st_flags(&self) -> u32 {
302
         self.as_inner().as_inner().st_flags as u32
303
-    }
304
-    fn st_lspare(&self) -> u32 {
305
-        self.as_inner().as_inner().st_lspare as u32
306
     }
307
 }
308
 
(-)sysutils/py-psutil/files/patch-ino64 (+60 lines)
Line 0 Link Here
1
--- psutil/arch/bsd/freebsd_socks.c.orig	2017-04-22 17:20:07.041427000 +0000
2
+++ psutil/arch/bsd/freebsd_socks.c	2017-04-22 17:22:50.547756000 +0000
3
@@ -148,20 +148,20 @@
4
         if (kif->kf_sock_domain == AF_INET) {
5
             if (!psutil_sockaddr_matches(
6
                     AF_INET, inp->inp_lport, &inp->inp_laddr,
7
-                    &kif->kf_sa_local))
8
+                    &kif->kf_un.kf_sock.kf_sa_local))
9
                 continue;
10
             if (!psutil_sockaddr_matches(
11
                     AF_INET, inp->inp_fport, &inp->inp_faddr,
12
-                    &kif->kf_sa_peer))
13
+                    &kif->kf_un.kf_sock.kf_sa_peer))
14
                 continue;
15
         } else {
16
             if (!psutil_sockaddr_matches(
17
                     AF_INET6, inp->inp_lport, &inp->in6p_laddr,
18
-                    &kif->kf_sa_local))
19
+                    &kif->kf_un.kf_sock.kf_sa_local))
20
                 continue;
21
             if (!psutil_sockaddr_matches(
22
                     AF_INET6, inp->inp_fport, &inp->in6p_faddr,
23
-                    &kif->kf_sa_peer))
24
+                    &kif->kf_un.kf_sock.kf_sa_peer))
25
                 continue;
26
         }
27
 
28
@@ -577,19 +577,19 @@
29
                 inet_ntop(
30
                     kif->kf_sock_domain,
31
                     psutil_sockaddr_addr(kif->kf_sock_domain,
32
-                                         &kif->kf_sa_local),
33
+                                         &kif->kf_un.kf_sock.kf_sa_local),
34
                     lip,
35
                     sizeof(lip));
36
                 inet_ntop(
37
                     kif->kf_sock_domain,
38
                     psutil_sockaddr_addr(kif->kf_sock_domain,
39
-                                         &kif->kf_sa_peer),
40
+                                         &kif->kf_un.kf_sock.kf_sa_peer),
41
                     rip,
42
                     sizeof(rip));
43
                 lport = htons(psutil_sockaddr_port(kif->kf_sock_domain,
44
-                                                   &kif->kf_sa_local));
45
+                                                   &kif->kf_un.kf_sock.kf_sa_local));
46
                 rport = htons(psutil_sockaddr_port(kif->kf_sock_domain,
47
-                                                   &kif->kf_sa_peer));
48
+                                                   &kif->kf_un.kf_sock.kf_sa_peer));
49
 
50
                 // construct python tuple/list
51
                 py_laddr = Py_BuildValue("(si)", lip, lport);
52
@@ -620,7 +620,7 @@
53
             else if (kif->kf_sock_domain == AF_UNIX) {
54
                 struct sockaddr_un *sun;
55
 
56
-                sun = (struct sockaddr_un *)&kif->kf_sa_local;
57
+                sun = (struct sockaddr_un *)&kif->kf_un.kf_sock.kf_sa_local;
58
                 snprintf(
59
                     path, sizeof(path), "%.*s",
60
                     (int)(sun->sun_len - (sizeof(*sun) - sizeof(sun->sun_path))),

Return to bug 218320