Skip to content

Commit

Permalink
Added support for command FILE_DATASYNC, which is implemented as syno…
Browse files Browse the repository at this point in the history
…nym to FILE_FSYNC. See erlang/otp@3f53a96#erts/emulator/drivers/common/efile_drv.c for the corresponding commit in Erlang/OTP.
  • Loading branch information
jetztgradnet committed Jul 10, 2011
1 parent d6267f9 commit 39a4942
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/erjang/driver/efile/EFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ public static class Info {
public static final int FILE_IPREAD = 27;
public static final int FILE_ALTNAME = 28;
public static final int FILE_READ_LINE = 29;
public static final int FILE_FDATASYNC = 30;

/* Return codes */

Expand Down Expand Up @@ -1214,7 +1215,7 @@ public boolean accept(File dir, String name) {
@Override
protected void output(EHandle caller, ByteBuffer buf) throws Pausable {
FileAsync d;
byte cmd = buf.get();
final byte cmd = buf.get();
switch (cmd) {

case FILE_TRUNCATE: {
Expand Down Expand Up @@ -1247,13 +1248,14 @@ public void ready() throws Pausable {
};
} break;

case FILE_FDATASYNC:
case FILE_FSYNC: {
d = new FileAsync() {

{
level = 2;
fd = EFile.this.fd;
command = FILE_FSYNC;
command = cmd;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/erjang/driver/ram_file/RamFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class RamFile extends EDriverInstance {
/* Commands like file interface's */
public static final int FILE_PREAD = 17;
public static final int FILE_PWRITE = 18;
public static final int RAM_FILE_FDATASYNC = 19;

/* Special ram_file commands */
public static final int RAM_FILE_GET = 30;
Expand Down

0 comments on commit 39a4942

Please sign in to comment.