aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/generic/fcntl.h4
-rw-r--r--linux-user/mmap.c2
-rw-r--r--linux-user/strace.list4
-rw-r--r--linux-user/syscall.c33
4 files changed, 35 insertions, 8 deletions
diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h
index 9f727d4df2..c85c5b9fed 100644
--- a/linux-user/generic/fcntl.h
+++ b/linux-user/generic/fcntl.h
@@ -99,6 +99,10 @@
#define TARGET_F_SETLKW64 14
#endif
+#define TARGET_F_OFD_GETLK 36
+#define TARGET_F_OFD_SETLK 37
+#define TARGET_F_OFD_SETLKW 38
+
#ifndef TARGET_F_SETOWN_EX
#define TARGET_F_SETOWN_EX 15
#define TARGET_F_GETOWN_EX 16
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index e378033797..caab62909e 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -708,7 +708,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
if (prot == 0) {
host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
if (host_addr != MAP_FAILED && reserved_va && old_size > new_size) {
- mmap_reserve(old_addr + old_size, new_size - old_size);
+ mmap_reserve(old_addr + old_size, old_size - new_size);
}
} else {
errno = ENOMEM;
diff --git a/linux-user/strace.list b/linux-user/strace.list
index d49a1e92a8..9281c0a758 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -125,10 +125,10 @@
{ TARGET_NR_dup3, "dup3" , "%s(%d,%d,%d)", NULL, NULL },
#endif
#ifdef TARGET_NR_epoll_create
-{ TARGET_NR_epoll_create, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create, "epoll_create", "%s(%d)", NULL, NULL },
#endif
#ifdef TARGET_NR_epoll_create1
-{ TARGET_NR_epoll_create1, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create1, "epoll_create1", "%s(%d)", NULL, NULL },
#endif
#ifdef TARGET_NR_epoll_ctl
{ TARGET_NR_epoll_ctl, "epoll_ctl" , NULL, NULL, NULL },
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7f6700c54e..97de9fb5c9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2987,7 +2987,7 @@ static abi_long do_socket(int domain, int type, int protocol)
#endif
protocol == NETLINK_KOBJECT_UEVENT ||
protocol == NETLINK_AUDIT)) {
- return -EPFNOSUPPORT;
+ return -TARGET_EPFNOSUPPORT;
}
if (domain == AF_PACKET ||
@@ -5856,7 +5856,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr)
abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
{
- return -ENOSYS;
+ return -TARGET_ENOSYS;
}
#else
abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
@@ -6098,6 +6098,9 @@ static int target_to_host_fcntl_cmd(int cmd)
case TARGET_F_SETFD:
case TARGET_F_GETFL:
case TARGET_F_SETFL:
+ case TARGET_F_OFD_GETLK:
+ case TARGET_F_OFD_SETLK:
+ case TARGET_F_OFD_SETLKW:
ret = cmd;
break;
case TARGET_F_GETLK:
@@ -6383,6 +6386,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
break;
case TARGET_F_GETLK64:
+ case TARGET_F_OFD_GETLK:
ret = copy_from_user_flock64(&fl64, arg);
if (ret) {
return ret;
@@ -6394,6 +6398,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
break;
case TARGET_F_SETLK64:
case TARGET_F_SETLKW64:
+ case TARGET_F_OFD_SETLK:
+ case TARGET_F_OFD_SETLKW:
ret = copy_from_user_flock64(&fl64, arg);
if (ret) {
return ret;
@@ -7378,7 +7384,7 @@ static int is_proc_myself(const char *filename, const char *entry)
}
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
- defined(TARGET_SPARC) || defined(TARGET_M68K)
+ defined(TARGET_SPARC) || defined(TARGET_M68K) || defined(TARGET_HPPA)
static int is_proc(const char *filename, const char *entry)
{
return strcmp(filename, entry) == 0;
@@ -7438,6 +7444,18 @@ static int open_cpuinfo(void *cpu_env, int fd)
}
#endif
+#if defined(TARGET_HPPA)
+static int open_cpuinfo(void *cpu_env, int fd)
+{
+ dprintf(fd, "cpu family\t: PA-RISC 1.1e\n");
+ dprintf(fd, "cpu\t\t: PA7300LC (PCX-L2)\n");
+ dprintf(fd, "capabilities\t: os32\n");
+ dprintf(fd, "model\t\t: 9000/778/B160L\n");
+ dprintf(fd, "model name\t: Merlin L2 160 QEMU (9000/778/B160L)\n");
+ return 0;
+}
+#endif
+
#if defined(TARGET_M68K)
static int open_hardware(void *cpu_env, int fd)
{
@@ -7462,7 +7480,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
{ "/proc/net/route", open_net_route, is_proc },
#endif
-#if defined(TARGET_SPARC)
+#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
#endif
#if defined(TARGET_M68K)
@@ -8031,8 +8049,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
}
}
return ret;
-#ifdef TARGET_NR_umount
+#if defined(TARGET_NR_umount) || defined(TARGET_NR_oldumount)
+#if defined(TARGET_NR_umount)
case TARGET_NR_umount:
+#endif
+#if defined(TARGET_NR_oldumount)
+ case TARGET_NR_oldumount:
+#endif
if (!(p = lock_user_string(arg1)))
return -TARGET_EFAULT;
ret = get_errno(umount(p));