Package org.jruby.util.io
Class PosixShim
java.lang.Object
org.jruby.util.io.PosixShim
Representations of as many native posix functions as possible applied to an NIO channel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe recommended error message, if any.The last Throwable exception raised by a call.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final PosixShim.WaitMacros
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
fcntlGetFD
(int fd) int
fcntlSetFD
(int fd, int flags) int
int
jnr.constants.platform.Errno
getErrno()
The appropriate errno value for the last thrown error, if any.long
open
(String cwd, String path, ModeFlags flags, int perm, ClassLoader classLoader) Deprecated.Channel[]
pipe()
int
int
read
(ChannelFD fd, ByteBuffer buffer, int offset, int length, boolean nonblock) int
setCloexec
(int fd, boolean cloexec) void
setErrno
(jnr.constants.platform.Errno errno) long
static int
umask
(jnr.posix.POSIX posix) Joy of POSIX, only way to get the umask is to set the umask, then set it back.static int
umask
(jnr.posix.POSIX posix, int newMask) int
int
write
(ChannelFD fd, ByteBuffer buffer, int offset, int length, boolean nonblock)
-
Field Details
-
LOCK_SH
public static final int LOCK_SH- See Also:
-
LOCK_EX
public static final int LOCK_EX- See Also:
-
LOCK_NB
public static final int LOCK_NB- See Also:
-
LOCK_UN
public static final int LOCK_UN- See Also:
-
SEEK_SET
public static final int SEEK_SET- See Also:
-
SEEK_CUR
public static final int SEEK_CUR- See Also:
-
SEEK_END
public static final int SEEK_END- See Also:
-
WAIT_MACROS
-
error
The last Throwable exception raised by a call. -
errmsg
The recommended error message, if any.
-
-
Constructor Details
-
PosixShim
-
-
Method Details
-
lseek
-
write
-
write
-
read
-
read
-
flock
-
dup2
-
close
-
close
-
pipe
-
getErrno
public jnr.constants.platform.Errno getErrno()The appropriate errno value for the last thrown error, if any. -
setErrno
public void setErrno(jnr.constants.platform.Errno errno) -
setCloexec
public int setCloexec(int fd, boolean cloexec) -
fcntlSetFD
public int fcntlSetFD(int fd, int flags) -
fcntlGetFD
public int fcntlGetFD(int fd) -
open
-
open
-
open
@Deprecated public Channel open(String cwd, String path, ModeFlags flags, int perm, ClassLoader classLoader) Deprecated. -
umask
public static int umask(jnr.posix.POSIX posix) Joy of POSIX, only way to get the umask is to set the umask, then set it back. That's unsafe in a threaded program. We minimize but may not totally remove this race by caching the obtained or previously set (see umask() above) umask and using that as the initial set value which, cross fingers, is a no-op. The cache access is then synchronized. TODO: Better? -
umask
public static int umask(jnr.posix.POSIX posix, int newMask) -
ftruncate
-
size
-