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

runtime: mmap uses uint32 for offset, but off_t is signed and sometimes 64-bit #16576

Closed
jnewlin12345 opened this issue Aug 2, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@jnewlin12345
Copy link

commented Aug 2, 2016

https://golang.org/src/runtime/mmap.go

offset is unsigned, but the mmap syscall takes an off_t that is signed 32-bit.

@mdempsky

This comment has been minimized.

Copy link
Member

commented Aug 2, 2016

I don't think it matters in practice. The runtime only uses mmap for MAP_ANON mappings, and always passes 0 as the offset. (Also, off_t is 64-bit on some OSes.)

Closing as non-issue. But if you have a proposal for how to fix it, I'd listen.

@mdempsky mdempsky closed this Aug 2, 2016

@mdempsky mdempsky changed the title mmap uses unsigned for offset runtime: mmap uses uint32 for offset, but off_t is signed and sometimes 64-bit Aug 2, 2016

@golang golang locked and limited conversation to collaborators Aug 2, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.