-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the value of `TIOCGSID`. Translate the flags argument to `pidfd_open` from target to host flags, which fixes the value of `PIDFD_NONBLOCK` on platforms where the value differs, such as mips64. Define `TARGET_SO_INCOMING_CPU` and `TARGET_SO_COOKIE` for mips/mips64 in qemu.
- Loading branch information
1 parent
b726837
commit dfae7aa
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
From Dan Gohman <[email protected]> | ||
Subject: [PATCH] Fix the flags argument of `pidfd_open`. | ||
|
||
This corrects the flags value of `pidfd_open` to avoid passing | ||
target flags to the host. Currently the only flag is `PIDFD_NONBLOCK` | ||
so we use the `fcntl_flags_tbl` to translate it. | ||
|
||
--- a/linux-user/syscall.c | ||
+++ b/linux-user/syscall.c | ||
@@ -9477,7 +9477,8 @@ | ||
#endif | ||
#if defined(__NR_pidfd_open) && defined(TARGET_NR_pidfd_open) | ||
case TARGET_NR_pidfd_open: | ||
- return get_errno(pidfd_open(arg1, arg2)); | ||
+ return get_errno(pidfd_open(arg1, | ||
+ target_to_host_bitmask(arg2, fcntl_flags_tbl))); | ||
#endif | ||
#if defined(__NR_pidfd_send_signal) && defined(TARGET_NR_pidfd_send_signal) | ||
case TARGET_NR_pidfd_send_signal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
From Dan Gohman <[email protected]> | ||
Subject: [PATCH] Fix the definition of `TIOCGSID`. | ||
|
||
This corrects the value of `TIOCGSID`. | ||
|
||
diff -ur a/linux-user/ioctls.h b/linux-user/ioctls.h | ||
--- a/linux-user/ioctls.h | ||
+++ b/linux-user/ioctls.h | ||
@@ -22,7 +28,7 @@ | ||
IOCTL(TIOCSCTTY, 0, TYPE_INT) | ||
IOCTL(TIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) | ||
IOCTL(TIOCSPGRP, IOC_W, MK_PTR(TYPE_INT)) | ||
- IOCTL(TIOCGSID, IOC_W, MK_PTR(TYPE_INT)) | ||
+ IOCTL(TIOCGSID, IOC_R, MK_PTR(TYPE_INT)) | ||
IOCTL(TIOCOUTQ, IOC_R, MK_PTR(TYPE_INT)) | ||
IOCTL(TIOCSTI, IOC_W, MK_PTR(TYPE_INT)) | ||
IOCTL(TIOCMGET, IOC_R, MK_PTR(TYPE_INT)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters