Skip to content

Commit

Permalink
[Truffle] Add IO#fsync.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed May 15, 2015
1 parent 617ce76 commit 3e7efef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/io/fsync_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/io/write_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:IO#write on a file writes all of the string's bytes but buffers them
fails(windows):IO#write on Windows normalizes line endings in text mode
fails(windows):IO#write on Windows does not normalize line endings in binary mode
fails:IO.write on a FIFO writes correctly
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ public int fchmod(int one, int mode) {
}


@CoreMethod(names = "fsync", isModuleFunction = true, required = 1)
public abstract static class FsyncNode extends CoreMethodArrayArgumentsNode {

public FsyncNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@Specialization
public int fsync(int descriptor) {
return posix().fsync(descriptor);
}

}


@CoreMethod(names = "fchown", isModuleFunction = true, required = 3)
public abstract static class FchownNode extends CoreMethodArrayArgumentsNode {

Expand Down

0 comments on commit 3e7efef

Please sign in to comment.