You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theerrno
withError::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.
The text was updated successfully, but these errors were encountered: