APIdia Launch Partner
Top Description Fields Constructors Methods
sun.nio.fs

pack-priv Class UnixNativeDispatcher

extends Object
Class Inheritance
Known Direct Subclasses
sun.nio.fs.LinuxNativeDispatcher
Imports
java.util.function.Function

Unix system and library calls.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
SUPPORTS_OPENAT

Capabilities

private static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
access(UnixPath path, int amode)

access(const char* path, int amode);

private static native int
access0(long pathAddress, int amode)

pack-priv static boolean
birthtimeSupported()

Supports file birth (creation) time attribute

pack-priv static void
chmod(UnixPath path, int mode)

chmod(const char* path, mode_t mode)

private static native void
chmod0(long pathAddress, int mode)

pack-priv static void
chown(UnixPath path, int uid, int gid)

chown(const char* path, uid_t owner, gid_t group)

private static native void
chown0(long pathAddress, int uid, int gid)

pack-priv static void
close(int fd)

close(int filedes).

pack-priv static <X extends Throwable> void
close(int fd, Function<UnixException, X> mapper)

close(fd).

private static native void
close0(int fd)

pack-priv static native void
closedir(long dir)

closedir(DIR* dirp)

pack-priv static NativeBuffer
pack-priv static native int
dup(int filedes)

int dup(int filedes)

pack-priv static void
fchmod(int fd, int mode)

fchmod(int fildes, mode_t mode)

private static native void
fchmod0(int fd, int mode)

pack-priv static void
fchmodat(int fd, UnixPath path, int mode, int flag)

fchmodat(int fd, const char *path, mode_t mode, int flag)

private static native void
fchmodat0(int fd, long pathAddress, int mode, int flag)

pack-priv static boolean
fchmodatNoFollowSupported()

Supports fchmodat with AT_SYMLINK_NOFOLLOW flag

private static native boolean
pack-priv static void
fchown(int fd, int uid, int gid)

fchown(int filedes, uid_t owner, gid_t group)

pack-priv static native void
fchown0(int fd, int uid, int gid)

pack-priv static native long
fdopendir(int dfd)

DIR* fdopendir(int filedes)

pack-priv static int
fgetxattr(int filedes, byte[] name, long valueAddress, int valueLen)

ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);

private static native int
fgetxattr0(int filedes, long nameAddress, long valueAddress, int valueLen)

pack-priv static native int
flistxattr(int filedes, long listAddress, int size)

size_t flistxattr(int filedes, const char *list, size_t size)

pack-priv static void
fremovexattr(int filedes, byte[] name)

fremovexattr(int filedes, const char *name);

private static native void
fremovexattr0(int filedes, long nameAddress)

pack-priv static void
fsetxattr(int filedes, byte[] name, long valueAddress, int valueLen)

fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags);

private static native void
fsetxattr0(int filedes, long nameAddress, long valueAddress, int valueLen)

pack-priv static void
fstat(int fd, UnixFileAttributes attrs)

fstat(int filedes, struct stat* buf)

private static native void
fstat0(int fd, UnixFileAttributes attrs)

pack-priv static void
fstatat(int dfd, UnixPath path, int flag, UnixFileAttributes attrs)

fstatat(int filedes,const char* path, struct stat* buf, int flag)

private static native int
fstatat0(int dfd, long pathAddress, int flag, UnixFileAttributes attrs)

pack-priv static int
fstatat2(int dfd, UnixPath path, int flag, UnixFileAttributes attrs)

pack-priv static void
futimens(int fd, long times0, long times1)

futimens(int fildes, const struct timespec times[2])

private static native void
futimens0(int fd, long times0, long times1)

pack-priv static native byte[]
getcwd()

char *getcwd(char *buf, size_t size);

pack-priv static native byte[]

Returns:

group->gr_name
getgrgid
(int gid)

struct group *getgrgid(gid_t gid);

pack-priv static int

Returns:

group->gr_name
getgrnam
(String name)

struct group *getgrnam(const char *name);

private static native int
getgrnam0(long nameAddress)

pack-priv static native int
getlinelen(long stream)

