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

Document prep_readv with safety info. #35

Closed
wants to merge 1 commit into from

Conversation

mxxo
Copy link
Contributor

@mxxo mxxo commented Jan 24, 2020

Start work on #29. After reading through #27 I'd appreciate a second opinion on the safety info.

src/sqe.rs Outdated
/// Prepare an atomic vectored read using the `readv` system call.
///
/// # Safety
/// You must ensure the file `fd` and destination buffer slice `bufs` outlive the event.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The requirements could be stated more precisely. The user needs to treat these as if the kernel has exclusive access to them until the completion occurs - they can't read or write to the bufs array or the buffers it points to and they can't pass the fd to kernel any syscalls like read/write/close (or schedule another event on the fd that isn't temporally linked to this one (ie using IOSQE_IO_LINK)

So I would at least change this to something like "ensure the kernel has exclusive access to the file and destination buffers until the end of the event"

Copy link
Contributor Author

@mxxo mxxo Feb 11, 2020

Choose a reason for hiding this comment

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

Thank you, fixed in fddd22b :)
Was having a little trouble with the wording.

@mxxo mxxo force-pushed the unsafe-docs branch 2 times, most recently from fbf39b3 to fddd22b Compare February 11, 2020 15:43
@mxxo
Copy link
Contributor Author

mxxo commented Sep 23, 2020

Closing in favour of overall library safety docs (https://github.com/ringbahn/iou/blob/master/src/lib.rs#L22-L24)

@mxxo mxxo closed this Sep 23, 2020
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.

2 participants