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
add listxattr/getxattr/setxattr/removexattr on Linux and Android #1847
add listxattr/getxattr/setxattr/removexattr on Linux and Android #1847
Conversation
…ue is just a sequence of arbitrary bytes
I haven't read the whole PR yet. But does this have any advantages over the existing xattr crate? |
Yes, it has some minor advantages, see Why another crate for EA? Any difference from xattr. As you can see, I have made a dedicated crate for this, and have almost all the platforms supported. If you want it to be merged into |
And this PR merges the entirety of your extattr crate into Nix? Are you intending to shut down the other one? |
I have no strong view on this, it depends on if
If |
Ok, but I don't have time to review it now. Postponing to the next release. |
I just got back around to reviewing this, because I'm going to make a new release soon. I looked at your extattr crate, and I like it. In fact, I think I have another project that could benefit from it. However, Nix, as you may have noticed, has been getting rather bloated. And since you've already got this stuff wrapped up in a neatly self-contained crate, I propose that we keep it there rather than merge into Nix. Do you agree with that? |
Happy to hear that there will be a new release!
Yeah, Nix is indeed some kind of bloated, so i am ok with this proposal, I will close this PR. |
What this PR does:
This PR adds
listxattr
,getxattr
,setxattr
,removexattr
and their variants on Linux and Androidman pages
What about other platforms
NetBSD
should also be added in this PR, but their currentlibc
bindings are wrong.Update: I just found that
NetBSD
has another collection ofxattr
APIs, which is compatible withFreeBSD
, and thelibc
bindings are added in libc#1114. Then I prefer to put these two BSD OSes together.Module
These APIs are placed in
sys/xattr.rs
Tests
Tests are placed in
test/sys/test-xattr.rs
. Symbolic link versions of APIs are not covered.In the tests, temporary directory are created in the current working directory instead of under
/tmp
, this is needed because we need to testuser
EA,tmpfs
does not support this, see this answer.