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

Added lseek and seek64 #377

Merged
merged 1 commit into from
Jun 20, 2016
Merged

Added lseek and seek64 #377

merged 1 commit into from
Jun 20, 2016

Conversation

aoprisan
Copy link
Contributor

@aoprisan aoprisan commented Jun 10, 2016

I have added lseek and seek64 to unistd, the last one targeting Linux/Android only. I wasn't sure where to place the Whence enum, or if it's a nice of doing, I am quite fresh to Rust.

@aoprisan aoprisan changed the title Added lseek, llseek and seek64 Added lseek and seek64 Jun 10, 2016
tmp.read_to_string(&mut buf).unwrap();
assert_eq!(b"f123456", buf.as_bytes());

close(tmp.as_raw_fd()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing in function seems inconsistent (some of it is 5 spaces)

Copy link
Contributor Author

@aoprisan aoprisan Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I rushed a bit, I will fix it.

@posborne
Copy link
Member

Please also squash commits down to a single commit as well.

llseek and lseek64

impl Whence

fixed formatting

awful typo when refactoring

no llseek

wrong test name

using off64_t

got rid of offset

Added SeekHole/Data; formatted test; SeekCur/Set/End use libc constants
@aoprisan
Copy link
Contributor Author

All done, let me know if anything else has to be fixed.

@posborne
Copy link
Member

Sorry for the delay @aoprisan. A couple minor things remain, but we can probably address these in the future:

  • I think one of the tests still has a minor indentation issue
  • I would like to eventually see the additional constants added to the libc crate and refer to the constants here
  • It may make sense to conditionally expose the extra linux constant for Linux only (will be necessitated by point 2)

That being said, that can all be fixed later. So, @homu r+

@homu
Copy link
Contributor

homu commented Jun 20, 2016

📌 Commit 0eb8b4b has been approved by posborne

@homu homu merged commit 0eb8b4b into nix-rust:master Jun 20, 2016
homu added a commit that referenced this pull request Jun 20, 2016
Added lseek and seek64

I have added lseek and seek64 to unistd, the last one targeting Linux/Android only. I wasn't sure where to place the Whence enum, or if it's a nice of doing, I am quite fresh to Rust.
posborne added a commit to posborne/libc that referenced this pull request Jun 20, 2016
Relates to nix-rust/nix#377.  These constants
are only available in systems running the Linux kernel.

Signed-off-by: Paul Osborne <[email protected]>
posborne added a commit to posborne/libc that referenced this pull request Jun 21, 2016
Relates to nix-rust/nix#377.  These constants
are only available in systems running the Linux kernel and are not
defined in musl libc (yet).

Signed-off-by: Paul Osborne <[email protected]>
bors added a commit to rust-lang/libc that referenced this pull request Jun 21, 2016
Add SEEK_DATA/SEEK_HOLE constants

Relates to nix-rust/nix#377.  These constants
are only available in systems running the Linux kernel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants