Examples of NativeLong


Examples of com.sun.jna.NativeLong

      s = DEVICE_DIR_PATH + s;
    return m_Clib.open(s, t);
  }

  public int read(int fd, byte[] buffer, int len) {
    return m_Clib.read(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }
View Full Code Here

Examples of com.sun.jna.NativeLong

  public int read(int fd, byte[] buffer, int len) {
    return m_Clib.read(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }

  public int write(int fd, byte[] buffer, int len) {
    return m_Clib.write(fd, ByteBuffer.wrap(buffer), new NativeLong(len)).intValue();
  }
View Full Code Here

Examples of com.sun.jna.NativeLong

    if (set == null)
      return;
    FDSetImpl p = (FDSetImpl) set;
    //p.bits[fd / FDSetImpl.NFBBITS] &= ~(1 << (fd % FDSetImpl.NFBBITS));
    int i = fd / FDSetImpl.NFBBITS;
    p.bits[i] = new NativeLong(p.bits[i].longValue() & ~(1 << (fd % FDSetImpl.NFBBITS)));
  }
View Full Code Here

Examples of com.sun.jna.NativeLong

            "tv_usec"//
        );
      }

      public timeval(jtermios.TimeVal timeout) {
        tv_sec = new NativeLong(timeout.tv_sec);
        tv_usec = new NativeLong(timeout.tv_usec);
      }
View Full Code Here

Examples of com.sun.jna.NativeLong

    if (set == null)
      return;
    FDSetImpl p = (FDSetImpl) set;
    //p.bits[fd / FDSetImpl.NFBBITS] |= 1 << (fd % FDSetImpl.NFBBITS);
    int i = fd / FDSetImpl.NFBBITS;
    p.bits[i] = new NativeLong(p.bits[i].longValue() | (1 << (fd % FDSetImpl.NFBBITS)));
  }
View Full Code Here

Examples of com.sun.jna.NativeLong

  public void FD_ZERO(FDSet set) {
    if (set == null)
      return;
    FDSetImpl p = (FDSetImpl) set;
    //java.util.Arrays.fill(p.bits, 0);
    java.util.Arrays.fill(p.bits, new NativeLong(0));
  }
View Full Code Here

Examples of com.sun.jna.NativeLong

            "tv_usec"//
        );
      }

      public timeval(jtermios.TimeVal timeout) {
        tv_sec = new NativeLong(timeout.tv_sec);
        tv_usec = new NativeLong(timeout.tv_usec);
      }
View Full Code Here

Examples of com.sun.jna.NativeLong

            "tv_usec"//
        );
      }

      public timeval(jtermios.TimeVal timeout) {
        tv_sec = new NativeLong(timeout.tv_sec);
        tv_usec = new NativeLong(timeout.tv_usec);
      }
View Full Code Here

Examples of com.sun.jna.NativeLong

        String filename = link.getAbsolutePath();
        try {
            for (int sz=512; sz < 65536; sz*=2) {
                Memory m = new Memory(sz);
                int r = LIBC.readlink(filename,m,new NativeLong(sz));
                if (r<0) {
                    int err = Native.getLastError();
                    if (err==22/*EINVAL --- but is this really portable?*/)
                        return null; // this means it's not a symlink
                    throw new IOException("Failed to readlink "+link+" error="+ err+" "+ LIBC.strerror(err));
View Full Code Here

Examples of com.sun.jna.NativeLong

        // we don't really have a need to change the recommended pointer.
        Pointer addr = new Pointer(0);

        Pointer result = Delegate.mmap(addr,
                                       new NativeLong(len),
                                       prot,
                                       flags,
                                       fildes,
                                       new NativeLong(off));

        if(Pointer.nativeValue(result) == -1) {
            if(logger.isDebugEnabled())
                logger.debug(errno.strerror());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.