Skip to content

Commit 2372067

Browse files
Merge pull request #1517 from rdfrota/feature/add_remaining_O_bits_fcntl_header
Adding remaining O_ bits to be used with posix queues.
2 parents aff2e35 + 4561a88 commit 2372067

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Diff for: CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Features
1111
* [#1544](https://github.com/java-native-access/jna/pull/1544): Add `GetPriorityClass`, `SetPriorityClass`, `GetThreadPriority`, `SetThreadPriority` and associated constants to `c.s.j.p.win32.Kernel32` - [@dEajL3kA](https://github.com/dEajL3kA).
1212
* [#1548](https://github.com/java-native-access/jna/pull/1548): Make interface `c.s.j.p.mac.XAttr public` - [@matthiasblaesing](https://github.com/matthiasblaesing).
1313
* [#1551](https://github.com/java-native-access/jna/pull/1551): Add `c.s.j.p.bsd.ExtAttr` and `c.s.j.p.bsd.ExtAttrUtil` to wrap BSD [<sys/extattr.h>](https://man.freebsd.org/cgi/man.cgi?query=extattr&sektion=2) system calls. [@rednoah](https://github.com/rednoah).
14+
* [#1517](https://github.com/java-native-access/jna/pull/1517): Add missing `O_*` (e.g. `O_APPEND`, `O_SYNC`, `O_DIRECT`, ...) to `c.s.j.p.linux.Fcntl` - [@matthiasblaesing](https://github.com/matthiasblaesing).
1415

1516
Bug Fixes
1617
---------

Diff for: contrib/platform/src/com/sun/jna/platform/linux/Fcntl.java

+20-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,26 @@ public interface Fcntl {
3838
* Bits OR'd into the second argument to open. Note these are defined
3939
* differently on linux than unix fcntl header
4040
*/
41-
int O_CREAT = 0100; // Create file if it doesn't exist.
42-
int O_EXCL = 0200; // Fail if file already exists.
43-
int O_TRUNC = 01000; // Truncate file to zero length.
41+
int O_CREAT = 000000100; // Create file if it doesn't exist.
42+
int O_EXCL = 000000200; // Fail if file already exists.
43+
int O_TRUNC = 000001000; // Truncate file to zero length.
44+
int O_APPEND = 000002000;
45+
int O_NONBLOCK = 000004000;
46+
int O_DSYNC = 000010000;
47+
int O_FASYNC = 000020000;
48+
int O_DIRECT = 000040000;
49+
int O_LARGEFILE = 000100000;
50+
int O_DIRECTORY = 000200000;
51+
int O_NOFOLLOW = 000400000;
52+
int O_NOATIME = 001000000;
53+
int O_CLOEXEC = 002000000;
54+
int __O_SYNC = 004000000;
55+
int O_PATH = 010000000;
56+
int __O_TMPFILE = 020000000;
57+
58+
int O_SYNC = (__O_SYNC | O_DSYNC);
59+
int O_TMPFILE = (__O_TMPFILE | O_DIRECTORY);
60+
int O_NDELAY = O_NONBLOCK;
4461

4562
/* Protection bits. */
4663
int S_IRUSR = 00400; // Read by owner.

0 commit comments

Comments
 (0)