Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Choose stat() or stat64() correctly on Solaris 10.

Solaris 64 bit only has stat(), 32 bit has stat64() and stat().

Signed-off-by: Wayne Meissner <wmeissner@gmail.com>
  • Loading branch information...
commit 5658dea5ac00796d56006f4f2c9d6093a1b16f80 1 parent 50ff134
@bensummers bensummers authored Wayne Meissner committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main/java/jnr/posix/SolarisPOSIX.java
View
6 src/main/java/jnr/posix/SolarisPOSIX.java
@@ -23,7 +23,7 @@ public FileStat fstat(FileDescriptor fileDescriptor) {
FileStat stat = allocateStat();
int fd = helper.getfd(fileDescriptor);
- if (libc().fstat64(fd, stat) < 0) handler.error(ENOENT, ""+fd);
+ if ((Platform.IS_32_BIT ? libc().fstat64(fd, stat) : libc().fstat(fd, stat)) < 0) handler.error(ENOENT, ""+fd);
return stat;
}
@@ -37,12 +37,12 @@ public int lchmod(String filename, int mode) {
@Override
public int lstat(String path, FileStat stat) {
- return libc().lstat64(path, stat);
+ return Platform.IS_32_BIT ? libc().lstat64(path, stat) : libc().lstat(path, stat);
}
@Override
public int stat(String path, FileStat stat) {
- return libc().stat64(path, stat);
+ return Platform.IS_32_BIT ? libc().stat64(path, stat) : libc().stat(path, stat);
}
Please sign in to comment.
Something went wrong with that request. Please try again.