Skip to content
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

Adding remaining O_ bits to be used with posix queues. #1517

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Features
* [#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).
* [#1548](https://github.com/java-native-access/jna/pull/1548): Make interface `c.s.j.p.mac.XAttr public` - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#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).
* [#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).

Bug Fixes
---------
Expand Down
23 changes: 20 additions & 3 deletions contrib/platform/src/com/sun/jna/platform/linux/Fcntl.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,26 @@ public interface Fcntl {
* Bits OR'd into the second argument to open. Note these are defined
* differently on linux than unix fcntl header
*/
int O_CREAT = 0100; // Create file if it doesn't exist.
int O_EXCL = 0200; // Fail if file already exists.
int O_TRUNC = 01000; // Truncate file to zero length.
int O_CREAT = 000000100; // Create file if it doesn't exist.
int O_EXCL = 000000200; // Fail if file already exists.
int O_TRUNC = 000001000; // Truncate file to zero length.
int O_APPEND = 000002000;
int O_NONBLOCK = 000004000;
int O_DSYNC = 000010000;
int O_FASYNC = 000020000;
int O_DIRECT = 000040000;
int O_LARGEFILE = 000100000;
int O_DIRECTORY = 000200000;
int O_NOFOLLOW = 000400000;
int O_NOATIME = 001000000;
int O_CLOEXEC = 002000000;
int __O_SYNC = 004000000;
int O_PATH = 010000000;
int __O_TMPFILE = 020000000;

int O_SYNC = (__O_SYNC | O_DSYNC);
int O_TMPFILE = (__O_TMPFILE | O_DIRECTORY);
int O_NDELAY = O_NONBLOCK;

/* Protection bits. */
int S_IRUSR = 00400; // Read by owner.
Expand Down