ssize_t getline(char **lineptr, size_t *n, FILE *stream);

pack-priv static int

Returns:

passwd->pw_uid
getpwnam
(String name)

struct passwd *getpwnam(const char *name);

private static native int
getpwnam0(long nameAddress)

pack-priv static native byte[]

Returns:

passwd->pw_name
getpwuid
(int uid)

struct passwd *getpwuid(uid_t uid);

private static native int
init()

pack-priv static void
lchown(UnixPath path, int uid, int gid)

lchown(const char* path, uid_t owner, gid_t group)

private static native void
lchown0(long pathAddress, int uid, int gid)

private static native void
link0(long existingAddress, long newAddress)

pack-priv static void
lstat(UnixPath path, UnixFileAttributes attrs)

lstat(const char* path, struct stat* buf)

private static native void
lstat0(long pathAddress, UnixFileAttributes attrs)

pack-priv static void
mkdir(UnixPath path, int mode)

mkdir(const char* path, mode_t mode)

private static native void
mkdir0(long pathAddress, int mode)

pack-priv static void
mknod(UnixPath path, int mode, long dev)

mknod(const char* path, mode_t mode, dev_t dev)

private static native void
mknod0(long pathAddress, int mode, long dev)

pack-priv static int
open(UnixPath path, int flags, int mode)

int open(const char* path, int oflag, mode_t mode)

private static native int
open0(long pathAddress, int flags, int mode)

pack-priv static int
openat(int dfd, byte[] path, int flags, int mode)

int openat(int dfd, const char* path, int oflag, mode_t mode)

private static native int
openat0(int dfd, long pathAddress, int flags, int mode)

pack-priv static boolean
openatSupported()

Supports openat and other *at calls.

pack-priv static long
opendir(UnixPath path)

DIR *opendir(const char* dirname)

private static native long
opendir0(long pathAddress)

pack-priv static int
read(int fildes, long buf, int nbyte)

size_t read(int fildes, void* buf, size_t nbyte)

private static native int
read0(int fildes, long buf, int nbyte)

pack-priv static byte[]

Returns:

dirent->d_name
readdir
(long dir)

struct dirent* readdir(DIR *dirp)

pack-priv static native byte[]
readdir0(long dir)

private static native byte[]
readlink0(long pathAddress)

pack-priv static byte[]

Returns:

resolved path
realpath
(UnixPath path)

realpath(const char* path, char* resolved_name)

private static native byte[]
realpath0(long pathAddress)

pack-priv static void
rename(UnixPath from, UnixPath to)

rename(const char* old, const char* new)

private static native void
rename0(long fromAddress, long toAddress)

pack-priv static void
renameat(int fromfd, byte[] from, int tofd, byte[] to)

renameat(int fromfd, const char* old, int tofd, const char* new)

private static native void
renameat0(int fromfd, long fromAddress, int tofd, long toAddress)

pack-priv static native void
rewind(long stream)

void rewind(FILE* stream);

pack-priv static void
rmdir(UnixPath path)

rmdir(const char* path)

private static native void
rmdir0(long pathAddress)

pack-priv static void
stat(UnixPath path, UnixFileAttributes attrs)

stat(const char* path, struct stat* buf)

private static native int
stat0(long pathAddress, UnixFileAttributes attrs)

pack-priv static int
pack-priv static void
statvfs(UnixPath path, UnixFileStoreAttributes attrs)

statvfs(const char* path, struct statvfs *buf)

private static native void
statvfs0(long pathAddress, UnixFileStoreAttributes attrs)

pack-priv static native byte[]
strerror(int errnum)

char* strerror(int errnum)

private static native void
symlink0(long name1, long name2)

private static native void
unlink0(long pathAddress)

pack-priv static void
unlinkat(int dfd, byte[] path, int flag)

unlinkat(int dfd, const char* path, int flag)

private static native void
unlinkat0(int dfd, long pathAddress, int flag)

pack-priv static void
utimensat(int fd, UnixPath path, long times0, long times1, int flags)

utimensat(int fd, const char* path, const struct timeval times[2], int flags)

