Skip to content

Commit

Permalink
[Truffle] Add File.{rdev_major,rdev_minor}
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed May 2, 2015
1 parent 5aab309 commit 39e7dcf
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 10 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/blksize_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/blocks_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/dev_major_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/dev_minor_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/dev_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/file/stat/grpowned_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fails:File::Stat#grpowned? takes non primary groups into account
fails(windows):File::Stat#grpowned? returns false if the file exist
fails:File::Stat#grpowned? returns true if the file exist
fails:File::Stat#grpowned? accepts an object that has a #to_path method
1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/ino_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/rdev_major_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/file/stat/rdev_minor_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,34 @@ public int flock(int fd, int constant) {

}

@CoreMethod(names = "major", isModuleFunction = true, required = 1, lowerFixnumParameters = 0)
public abstract static class MajorNode extends CoreMethodArrayArgumentsNode {

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

@Specialization
public int major(int dev) {
return (dev >> 24) & 255;
}

}

@CoreMethod(names = "minor", isModuleFunction = true, required = 1, lowerFixnumParameters = 0)
public abstract static class MinorNode extends CoreMethodArrayArgumentsNode {

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

@Specialization
public int minor(int dev) {
return (dev & 16777215);
}

}

@CoreMethod(names = "rmdir", isModuleFunction = true, required = 1)
public abstract static class RmdirNode extends PointerPrimitiveNodes.ReadAddressPrimitiveNode {

Expand Down

0 comments on commit 39e7dcf

Please sign in to comment.