Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 32-bit: O_LARGEFILE not set. #717

Closed
peterGo opened this issue Apr 9, 2010 · 2 comments
Closed

Linux 32-bit: O_LARGEFILE not set. #717

peterGo opened this issue Apr 9, 2010 · 2 comments

Comments

@peterGo
Copy link
Contributor

peterGo commented Apr 9, 2010

package main

import (
    "fmt"
    "os"
)

func main() {
    // 3.9 GB (4135698432 bytes)
    file := "/home/peter/ubuntu-9.10-dvd-i386.iso"
    flags := os.O_RDONLY
    perm := 0666
    in, err := os.Open(file, flags, perm)
    if err != nil {
        fmt.Println(file, err.String())
    }
    in.Close()
}

Go 40ce831c5918+ tip. Linux Ubuntu 9.10 386 32-bit.

The program fails to open the file if the file size is greater than or
equal to 2^31 bytes. strace shows:
open("/home/peter/ubuntu-9.10-dvd-i386.iso", O_RDONLY|O_CLOEXEC) = -1
EOVERFLOW (Value too large for defined data type).

If flags = flags | O_LARGEFILE the program opens the file.

The ioutil.ReadFile() implicit file open also fails for the same reason.

Go 9cf4bce3ad75+ tip. Linux Ubuntu 9.10 amd64 64-bit.

Program opens the file.
@rsc
Copy link
Contributor

rsc commented Apr 28, 2010

Comment 1:

I can't reproduce this but I certainly believe the report.
Will fix blind.

Owner changed to r...@golang.org.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Apr 30, 2010

Comment 2:

This issue was closed by revision 7906e31.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants