blob: 4b68d4ccdf0c52d3e801c5e96398385c93279d58 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
<think>
Okay, let's see. The user is reporting that QEMU's user mode emulation is returning -1 for a write syscall with NULL and 0 length, but on actual Linux it returns 0. The problem is specifically about the write() system call's behavior.
So, the main issue here is how the syscall is handled in QEMU. The write syscall with a zero-length buffer and NULL pointer. On Linux, writing zero bytes returns 0, which is correct according to POSIX. But QEMU is returning -1, which suggests an error. That's a syscall handling issue.
The user provided a test case that compiles a simple C program and shows that when run natively, it returns 0, but under QEMU's emulation, it returns -1. This indicates that QEMU's emulation of the write syscall isn't matching the host's behavior.
So, the category should be syscall because it's about the incorrect handling of a system call in the emulator. The other options are instruction (which would be about CPU instructions) or runtime (other runtime errors). Since this is specifically about the system call's return value, the correct category is syscall.
</think>
syscall
|