/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Unix system and library calls.
*/
class UnixNativeDispatcher {
protected UnixNativeDispatcher() { }
// returns a NativeBuffer containing the given path
} else {
// buffer already contains the path
return buffer;
}
return buffer;
}
/**
* char *getcwd(char *buf, size_t size);
*/
static native byte[] getcwd();
/**
* int dup(int filedes)
*/
/**
* int open(const char* path, int oflag, mode_t mode)
*/
try {
} finally {
}
}
throws UnixException;
/**
* int openat(int dfd, const char* path, int oflag, mode_t mode)
*/
try {
} finally {
}
}
throws UnixException;
/**
* close(int filedes)
*/
/**
* FILE* fopen(const char *filename, const char* mode);
*/
try {
} finally {
}
}
throws UnixException;
/**
* fclose(FILE* stream)
*/
/**
* link(const char* existing, const char* new)
*/
try {
} finally {
}
}
throws UnixException;
/**
* unlink(const char* path)
*/
try {
} finally {
}
}
/**
* unlinkat(int dfd, const char* path, int flag)
*/
try {
} finally {
}
}
throws UnixException;
/**
* mknod(const char* path, mode_t mode, dev_t dev)
*/
try {
} finally {
}
}
throws UnixException;
/**
* rename(const char* old, const char* new)
*/
try {
} finally {
}
}
throws UnixException;
/**
* renameat(int fromfd, const char* old, int tofd, const char* new)
*/
try {
} finally {
}
}
throws UnixException;
/**
* mkdir(const char* path, mode_t mode)
*/
try {
} finally {
}
}
/**
* rmdir(const char* path)
*/
try {
} finally {
}
}
/**
* readlink(const char* path, char* buf, size_t bufsize)
*
* @return link target
*/
try {
} finally {
}
}
/**
* realpath(const char* path, char* resolved_name)
*
* @return resolved path
*/
try {
} finally {
}
}
/**
* symlink(const char* name1, const char* name2)
*/
try {
} finally {
}
}
throws UnixException;
/**
* stat(const char* path, struct stat* buf)
*/
try {
} finally {
}
}
throws UnixException;
/**
* lstat(const char* path, struct stat* buf)
*/
try {
} finally {
}
}
throws UnixException;
/**
* fstat(int filedes, struct stat* buf)
*/
/**
* fstatat(int filedes,const char* path, struct stat* buf, int flag)
*/
throws UnixException
{
try {
} finally {
}
}
/**
* chown(const char* path, uid_t owner, gid_t group)
*/
try {
} finally {
}
}
throws UnixException;
/**
* lchown(const char* path, uid_t owner, gid_t group)
*/
try {
} finally {
}
}
throws UnixException;
/**
* fchown(int filedes, uid_t owner, gid_t group)
*/
/**
* chmod(const char* path, mode_t mode)
*/
try {
} finally {
}
}
throws UnixException;
/**
* fchmod(int fildes, mode_t mode)
*/
/**
* utimes(conar char* path, const struct timeval times[2])
*/
throws UnixException
{
try {
} finally {
}
}
throws UnixException;
/**
* futimes(int fildes,, const struct timeval times[2])
*/
/**
* DIR *opendir(const char* dirname)
*/
try {
} finally {
}
}
/**
* DIR* fdopendir(int filedes)
*/
/**
* closedir(DIR* dirp)
*/
/**
* struct dirent* readdir(DIR *dirp)
*
* @return dirent->d_name
*/
/**
* size_t read(int fildes, void* buf, size_t nbyte)
*/
/**
* size_t writeint fildes, void* buf, size_t nbyte)
*/
/**
* access(const char* path, int amode);
*/
try {
} finally {
}
}
/**
* struct passwd *getpwuid(uid_t uid);
*
* @return passwd->pw_name
*/
/**
* struct group *getgrgid(gid_t gid);
*
* @return group->gr_name
*/
/**
* struct passwd *getpwnam(const char *name);
*
* @return passwd->pw_uid
*/
try {
} finally {
}
}
/**
* struct group *getgrnam(const char *name);
*
* @return group->gr_name
*/
try {
} finally {
}
}
/**
* statvfs(const char* path, struct statvfs *buf)
*/
throws UnixException
{
try {
} finally {
}
}
throws UnixException;
/**
* long int pathconf(const char *path, int name);
*/
try {
} finally {
}
}
throws UnixException;
/**
* long fpathconf(int fildes, int name);
*/
/**
* char* strerror(int errnum)
*/
// indicates if openat, unlinkat, etc. is supported
private static final boolean hasAtSysCalls;
static boolean supportsAtSysCalls() {
return hasAtSysCalls;
}
static boolean supportsNoFollowLinks() {
}
// initialize syscalls and fieldIDs
private static native int init();
// flags returned by init to indicate capabilities
static {
return null;
}});
}
}