{"record":{"id":"73a0a51e767f50ad","repo":"java-native-access/jna","slug":"errno-eno","errorCode":null,"errorMessage":"errno: \" + eno","messagePattern":"errno: \" \\+ eno","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"contrib/platform/src/com/sun/jna/platform/linux/XAttrUtil.java","lineNumber":85,"sourceCode":"     */\n    public static void setXAttr(String path, String name, String value, String encoding)\n        throws IOException {\n        setXAttr(path, name, value.getBytes(encoding));\n    }\n\n    /**\n     * Set or replace value of extended attribute.\n     *\n     * @param path  file path\n     * @param name  extended attribute name\n     * @param value value to set\n     * @throws IOException on any error\n     */\n    public static void setXAttr(String path, String name, byte[] value) throws IOException {\n        int retval = XAttr.INSTANCE.setxattr(path, name, value, new size_t(value.length), 0);\n        if (retval != 0) {\n            final int eno = Native.getLastError();\n            throw new IOException(\"errno: \" + eno);\n        }\n    }\n\n\n    /**\n     * Set or replace value of extended attribute but in case of symbolic link set the extended\n     * attribute on the link itself instead linked file.\n     *\n     * @param path  file path\n     * @param name  extended attribute name\n     * @param value value to set\n     * @throws IOException on any error\n     */\n    public static void lSetXAttr(String path, String name, String value) throws IOException {\n        lSetXAttr(path, name, value, Native.getDefaultStringEncoding());\n    }\n\n    /**","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/java-native-access/jna/blob/d036ad9781adad4b66693e8fa7098e4ac665e0a3/contrib/platform/src/com/sun/jna/platform/linux/XAttrUtil.java#L67-L103","documentation":"Generic errno sentinel thrown when the Linux setxattr(2) call returns a negative value while setting an extended attribute. The appended errno identifies the cause — ENOENT (path or attribute namespace wrong), EPERM/EACCES (file not owned or filesystem mounted without user_xattr), ENOTSUP/ENOSPC (filesystem does not support xattrs or quota exceeded).","triggerScenarios":"Thrown at contrib/platform/src/com/sun/jna/platform/linux/XAttrUtil.java:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Map the errno: 1 = EPERM (own the file or use CAP_FOWNER), 95 = ENOTSUP (remount with user_xattr or use a supporting fs like ext4/xfs), 2 = ENOENT (verify path)","Prefix attribute names with 'user.' — most filesystems only allow the user namespace for unprivileged callers","Free disk/inode space if errno indicates ENOSPC"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d036ad9781adad4b66693e8fa7098e4ac665e0a3","analyzedAt":"2026-09-12T06:50:59.239Z","contentChangedAt":"2026-09-12T06:50:59.239Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}