Posix.java revision 0ac77ac8e915bff1a863e371f9b363033f9cf759
19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Copyright (C) 2011 The Android Open Source Project
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
569a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * you may not use this file except in compliance with the License.
669a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * You may obtain a copy of the License at
769a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes *
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
969a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes *
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
1169a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
1269a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1369a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * See the License for the specific language governing permissions and
1469a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes * limitations under the License.
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage libcore.io;
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport java.io.FileDescriptor;
20b8d81679553ee33f6ae5281310abf2effca4ffcdDianne Hackborn
2120cb56e26e91df91bd64d4251222e0d421cdbe47Dianne Hackbornpublic final class Posix implements Os {
22b8d81679553ee33f6ae5281310abf2effca4ffcdDianne Hackborn    Posix() { }
239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native boolean access(String path, int mode) throws ErrnoException;
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native String[] environ();
269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native void fdatasync(FileDescriptor fd) throws ErrnoException;
2769a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes    public native StructStat fstat(FileDescriptor fd) throws ErrnoException;
2869a017bc1d1649350f830dfada5c6ed5eac0b770Elliott Hughes    public native void fsync(FileDescriptor fd) throws ErrnoException;
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native void ftruncate(FileDescriptor fd, long length) throws ErrnoException;
309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native String getenv(String name);
319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native boolean isatty(FileDescriptor fd);
329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException;
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native void mincore(long address, long byteCount, byte[] vector) throws ErrnoException;
34b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4Mathias Agopian    public native void mlock(long address, long byteCount) throws ErrnoException;
35b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4Mathias Agopian    public native long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException;
36a7d1d73a477fe512d9ea69ee2883084630ec24c4Adam Lesinski    public native void msync(long address, long byteCount, int flags) throws ErrnoException;
37b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4Mathias Agopian    public native void munlock(long address, long byteCount) throws ErrnoException;
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native void munmap(long address, long byteCount) throws ErrnoException;
3948d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad    public native FileDescriptor open(String path, int flags, int mode) throws ErrnoException;
4048d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad    public native StructStat lstat(String path) throws ErrnoException;
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public native StructStat stat(String path) throws ErrnoException;
4248d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad    public native String strerror(int errno);
4348d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad    public native long sysconf(int name);
4448d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad}
4548d22323ce39f9aab003dce74456889b6414af55Mårten Kongstad