private static native void
utimensat0(int fd, long pathAddress, long times0, long times1, int flags)

pack-priv static int
write(int fildes, long buf, int nbyte)

size_t writeint fildes, void* buf, size_t nbyte)

private static native int
write0(int fildes, long buf, int nbyte)

pack-priv static boolean
xattrSupported()

Supports extended attributes

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capabilitiesback to summary
private static final int capabilities
SUPPORTS_BIRTHTIMEback to summary
private static final int SUPPORTS_BIRTHTIME
SUPPORTS_OPENATback to summary
private static final int SUPPORTS_OPENAT

Capabilities

SUPPORTS_XATTRback to summary
private static final int SUPPORTS_XATTR

Constructor Detail

UnixNativeDispatcherback to summary
protected UnixNativeDispatcher()

Method Detail

accessback to summary
pack-priv static int access(UnixPath path, int amode)

access(const char* path, int amode);

access0back to summary
private static native int access0(long pathAddress, int amode)
birthtimeSupportedback to summary
pack-priv static boolean birthtimeSupported()

Supports file birth (creation) time attribute

chmodback to summary
pack-priv static void chmod(UnixPath path, int mode) throws UnixException

chmod(const char* path, mode_t mode)

chmod0back to summary
private static native void chmod0(long pathAddress, int mode) throws UnixException
chownback to summary
pack-priv static void chown(UnixPath path, int uid, int gid) throws UnixException

chown(const char* path, uid_t owner, gid_t group)

chown0back to summary
private static native void chown0(long pathAddress, int uid, int gid) throws UnixException
closeback to summary
pack-priv static void close(int fd) throws UnixException

close(int filedes). If fd is -1 this is a no-op.

closeback to summary
pack-priv static <X extends Throwable> void close(int fd, Function<UnixException, X> mapper) throws Function-:X

close(fd). If close fails then the given exception supplier function is invoked to produce an exception to throw. If the function returns null then no exception is thrown. If close fails and the exception supplier function is null, then no exception is thrown.

close0back to summary
private static native void close0(int fd) throws UnixException
closedirback to summary
pack-priv static native void closedir(long dir) throws UnixException

closedir(DIR* dirp)

copyToNativeBufferback to summary
pack-priv static NativeBuffer copyToNativeBuffer(UnixPath path)
dupback to summary
pack-priv static native int dup(int filedes) throws UnixException

int dup(int filedes)

fchmodback to summary
pack-priv static void fchmod(int fd, int mode) throws UnixException

fchmod(int fildes, mode_t mode)

fchmod0back to summary
private static native void fchmod0(int fd, int mode) throws UnixException
fchmodatback to summary
pack-priv static void fchmodat(int fd, UnixPath path, int mode, int flag) throws UnixException

fchmodat(int fd, const char *path, mode_t mode, int flag)

fchmodat0back to summary
private static native void fchmodat0(int fd, long pathAddress, int mode, int flag) throws UnixException
fchmodatNoFollowSupportedback to summary
pack-priv static boolean fchmodatNoFollowSupported()

Supports fchmodat with AT_SYMLINK_NOFOLLOW flag

fchmodatNoFollowSupported0back to summary
private static native boolean fchmodatNoFollowSupported0()
fchownback to summary
pack-priv static void fchown(int fd, int uid, int gid) throws UnixException

fchown(int filedes, uid_t owner, gid_t group)

fchown0back to summary
pack-priv static native void fchown0(int fd, int uid, int gid) throws UnixException
fdopendirback to summary
pack-priv static native long fdopendir(int dfd) throws UnixException

DIR* fdopendir(int filedes)

fgetxattrback to summary
pack-priv static int fgetxattr(int filedes, byte[] name, long valueAddress, int valueLen) throws UnixException

ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);

fgetxattr0back to summary
private static native int fgetxattr0(int filedes, long nameAddress, long valueAddress, int valueLen) throws UnixException
flistxattrback to summary
pack-priv static native int flistxattr(int filedes, long listAddress, int size) throws UnixException

size_t flistxattr(int filedes, const char *list, size_t size)

fremovexattrback to summary
pack-priv static void fremovexattr(int filedes, byte[] name) throws UnixException

