Class WinLibCAdapter

  • All Implemented Interfaces:
    Native.LibC, jnr.ffi.provider.LoadedLibrary

    public final class WinLibCAdapter
    extends java.lang.Object
    implements Native.LibC, jnr.ffi.provider.LoadedLibrary
    MSVCRT.DLL only supports some LibC functions, but the symbols are different. This adapter maps the MSVCRT.DLL names to standard LibC names
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int close​(int fd)  
      int fcntl​(int fd, int cmd, int data)  
      jnr.ffi.Runtime getRuntime()  
      int kevent​(int kq, java.nio.ByteBuffer changebuf, int nchanges, java.nio.ByteBuffer eventbuf, int nevents, Native.Timespec timeout)  
      int kevent​(int kq, jnr.ffi.Pointer changebuf, int nchanges, jnr.ffi.Pointer eventbuf, int nevents, Native.Timespec timeout)  
      int kqueue()  
      int pipe​(int[] fds)  
      int poll​(java.nio.ByteBuffer pfds, int nfds, int timeout)  
      int poll​(jnr.ffi.Pointer pfds, int nfds, int timeout)  
      int read​(int fd, byte[] data, long size)  
      int read​(int fd, java.nio.ByteBuffer data, long size)  
      int shutdown​(int s, int how)  
      java.lang.String strerror​(int error)  
      int write​(int fd, byte[] data, long size)  
      int write​(int fd, java.nio.ByteBuffer data, long size)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public int close​(int fd)
        Specified by:
        close in interface Native.LibC
      • read

        public int read​(int fd,
                        java.nio.ByteBuffer data,
                        long size)
        Specified by:
        read in interface Native.LibC
      • read

        public int read​(int fd,
                        byte[] data,
                        long size)
        Specified by:
        read in interface Native.LibC
      • write

        public int write​(int fd,
                         java.nio.ByteBuffer data,
                         long size)
        Specified by:
        write in interface Native.LibC
      • write

        public int write​(int fd,
                         byte[] data,
                         long size)
        Specified by:
        write in interface Native.LibC
      • pipe

        public int pipe​(int[] fds)
        Specified by:
        pipe in interface Native.LibC
      • strerror

        public java.lang.String strerror​(int error)
        Specified by:
        strerror in interface Native.LibC
      • getRuntime

        public jnr.ffi.Runtime getRuntime()
        Specified by:
        getRuntime in interface jnr.ffi.provider.LoadedLibrary
      • fcntl

        public int fcntl​(int fd,
                         int cmd,
                         int data)
        Specified by:
        fcntl in interface Native.LibC
      • poll

        public int poll​(java.nio.ByteBuffer pfds,
                        int nfds,
                        int timeout)
        Specified by:
        poll in interface Native.LibC
      • poll

        public int poll​(jnr.ffi.Pointer pfds,
                        int nfds,
                        int timeout)
        Specified by:
        poll in interface Native.LibC
      • kevent

        public int kevent​(int kq,
                          java.nio.ByteBuffer changebuf,
                          int nchanges,
                          java.nio.ByteBuffer eventbuf,
                          int nevents,
                          Native.Timespec timeout)
        Specified by:
        kevent in interface Native.LibC
      • kevent

        public int kevent​(int kq,
                          jnr.ffi.Pointer changebuf,
                          int nchanges,
                          jnr.ffi.Pointer eventbuf,
                          int nevents,
                          Native.Timespec timeout)
        Specified by:
        kevent in interface Native.LibC
      • shutdown

        public int shutdown​(int s,
                            int how)
        Specified by:
        shutdown in interface Native.LibC