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

WIP: cloexec constants #58

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gen/const/Fcntl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def gen_fcntl_java(options)
F_WRLCK
F_ALLOCATECONTIG
F_ALLOCATEALL
F_DUPFD_CLOEXEC
FD_CLOEXEC
]
consts.each { |c| cg.const c }
end
Expand Down
2 changes: 2 additions & 0 deletions gen/const/OpenFlags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def gen_openflags_java(options)
O_NOCTTY
O_TMPFILE
O_CLOEXEC
O_NOINHERIT
O_NDELAY
]
consts.each { |c| cg.const c }
end
Expand Down
1 change: 1 addition & 0 deletions gen/const/Sock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def gen_sock_java(options)
SOCK_RDM
SOCK_SEQPACKET
SOCK_MAXADDRLEN
SOCK_CLOEXEC
].each {|c| cg.const c}
end
end
8 changes: 6 additions & 2 deletions src/main/java/jnr/constants/platform/linux/Fcntl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// WARNING: This file is autogenerated. DO NOT EDIT!
// Generated 2018-09-20 16:28:33 +0000
// Generated 2018-09-21 14:31:00 +0200
package jnr.constants.platform.linux;
public enum Fcntl implements jnr.constants.Constant {
FAPPEND(1024L),
Expand Down Expand Up @@ -38,9 +38,11 @@ public enum Fcntl implements jnr.constants.Constant {
// F_MARKDEPENDENCY not defined
F_RDLCK(0L),
F_UNLCK(2L),
F_WRLCK(1L);
F_WRLCK(1L),
// F_ALLOCATECONTIG not defined
// F_ALLOCATEALL not defined
F_DUPFD_CLOEXEC(1030L),
FD_CLOEXEC(1L);
private final long value;
private Fcntl(long value) { this.value = value; }
public static final long MIN_VALUE = 0L;
Expand Down Expand Up @@ -68,6 +70,8 @@ public static final java.util.Map<Fcntl, String> generateTable() {
map.put(F_RDLCK, "F_RDLCK");
map.put(F_UNLCK, "F_UNLCK");
map.put(F_WRLCK, "F_WRLCK");
map.put(F_DUPFD_CLOEXEC, "F_DUPFD_CLOEXEC");
map.put(FD_CLOEXEC, "FD_CLOEXEC");
return map;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/jnr/constants/platform/linux/OpenFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// WARNING: This file is autogenerated. DO NOT EDIT!
// Generated 2018-09-20 16:28:34 +0000
// Generated 2018-09-21 14:31:01 +0200
package jnr.constants.platform.linux;
public enum OpenFlags implements jnr.constants.Constant {
O_RDONLY(0L),
Expand All @@ -23,7 +23,9 @@ public enum OpenFlags implements jnr.constants.Constant {
// O_BINARY not defined
O_NOCTTY(256L),
O_TMPFILE(4259840L),
O_CLOEXEC(524288L);
O_CLOEXEC(524288L),
// O_NOINHERIT not defined
O_NDELAY(2048L);
private final long value;
private OpenFlags(long value) { this.value = value; }
public static final long MIN_VALUE = 0L;
Expand All @@ -50,6 +52,7 @@ public static final java.util.Map<OpenFlags, String> generateTable() {
map.put(O_NOCTTY, "O_NOCTTY");
map.put(O_TMPFILE, "O_TMPFILE");
map.put(O_CLOEXEC, "O_CLOEXEC");
map.put(O_NDELAY, "O_NDELAY");
return map;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/jnr/constants/platform/linux/Sock.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// WARNING: This file is autogenerated. DO NOT EDIT!
// Generated 2018-09-20 16:28:33 +0000
// Generated 2018-09-21 14:38:46 +0200
package jnr.constants.platform.linux;
public enum Sock implements jnr.constants.Constant {
SOCK_STREAM(1L),
SOCK_DGRAM(2L),
SOCK_RAW(3L),
SOCK_RDM(4L),
SOCK_SEQPACKET(5L);
SOCK_SEQPACKET(5L),
// SOCK_MAXADDRLEN not defined
SOCK_CLOEXEC(524288L);
private final long value;
private Sock(long value) { this.value = value; }
public static final long MIN_VALUE = 1L;
public static final long MAX_VALUE = 5L;
public static final long MAX_VALUE = 524288L;

static final class StringTable {
public static final java.util.Map<Sock, String> descriptions = generateTable();
Expand All @@ -22,6 +23,7 @@ public static final java.util.Map<Sock, String> generateTable() {
map.put(SOCK_RAW, "SOCK_RAW");
map.put(SOCK_RDM, "SOCK_RDM");
map.put(SOCK_SEQPACKET, "SOCK_SEQPACKET");
map.put(SOCK_CLOEXEC, "SOCK_CLOEXEC");
return map;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/jnr/constants/platform/windows/OpenFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// WARNING: This file is autogenerated. DO NOT EDIT!
// Generated 2018-09-20 19:03:24 +0200
// Generated 2018-09-21 14:42:07 +0200
package jnr.constants.platform.windows;
public enum OpenFlags implements jnr.constants.Constant {
O_RDONLY(0L),
Expand All @@ -20,10 +20,12 @@ public enum OpenFlags implements jnr.constants.Constant {
// O_EVTONLY not defined
// O_DIRECTORY not defined
// O_SYMLINK not defined
O_BINARY(32768L);
O_BINARY(32768L),
// O_NOCTTY not defined
// O_TMPFILE not defined
// O_CLOEXEC not defined
O_NOINHERIT(128L);
// O_NDELAY not defined
private final long value;
private OpenFlags(long value) { this.value = value; }
public static final long MIN_VALUE = 0L;
Expand All @@ -42,6 +44,7 @@ public static final java.util.Map<OpenFlags, String> generateTable() {
map.put(O_TRUNC, "O_TRUNC");
map.put(O_EXCL, "O_EXCL");
map.put(O_BINARY, "O_BINARY");
map.put(O_NOINHERIT, "O_NOINHERIT");
return map;
}
}
Expand Down