Also, might I ask what you have in mind for this function? How are you planning to parse the accounting file? Are you writing a separate crate for that, or just planning to use lastcomm(1), or will you be adding that functionality to Nix?
Also, the argument type is wrong. This API doesn't provide anyway to disable process accounting once it's enabled. I suggest creating an acct module, and giving it two functions enable(filename: &CString), and disable().
This is the wrong way to set the return code. For one thing, it will always indicate an error. For another, errno won't be set if acct passes. See fchmod in sys/stat.rs for an example of how to do it right.
Also, the argument type is wrong. In Rust you should rarely use a &CString reference explicitly. Better to use the borrowed form &CStr. And in Nix, you should generally use NixPath instead. See mknod in sys/stat.rs for an example.
Hm, I tried using Github's online editor to reword a comment, but it seems that doing so creates a separate commit. Can you please squash those commits for me? I can't do it with the merge button, because Nix uses bors to merge.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.