summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files/patch-z3-bsd-user-8fix
blob: d8ad10af8fd1fc1c6e79cf053713f30ab0cff673 (plain) (blame)
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
57
58
59
60
61
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -17,6 +17,18 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
+#if defined(__FreeBSD__)
+#include <sys/param.h>
+#endif
+
+#if defined(__FreeBSD_version) && __FreeBSD_version < 900000
+#define st_atim st_atimespec
+#define st_ctim st_ctimespec
+#define st_mtim st_mtimespec
+#define st_birthtim st_birthtimespec
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
@@ -1519,9 +1533,11 @@ do_setsockopt(int sockfd, int level, int
 			optname = SO_ERROR;
 			break;
 
+#ifdef SO_USER_COOKIE
 		case TARGET_SO_USER_COOKIE:
 			optname = SO_USER_COOKIE;
 			break;
+#endif
 
 		default:
 			goto unimplemented;
@@ -2091,9 +2107,11 @@ do_fork(CPUArchState *env, int num, int 
 		ret = rfork(flags);
 		break;
 
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900000
 	case TARGET_FREEBSD_NR_pdfork:
 		ret = pdfork(&fd, flags);
 		break;
+#endif
 
 	default:
 		ret = -TARGET_ENOSYS;
@@ -3499,6 +3517,7 @@ do_stat:
 	 unlock_user(p, arg1, 0);
 	 break;
 
+#if defined(__FreeBSD_version) && __FreeBSD_version > 900000
     case TARGET_FREEBSD_NR_setloginclass:
 	 if (!(p = lock_user_string(arg1)))
 		goto efault;
@@ -3512,6 +3531,7 @@ do_stat:
 	 ret = get_errno(getloginclass(p, arg2));
 	 unlock_user(p, arg1, 0);
 	 break;
+#endif
 
     case TARGET_FREEBSD_NR_getrusage:
 	 {