Skip to content

Conversation

Grommish
Copy link
Contributor

@Grommish Grommish commented Apr 4, 2022

Add O_LARGEFILE define to src/unix/linux_like/linux/musl/b64/mips64.rs
Signed-off-by: Donald Hoskins [email protected]

Add O_LARGEFILE define to src/unix/linux_like/linux/musl/b64/mips64.rs
Signed-off-by: Donald Hoskins <[email protected]>
@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@Amanieu
Copy link
Member

Amanieu commented Apr 5, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Apr 5, 2022

📌 Commit 0acce72 has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Apr 5, 2022

⌛ Testing commit 0acce72 with merge ce7fd91...

@bors
Copy link
Contributor

bors commented Apr 5, 2022

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: Amanieu
Pushing ce7fd91 to master...

@bors bors merged commit ce7fd91 into rust-lang:master Apr 5, 2022
bors added a commit that referenced this pull request Aug 15, 2022
Fix incorrect constant for O_LARGEFILE on mips64-linux-musl

Changes `O_LARGEFILE` from `0` to `0x2000`

Bash script used for ensuring constant is correct:

```sh
#!/bin/bash
echo "
#include <fcntl.h>
int largefile() {
    return O_LARGEFILE;
}
" | mips64-linux-musl-gcc -c -O2 musl_o_largefile.c -o temp.o
mips64-linux-musl-objdump -d temp.o | grep -A2 largefile
```

Output:

```asm
0000000000000000 <largefile>:
   0:	03e00008 	jr	ra
   4:	24022000 	li	v0,8192    ; 0x2000
```

Link to relevant portion of kernel source, shows that it should match mips32 musl (which currently has a value of 0x2000 as well).

I believe the reason #2738 had this value incorrect was because it's 0 for glibc on mips64 (to specify it's the default, I believe).
bors added a commit that referenced this pull request Aug 16, 2022
Fix incorrect constant for O_LARGEFILE on mips64-linux-musl

Changes `O_LARGEFILE` from `0` to `0x2000`

Bash script used for ensuring constant is correct:

```sh
#!/bin/bash
echo "
#include <fcntl.h>
int largefile() {
    return O_LARGEFILE;
}
" | mips64-linux-musl-gcc -c -O2 musl_o_largefile.c -o temp.o
mips64-linux-musl-objdump -d temp.o | grep -A2 largefile
```

Output:

```asm
0000000000000000 <largefile>:
   0:	03e00008 	jr	ra
   4:	24022000 	li	v0,8192    ; 0x2000
```

Link to relevant portion of kernel source, shows that it should match mips32 musl (which currently has a value of 0x2000 as well).

I believe the reason #2738 had this value incorrect was because it's 0 for glibc on mips64 (to specify it's the default, I believe).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants