Posix.java revision 41f0605d2c809bd9bc1c0fb68d86b49a0f59b6c5
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package libcore.io;
18
19import java.io.FileDescriptor;
20
21public final class Posix implements Os {
22    Posix() { }
23
24    public native boolean access(String path, int mode) throws ErrnoException;
25    public native void chmod(String path, int mode) throws ErrnoException;
26    public native String[] environ();
27    public native void fdatasync(FileDescriptor fd) throws ErrnoException;
28    public native StructStat fstat(FileDescriptor fd) throws ErrnoException;
29    public native StructStatFs fstatfs(FileDescriptor fd) throws ErrnoException;
30    public native void fsync(FileDescriptor fd) throws ErrnoException;
31    public native void ftruncate(FileDescriptor fd, long length) throws ErrnoException;
32    public native String getenv(String name);
33    public native boolean isatty(FileDescriptor fd);
34    public native long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException;
35    public native void mincore(long address, long byteCount, byte[] vector) throws ErrnoException;
36    public native void mkdir(String path, int mode) throws ErrnoException;
37    public native void mlock(long address, long byteCount) throws ErrnoException;
38    public native long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException;
39    public native void msync(long address, long byteCount, int flags) throws ErrnoException;
40    public native void munlock(long address, long byteCount) throws ErrnoException;
41    public native void munmap(long address, long byteCount) throws ErrnoException;
42    public native FileDescriptor open(String path, int flags, int mode) throws ErrnoException;
43    public native FileDescriptor[] pipe() throws ErrnoException;
44    public native StructStat lstat(String path) throws ErrnoException;
45    public native void remove(String path) throws ErrnoException;
46    public native void rename(String oldPath, String newPath) throws ErrnoException;
47    public native StructStat stat(String path) throws ErrnoException;
48    public native StructStatFs statfs(String path) throws ErrnoException;
49    public native String strerror(int errno);
50    public native void symlink(String oldPath, String newPath) throws ErrnoException;
51    public native long sysconf(int name);
52}
53