Skip to content

Commit 4e88709

Browse files
Merge branch 'upstream-pr-1021'
2 parents b7964f1 + bd184d5 commit 4e88709

4 files changed

Lines changed: 827 additions & 0 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Features
99
--------
1010
* [#1029](https://github.com/java-native-access/jna/issues/1029): Add `statvfs` to `c.s.j.platform.linux.LibC` - [@dbwiddis](https://github.com/dbwiddis).
1111
* [#1032](https://github.com/java-native-access/jna/pull/1032): Deprecate `c.s.j.platform.win32.COM.util.annotation.ComEventCallback` in favour of `c.s.j.platform.win32.COM.util.annotation.ComMethod` - [@matthiasblaesing](https://github.com/matthiasblaesing).
12+
* [#1021](https://github.com/java-native-access/jna/pull/1021): Added `com.sun.jna.platform.linux.XAttr` and `com.sun.jna.platform.linux.XAttrUtil` JNA wrapper for `<sys/xattr.h>` for Linux - [@wilx](https://github.com/wilx).
1213

1314
Bug Fixes
1415
---------
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright (c) 2018 Václav Haisman, All Rights Reserved
3+
*
4+
* The contents of this file is dual-licensed under 2
5+
* alternative Open Source/Free licenses: LGPL 2.1 or later and
6+
* Apache License 2.0.
7+
*
8+
* You can freely decide which license you want to apply to
9+
* the project.
10+
*
11+
* You may obtain a copy of the LGPL License at:
12+
*
13+
* http://www.gnu.org/licenses/licenses.html
14+
*
15+
* A copy is also included in the downloadable source code package
16+
* containing JNA, in file "LGPL2.1".
17+
*
18+
* You may obtain a copy of the Apache License at:
19+
*
20+
* http://www.apache.org/licenses/
21+
*
22+
* A copy is also included in the downloadable source code package
23+
* containing JNA, in file "AL2.0".
24+
*/
25+
package com.sun.jna.platform.linux;
26+
27+
import com.sun.jna.IntegerType;
28+
import com.sun.jna.Library;
29+
import com.sun.jna.Native;
30+
import com.sun.jna.Pointer;
31+
32+
public interface XAttr extends Library {
33+
XAttr INSTANCE = Native.load(XAttr.class);
34+
35+
class size_t extends IntegerType {
36+
public static final size_t ZERO = new size_t();
37+
38+
private static final long serialVersionUID = 1L;
39+
40+
public size_t() { this(0); }
41+
public size_t(long value) { super(Native.SIZE_T_SIZE, value, true); }
42+
}
43+
44+
class ssize_t extends IntegerType {
45+
public static final ssize_t ZERO = new ssize_t();
46+
47+
private static final long serialVersionUID = 1L;
48+
49+
public ssize_t() {
50+
this(0);
51+
}
52+
53+
public ssize_t(long value) {
54+
super(Native.SIZE_T_SIZE, value, false);
55+
}
56+
}
57+
58+
int XATTR_CREATE = 1;
59+
int XATTR_REPLACE = 2;
60+
61+
int EPERM = 1;
62+
int E2BIG = 7;
63+
int EEXIST = 17;
64+
int ENOSPC = 28;
65+
int ERANGE = 34;
66+
int ENODATA = 61;
67+
int ENOATTR = ENODATA;
68+
int ENOTSUP = 95;
69+
int EDQUOT = 122;
70+
71+
int setxattr(String path, String name, Pointer value, size_t size, int flags);
72+
int setxattr(String path, String name, byte[] value, size_t size, int flags);
73+
int lsetxattr(String path, String name, Pointer value, size_t size, int flags);
74+
int lsetxattr(String path, String name, byte[] value, size_t size, int flags);
75+
int fsetxattr(int fd, String name, Pointer value, size_t size, int flags);
76+
int fsetxattr(int fd, String name, byte[] value, size_t size, int flags);
77+
78+
ssize_t getxattr(String path, String name, Pointer value, size_t size);
79+
ssize_t getxattr(String path, String name, byte[] value, size_t size);
80+
ssize_t lgetxattr(String path, String name, Pointer value, size_t size);
81+
ssize_t lgetxattr(String path, String name, byte[] value, size_t size);
82+
ssize_t fgetxattr(int fd, String name, Pointer value, size_t size);
83+
ssize_t fgetxattr(int fd, String name, byte[] value, size_t size);
84+
85+
ssize_t listxattr(String path, Pointer list, size_t size);
86+
ssize_t listxattr(String path, byte[] list, size_t size);
87+
ssize_t llistxattr(String path, Pointer list, size_t size);
88+
ssize_t llistxattr(String path, byte[] list, size_t size);
89+
ssize_t flistxattr(int fd, Pointer list, size_t size);
90+
ssize_t flistxattr(int fd, byte[] list, size_t size);
91+
92+
int removexattr(String path, String name);
93+
int lremovexattr(String path, String name);
94+
int fremovexattr(int fd, String name);
95+
}

0 commit comments

Comments
 (0)