id = 577 title = "getdtablesize() returns wrong value in qemu user mode on Linux/alpha" state = "closed" created_at = "2021-08-29T14:25:14.628Z" closed_at = "2022-02-07T15:29:56.367Z" labels = ["linux-user", "target: alpha"] url = "https://gitlab.com/qemu-project/qemu/-/issues/577" host-os = "Ubuntu 20.04" host-arch = "x86_64" qemu-version = "6.1.0" guest-os = "Linux" guest-arch = "alpha" description = """The `getdtablesize()` function returns a value that is too large. Namely, `getdtablesize() - 1` ought to be a valid file descriptor, but is not.""" reproduce = """[foo.c](/uploads/7a9e99d3811fe4a7eef183ed98c966a4/foo.c) 1. ``` # apt install g++-10-alpha-linux-gnu ``` 2. ``` $ alpha-linux-gnu-gcc-10 -Wall -static foo.c ``` [a.out](/uploads/4fffa6dd2332885f51e4030dcbe25644/a.out) 3. Transfer the a.out file to a Linux/alpha machine; execute it there. The return code is 0. 4. ``` $ QEMU_LD_PREFIX=/usr/alpha-linux-gnu ~/inst-qemu/6.1.0/bin/qemu-alpha ./a.out ; echo $? ``` Expected: `0` Actual: `1`""" additional = """"""