fremovexattr(int filedes, const char *name);

fremovexattr0back to summary
private static native void fremovexattr0(int filedes, long nameAddress) throws UnixException
fsetxattrback to summary
pack-priv static void fsetxattr(int filedes, byte[] name, long valueAddress, int valueLen) throws UnixException

fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags);

fsetxattr0back to summary
private static native void fsetxattr0(int filedes, long nameAddress, long valueAddress, int valueLen) throws UnixException
fstatback to summary
pack-priv static void fstat(int fd, UnixFileAttributes attrs) throws UnixException

fstat(int filedes, struct stat* buf)

fstat0back to summary
private static native void fstat0(int fd, UnixFileAttributes attrs) throws UnixException
fstatatback to summary
pack-priv static void fstatat(int dfd, UnixPath path, int flag, UnixFileAttributes attrs) throws UnixException

fstatat(int filedes,const char* path, struct stat* buf, int flag)

fstatat0back to summary
private static native int fstatat0(int dfd, long pathAddress, int flag, UnixFileAttributes attrs)
fstatat2back to summary
pack-priv static int fstatat2(int dfd, UnixPath path, int flag, UnixFileAttributes attrs)
futimensback to summary
pack-priv static void futimens(int fd, long times0, long times1) throws UnixException

futimens(int fildes, const struct timespec times[2])

futimens0back to summary
private static native void futimens0(int fd, long times0, long times1) throws UnixException
getcwdback to summary
pack-priv static native byte[] getcwd()

char *getcwd(char *buf, size_t size);

getgrgidback to summary
pack-priv static native byte[] getgrgid(int gid) throws UnixException

struct group *getgrgid(gid_t gid);

Returns:byte[]

group->gr_name

getgrnamback to summary
pack-priv static int getgrnam(String name) throws UnixException

struct group *getgrnam(const char *name);

Returns:int

group->gr_name

getgrnam0back to summary
private static native int getgrnam0(long nameAddress) throws UnixException
getlinelenback to summary
pack-priv static native int getlinelen(long stream) throws UnixException

ssize_t getline(char **lineptr, size_t *n, FILE *stream);

getpwnamback to summary
pack-priv static int getpwnam(String name) throws UnixException

struct passwd *getpwnam(const char *name);

Returns:int

passwd->pw_uid

getpwnam0back to summary
private static native int getpwnam0(long nameAddress) throws UnixException
getpwuidback to summary
pack-priv static native byte[] getpwuid(int uid) throws UnixException

struct passwd *getpwuid(uid_t uid);

Returns:byte[]

passwd->pw_name

initback to summary
private static native int init()
lchownback to summary
pack-priv static void lchown(UnixPath path, int uid, int gid) throws UnixException

lchown(const char* path, uid_t owner, gid_t group)

lchown0back to summary
private static native void lchown0(long pathAddress, int uid, int gid) throws UnixException
link0back to summary
private static native void link0(long existingAddress, long newAddress) throws UnixException
lstatback to summary
pack-priv static void lstat(UnixPath path, UnixFileAttributes attrs) throws UnixException

lstat(const char* path, struct stat* buf)

lstat0back to summary
private static native void lstat0(long pathAddress, UnixFileAttributes attrs) throws UnixException
mkdirback to summary
pack-priv static void mkdir(UnixPath path, int mode) throws UnixException

mkdir(const char* path, mode_t mode)

mkdir0back to summary
private static native void mkdir0(long pathAddress, int mode) throws UnixException
mknodback to summary
pack-priv static void mknod(UnixPath path, int mode, long dev) throws UnixException

mknod(const char* path, mode_t mode, dev_t dev)

mknod0back to summary
private static native void mknod0(long pathAddress, int mode, long dev) throws UnixException
openback to summary
pack-priv static int open(UnixPath path, int flags, int mode) throws UnixException

int open(const char* path, int oflag, mode_t mode)

open0back to summary
private static native int open0(long pathAddress, int flags, int mode) throws UnixException
openatback to summary
pack-priv static int openat(int dfd, byte[] path, int flags, int mode) throws UnixException

