diff options
author | Narayan Kamath <narayan@google.com> | 2015-01-16 18:52:52 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2015-01-19 16:15:25 +0000 |
commit | 30c669166d86d0bd133edfb67909665fb41d29b6 (patch) | |
tree | 244ca599b086f9c70508996020a6cabbae916812 | |
parent | 9169032f055cb8f007fcb9df979518177e22c833 (diff) | |
download | libcore-30c669166d86d0bd133edfb67909665fb41d29b6.zip libcore-30c669166d86d0bd133edfb67909665fb41d29b6.tar.gz libcore-30c669166d86d0bd133edfb67909665fb41d29b6.tar.bz2 |
Remove fcntlLong, use fcntlInt for F_SETFD instead.
fcntlLong works too, but only because of the syscall conventions
happen to place the lower 32 bits of our jlong in the right register.
This change also gets rid of fcntlLong because there aren't any
documented fcntl calls that take a 64 bit integer argument.
Change-Id: I8d187d5b906195fc663675a07a5f116dcd210d16
-rw-r--r-- | luni/src/main/java/android/system/Os.java | 1 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/ForwardingOs.java | 1 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/IoUtils.java | 2 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/Os.java | 1 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/Posix.java | 1 | ||||
-rw-r--r-- | luni/src/main/native/libcore_io_Posix.cpp | 6 |
6 files changed, 1 insertions, 11 deletions
diff --git a/luni/src/main/java/android/system/Os.java b/luni/src/main/java/android/system/Os.java index 73b999a..8028f23 100644 --- a/luni/src/main/java/android/system/Os.java +++ b/luni/src/main/java/android/system/Os.java @@ -111,7 +111,6 @@ public final class Os { /** @hide */ public static int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException { return Libcore.os.fcntlFlock(fd, cmd, arg); } /** @hide */ public static int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException { return Libcore.os.fcntlInt(fd, cmd, arg); } - /** @hide */ public static int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException { return Libcore.os.fcntlLong(fd, cmd, arg); } /** @hide */ public static int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException { return Libcore.os.fcntlVoid(fd, cmd); } /** diff --git a/luni/src/main/java/libcore/io/ForwardingOs.java b/luni/src/main/java/libcore/io/ForwardingOs.java index caa7218..5c90757 100644 --- a/luni/src/main/java/libcore/io/ForwardingOs.java +++ b/luni/src/main/java/libcore/io/ForwardingOs.java @@ -67,7 +67,6 @@ public class ForwardingOs implements Os { public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { os.fchown(fd, uid, gid); } public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException { return os.fcntlFlock(fd, cmd, arg); } public int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException { return os.fcntlInt(fd, cmd, arg); } - public int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException { return os.fcntlLong(fd, cmd, arg); } public int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException { return os.fcntlVoid(fd, cmd); } public void fdatasync(FileDescriptor fd) throws ErrnoException { os.fdatasync(fd); } public StructStat fstat(FileDescriptor fd) throws ErrnoException { return os.fstat(fd); } diff --git a/luni/src/main/java/libcore/io/IoUtils.java b/luni/src/main/java/libcore/io/IoUtils.java index 737ceeb..b01759d 100644 --- a/luni/src/main/java/libcore/io/IoUtils.java +++ b/luni/src/main/java/libcore/io/IoUtils.java @@ -94,7 +94,7 @@ public final class IoUtils { } else { flags &= ~O_NONBLOCK; } - Libcore.os.fcntlLong(fd, F_SETFL, flags); + Libcore.os.fcntlInt(fd, F_SETFL, flags); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } diff --git a/luni/src/main/java/libcore/io/Os.java b/luni/src/main/java/libcore/io/Os.java index 15d0744..620af19 100644 --- a/luni/src/main/java/libcore/io/Os.java +++ b/luni/src/main/java/libcore/io/Os.java @@ -58,7 +58,6 @@ public interface Os { public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException; public int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException; - public int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException; public int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException; public void fdatasync(FileDescriptor fd) throws ErrnoException; public StructStat fstat(FileDescriptor fd) throws ErrnoException; diff --git a/luni/src/main/java/libcore/io/Posix.java b/luni/src/main/java/libcore/io/Posix.java index 3575256..2629553 100644 --- a/luni/src/main/java/libcore/io/Posix.java +++ b/luni/src/main/java/libcore/io/Posix.java @@ -61,7 +61,6 @@ public final class Posix implements Os { public native void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; public native int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException; public native int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException; - public native int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException; public native int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException; public native void fdatasync(FileDescriptor fd) throws ErrnoException; public native StructStat fstat(FileDescriptor fd) throws ErrnoException; diff --git a/luni/src/main/native/libcore_io_Posix.cpp b/luni/src/main/native/libcore_io_Posix.cpp index adb1f3b..4c7e372 100644 --- a/luni/src/main/native/libcore_io_Posix.cpp +++ b/luni/src/main/native/libcore_io_Posix.cpp @@ -609,11 +609,6 @@ static jint Posix_fcntlInt(JNIEnv* env, jobject, jobject javaFd, jint cmd, jint return throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd, arg))); } -static jint Posix_fcntlLong(JNIEnv* env, jobject, jobject javaFd, jint cmd, jlong arg) { - int fd = jniGetFDFromFileDescriptor(env, javaFd); - return throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd, arg))); -} - static jint Posix_fcntlVoid(JNIEnv* env, jobject, jobject javaFd, jint cmd) { int fd = jniGetFDFromFileDescriptor(env, javaFd); return throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd))); @@ -1610,7 +1605,6 @@ static JNINativeMethod gMethods[] = { NATIVE_METHOD(Posix, fchown, "(Ljava/io/FileDescriptor;II)V"), NATIVE_METHOD(Posix, fcntlFlock, "(Ljava/io/FileDescriptor;ILandroid/system/StructFlock;)I"), NATIVE_METHOD(Posix, fcntlInt, "(Ljava/io/FileDescriptor;II)I"), - NATIVE_METHOD(Posix, fcntlLong, "(Ljava/io/FileDescriptor;IJ)I"), NATIVE_METHOD(Posix, fcntlVoid, "(Ljava/io/FileDescriptor;I)I"), NATIVE_METHOD(Posix, fdatasync, "(Ljava/io/FileDescriptor;)V"), NATIVE_METHOD(Posix, fstat, "(Ljava/io/FileDescriptor;)Landroid/system/StructStat;"), |