blob: 7d365639e9ef68698e669321b31cafb922db7678 (
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
|
getdtablesize() returns wrong value in qemu user mode on Linux/alpha
Description of problem:
The `getdtablesize()` function returns a value that is too large. Namely, `getdtablesize() - 1` ought to be a valid file descriptor, but is not.
Steps to 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 information:
|