-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Parsing errno.h for error codes. #1024
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
Comments
This can be closed as |
Except for the fact that the http://www.ioplex.com/~miallen/errcmp.html |
Fair point as it seems BSD-derived systems differ from Linux. However, this specific Issue mentioned Linux, and the mapped headers are in the Linux platform mappings. More generally, this issue suggests run-time parsing of a |
I agree that the parsing of the header files doesn't really look viable - I just came over this while trying to find a way to get the correct integer values for the different platforms. I don't see any easy way to do that though, so I just I will just have to hard-code the only the error codes I need and use the I know too little about how the JNI part works, but maybe it would be possible to "capture" the error codes in |
A reasonable approach.
In general, faithfully reporting the numeric error code to the user is all that is needed. In predictable situations in widely used operating systems it is reasonable to make a best effort attempt to translate the numeric code to a meaningful value. Windows provides an actual API ( However, the constant names in the It seems reasonable to try to map that (or |
I agree that The use I'm after is different, it is using these constants for evaluation in the code itself. This might not be very relevant for many of the errors, I don't know enough about many of them. In my case, POSIX only defines the names of the constants and defines that they should have a positive I would normally gladly make a PR for |
For the work on Linux extended file attributes support I needed few standard error codes. I looked them up manually but I was curious if it were possible to do it automatically. I have come up with what is committed in repository https://github.com/wilx/parse-linux-libc-error-codes. I am just offering it as a POC of something that might be useful to JNA project to generate a list of error codes.
The text was updated successfully, but these errors were encountered: