Skip to content

lseek wraps around! #241

Open
Open
@JustinCappos

Description

@JustinCappos

The implementation of lseek has a bug where the data type (i32) isn't large enough and so it will wrap around on large files.

See 678ffb2#diff-97744cd8def1974ce0c338f5dedaa20ce129fd3b1a07b75cddff8eeff3e96b0eR75-R76 for an example.

This should be changed to i64, which will not overflow in practice, at least with current storage sizes. Note that Rust's std::io implementation uses an u64. POSIX's type is system dependent (because, of course it is), but is usually a i64. Note that POSIX also will return -1 and set errno to EOVERFLOW if you go past the end and would wrap around.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions