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

Inappropriate Macro use and Unsafety #7

Open
henninglive opened this issue Jun 18, 2017 · 0 comments
Open

Inappropriate Macro use and Unsafety #7

henninglive opened this issue Jun 18, 2017 · 0 comments

Comments

@henninglive
Copy link

henninglive commented Jun 18, 2017

Why does this crate use macros to wrap FFI? I see no benefits in using macros over normal functions. The macro documentation does not include the types of parameters, there is no unsafe keywords when appropriate and inlining should account for any performance benefits.

There are also other safety and usability concerns in this crate. There is no error checking, this is left to the user. When providing a safe interface, you should probably check for errors and return a std::io::Error constructed from the errno with Error::last_os_error(). Also, signal numbers should probably be a enum bit set to keep users from passing invalid values.

Take a look at the Nix crate, they implement the wrappers for same functions, but with a reasonably safe interface.

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

No branches or pull requests

1 participant