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
Remove/deprecate ENOATTR from Linux and Android #1356
Comments
It appears that the header The header that one should use is |
It appears to be in older copies of the man pages, like https://linux.die.net/man/2/getxattr
In case that gets updated too, here's an archive.org link: https://web.archive.org/web/20160808193900/http://linux.die.net/man/2/getxattr As per https://mail-index.netbsd.org/tech-kern/2012/04/30/msg013090.html which is also outdated but mostly correct, here's platform behavior:
Notice that if you define ENOATTR as a synonym for ENODATA on Linux with attr/xattr.h as was done previously, then you can use ENOATTR on any platform, which is what I was doing in my code. My code isn't working and hasn't been touched for a while, so you don't need to worry about breaking that. I think ENOATTR still makes sense for writing cross platform code, but I also agree that it doesn't belong here since Linux seems to have gotten rid of it. I'm not sure if anyone else is using it, it is rather niche, but if we're going to get rid of it we might as well deprecate it first I think. |
FYI if you need a portable wrapper over The problem with adding Second, if we change the value, we'd break old code that uses it as a synonym of
This makes sense. |
Makes sense. I'm fine with deprecating or removing it. 👍 |
This constant doesn't exist on Linux, but it does exist on FreeBSD and probably other systems in the BSD clade, and it's actually quite important. Suppose you want to remove an extended attribute from a file and ignore the error that you get when the attribute doesn't exist. Suppose further that you are using the
but this throws deprecation errors on Linux. :-( Absent any changes to either the stdlib or the xattr crate, how would you write this so it works on both Linux and *BSD and is future-proof? |
The
ENOATTR
attribute is not shipped with any system headers on these platforms. This was raised in #594 as the main argument not to add this for Linux. There was a comment that claimed that this attribute is mentioned in the man pages ofsetxattr
andgetxattr
but I don't find any mention ofENOATTR
there anymore =/Then #1030 came along and added the attribute for Android, but this is not available there either AFAICT, and I can't find it on any documentation.
Go rejected adding
ENOATTR
from their syscall package for this reason: golang/go#753cc @alexcrichton @mati865 @PlasmaPower
The text was updated successfully, but these errors were encountered: