Permalink
Browse files

Added support for command FILE_FADVISE, which is implemented as a NO-…

…OP. See erlang/otp@21a67b7#erts/emulator/drivers/common/efile_drv.c for the corresponding commit in Erlang/OTP.
  • Loading branch information...
1 parent 39a4942 commit 5f9799211bdfa5c6ba6ae33c5f7523f77564bddc @jetztgradnet jetztgradnet committed Jul 10, 2011
Showing with 18 additions and 0 deletions.
  1. +17 −0 src/main/java/erjang/driver/efile/EFile.java
  2. +1 −0 src/main/java/erjang/driver/ram_file/RamFile.java
@@ -346,6 +346,8 @@ public void deq_free_size() {
public static final int FILE_ALTNAME = 28;
public static final int FILE_READ_LINE = 29;
public static final int FILE_FDATASYNC = 30;
+ public static final int FILE_FADVISE = 31;
+
/* Return codes */
@@ -374,6 +376,14 @@ public void deq_free_size() {
/* IPREAD variants */
public static final int IPREAD_S32BU_P32BU = 0;
+
+ /* POSIX file advises */
+ public static final int POSIX_FADV_NORMAL = 0;
+ public static final int POSIX_FADV_RANDOM = 1;
+ public static final int POSIX_FADV_SEQUENTIAL = 2;
+ public static final int POSIX_FADV_WILLNEED = 3;
+ public static final int POSIX_FADV_DONTNEED = 4;
+ public static final int POSIX_FADV_NOREUSE = 5;
/* Limits */
@@ -1697,6 +1707,13 @@ public void run() {
break;
}
+ case FILE_FADVISE: {
+ // fadvice() is not available from Java,
+ // so we simply ignore it and return success
+ reply_ok();
+ return;
+ }
+
case FILE_SETOPT: {
reply_ok();
return;
@@ -77,6 +77,7 @@
public static final int RAM_FILE_UUENCODE = 35;
public static final int RAM_FILE_UUDECODE = 36;
public static final int RAM_FILE_SIZE = 37;
+ public static final int RAM_FILE_ADVISE = 38;
private static final byte[] FILE_RESP_NUMBER_HEADER = new byte[]{ FILE_RESP_NUMBER };

0 comments on commit 5f97992

Please sign in to comment.