int openat(int dfd, const char* path, int oflag, mode_t mode)

openat0back to summary
private static native int openat0(int dfd, long pathAddress, int flags, int mode) throws UnixException
openatSupportedback to summary
pack-priv static boolean openatSupported()

Supports openat and other *at calls.

opendirback to summary
pack-priv static long opendir(UnixPath path) throws UnixException

DIR *opendir(const char* dirname)

opendir0back to summary
private static native long opendir0(long pathAddress) throws UnixException
readback to summary
pack-priv static int read(int fildes, long buf, int nbyte) throws UnixException

size_t read(int fildes, void* buf, size_t nbyte)

read0back to summary
private static native int read0(int fildes, long buf, int nbyte) throws UnixException
readdirback to summary
pack-priv static byte[] readdir(long dir) throws UnixException

struct dirent* readdir(DIR *dirp)

Returns:byte[]

dirent->d_name

readdir0back to summary
pack-priv static native byte[] readdir0(long dir) throws UnixException
readlink0back to summary
private static native byte[] readlink0(long pathAddress) throws UnixException
realpathback to summary
pack-priv static byte[] realpath(UnixPath path) throws UnixException

realpath(const char* path, char* resolved_name)

Returns:byte[]

resolved path

realpath0back to summary
private static native byte[] realpath0(long pathAddress) throws UnixException
renameback to summary
pack-priv static void rename(UnixPath from, UnixPath to) throws UnixException

rename(const char* old, const char* new)

rename0back to summary
private static native void rename0(long fromAddress, long toAddress) throws UnixException
renameatback to summary
pack-priv static void renameat(int fromfd, byte[] from, int tofd, byte[] to) throws UnixException

renameat(int fromfd, const char* old, int tofd, const char* new)

renameat0back to summary
private static native void renameat0(int fromfd, long fromAddress, int tofd, long toAddress) throws UnixException
rewindback to summary
pack-priv static native void rewind(long stream) throws UnixException

void rewind(FILE* stream);

rmdirback to summary
pack-priv static void rmdir(UnixPath path) throws UnixException

rmdir(const char* path)

rmdir0back to summary
private static native void rmdir0(long pathAddress) throws UnixException
statback to summary
pack-priv static void stat(UnixPath path, UnixFileAttributes attrs) throws UnixException

stat(const char* path, struct stat* buf)

stat0back to summary
private static native int stat0(long pathAddress, UnixFileAttributes attrs)
stat2back to summary
pack-priv static int stat2(UnixPath path, UnixFileAttributes attrs)
statvfsback to summary
pack-priv static void statvfs(UnixPath path, UnixFileStoreAttributes attrs) throws UnixException

statvfs(const char* path, struct statvfs *buf)

statvfs0back to summary
private static native void statvfs0(long pathAddress, UnixFileStoreAttributes attrs) throws UnixException
strerrorback to summary
pack-priv static native byte[] strerror(int errnum)

char* strerror(int errnum)

symlink0back to summary
private static native void symlink0(long name1, long name2) throws UnixException
unlink0back to summary
private static native void unlink0(long pathAddress) throws UnixException
unlinkatback to summary
pack-priv static void unlinkat(int dfd, byte[] path, int flag) throws UnixException

unlinkat(int dfd, const char* path, int flag)

unlinkat0back to summary
private static native void unlinkat0(int dfd, long pathAddress, int flag) throws UnixException
utimensatback to summary
pack-priv static void utimensat(int fd, UnixPath path, long times0, long times1, int flags) throws UnixException

utimensat(int fd, const char* path, const struct timeval times[2], int flags)

utimensat0back to summary
private static native void utimensat0(int fd, long pathAddress, long times0, long times1, int flags) throws UnixException
writeback to summary
pack-priv static int write(int fildes, long buf, int nbyte) throws UnixException

size_t writeint fildes, void* buf, size_t nbyte)

write0back to summary
private static native int write0(int fildes, long buf, int nbyte) throws UnixException
xattrSupportedback to summary
pack-priv static boolean xattrSupported()

Supports extended attributes