Os.java revision 78c7cc547101002b9f9043cf3845970719d1bda8
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;
20import java.nio.ByteBuffer;
21
22public interface Os {
23    public boolean access(String path, int mode) throws ErrnoException;
24    public void chmod(String path, int mode) throws ErrnoException;
25    public String[] environ();
26    public int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException;
27    public int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException;
28    public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException;
29    public void fdatasync(FileDescriptor fd) throws ErrnoException;
30    public StructStat fstat(FileDescriptor fd) throws ErrnoException;
31    public StructStatFs fstatfs(FileDescriptor fd) throws ErrnoException;
32    public void fsync(FileDescriptor fd) throws ErrnoException;
33    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException;
34    public String getenv(String name);
35    public boolean isatty(FileDescriptor fd);
36    public void listen(FileDescriptor fd, int backlog) throws ErrnoException;
37    public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException;
38    public void mincore(long address, long byteCount, byte[] vector) throws ErrnoException;
39    public void mkdir(String path, int mode) throws ErrnoException;
40    public void mlock(long address, long byteCount) throws ErrnoException;
41    public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException;
42    public void msync(long address, long byteCount, int flags) throws ErrnoException;
43    public void munlock(long address, long byteCount) throws ErrnoException;
44    public void munmap(long address, long byteCount) throws ErrnoException;
45    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException;
46    public FileDescriptor[] pipe() throws ErrnoException;
47    public StructStat lstat(String path) throws ErrnoException;
48    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException;
49    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
50    public void remove(String path) throws ErrnoException;
51    public void rename(String oldPath, String newPath) throws ErrnoException;
52    public void shutdown(FileDescriptor fd, int how) throws ErrnoException;
53    public StructStat stat(String path) throws ErrnoException;
54    public StructStatFs statfs(String path) throws ErrnoException;
55    public String strerror(int errno);
56    public void symlink(String oldPath, String newPath) throws ErrnoException;
57    public long sysconf(int name);
58    public StructUtsname uname() throws ErrnoException;
59    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException;
60    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
61}
62