Tabnine Logo
Os.sysconf
Code IndexAdd Tabnine to your IDE (free)

How to use
sysconf
method
in
libcore.io.Os

Best Java code snippets using libcore.io.Os.sysconf (Showing top 20 results out of 315)

origin: robovm/robovm

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: robovm/robovm

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: robovm/robovm

/**
 * Returns true if there is a high probability that every page of this buffer is currently
 * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
 * a strong guarantee since this is only a snapshot of a dynamic situation.
 */
public final boolean isLoaded() {
 checkIsMapped();
 long address = block.toLong();
 long size = block.getSize();
 if (size == 0) {
  return true;
 }
 try {
  int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
  int pageOffset = (int) (address % pageSize);
  address -= pageOffset;
  size += pageOffset;
  int pageCount = (int) ((size + pageSize - 1) / pageSize);
  byte[] vector = new byte[pageCount];
  Libcore.os.mincore(address, size, vector);
  for (int i = 0; i < vector.length; ++i) {
   if ((vector[i] & 1) != 1) {
    return false;
   }
  }
  return true;
 } catch (ErrnoException errnoException) {
  return false;
 }
}
origin: robovm/robovm

long alignment = position - position % Libcore.os.sysconf(_SC_PAGE_SIZE);
int offset = (int) (position - alignment);
MemoryBlock block = MemoryBlock.mmap(fd, alignment, size + offset, mapMode);
origin: MobiVM/robovm

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: ibinti/bugvm

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: com.gluonhq/robovm-rt

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: com.bugvm/bugvm-rt

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: FlexoVM/flexovm

/**
 * Returns the number of processor cores available to the VM, at least 1.
 * Traditionally this returned the number currently online,
 * but many mobile devices are able to take unused cores offline to
 * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of
 * cores that could be made available if there were no power or heat
 * constraints.
 */
public int availableProcessors() {
  return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF);
}
origin: ibinti/bugvm

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: com.mobidevelop.robovm/robovm-rt

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: MobiVM/robovm

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: com.bugvm/bugvm-rt

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: com.gluonhq/robovm-rt

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: FlexoVM/flexovm

public long sysconf(int name) { return os.sysconf(name); }
public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
origin: MobiVM/robovm

/**
 * Returns true if there is a high probability that every page of this buffer is currently
 * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
 * a strong guarantee since this is only a snapshot of a dynamic situation.
 */
public final boolean isLoaded() {
 checkIsMapped();
 long address = block.toLong();
 long size = block.getSize();
 if (size == 0) {
  return true;
 }
 try {
  int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
  int pageOffset = (int) (address % pageSize);
  address -= pageOffset;
  size += pageOffset;
  int pageCount = (int) ((size + pageSize - 1) / pageSize);
  byte[] vector = new byte[pageCount];
  Libcore.os.mincore(address, size, vector);
  for (int i = 0; i < vector.length; ++i) {
   if ((vector[i] & 1) != 1) {
    return false;
   }
  }
  return true;
 } catch (ErrnoException errnoException) {
  return false;
 }
}
origin: ibinti/bugvm

/**
 * Returns true if there is a high probability that every page of this buffer is currently
 * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
 * a strong guarantee since this is only a snapshot of a dynamic situation.
 */
public final boolean isLoaded() {
 checkIsMapped();
 long address = block.toLong();
 long size = block.getSize();
 if (size == 0) {
  return true;
 }
 try {
  int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
  int pageOffset = (int) (address % pageSize);
  address -= pageOffset;
  size += pageOffset;
  int pageCount = (int) ((size + pageSize - 1) / pageSize);
  byte[] vector = new byte[pageCount];
  Libcore.os.mincore(address, size, vector);
  for (int i = 0; i < vector.length; ++i) {
   if ((vector[i] & 1) != 1) {
    return false;
   }
  }
  return true;
 } catch (ErrnoException errnoException) {
  return false;
 }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns true if there is a high probability that every page of this buffer is currently
 * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
 * a strong guarantee since this is only a snapshot of a dynamic situation.
 */
public final boolean isLoaded() {
 checkIsMapped();
 long address = block.toLong();
 long size = block.getSize();
 if (size == 0) {
  return true;
 }
 try {
  int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
  int pageOffset = (int) (address % pageSize);
  address -= pageOffset;
  size += pageOffset;
  int pageCount = (int) ((size + pageSize - 1) / pageSize);
  byte[] vector = new byte[pageCount];
  Libcore.os.mincore(address, size, vector);
  for (int i = 0; i < vector.length; ++i) {
   if ((vector[i] & 1) != 1) {
    return false;
   }
  }
  return true;
 } catch (ErrnoException errnoException) {
  return false;
 }
}
origin: com.gluonhq/robovm-rt

/**
 * Returns true if there is a high probability that every page of this buffer is currently
 * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
 * a strong guarantee since this is only a snapshot of a dynamic situation.
 */
public final boolean isLoaded() {
 checkIsMapped();
 long address = block.toLong();
 long size = block.getSize();
 if (size == 0) {
  return true;
 }
 try {
  int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
  int pageOffset = (int) (address % pageSize);
  address -= pageOffset;
  size += pageOffset;
  int pageCount = (int) ((size + pageSize - 1) / pageSize);
  byte[] vector = new byte[pageCount];
  Libcore.os.mincore(address, size, vector);
  for (int i = 0; i < vector.length; ++i) {
   if ((vector[i] & 1) != 1) {
    return false;
   }
  }
  return true;
 } catch (ErrnoException errnoException) {
  return false;
 }
}
libcore.ioOssysconf

Popular methods of Os

  • accept
  • access
  • bind
  • chmod
  • chown
  • close
  • connect
  • dup
  • dup2
  • environ
  • execv
  • execve
  • execv,
  • execve,
  • fchmod,
  • fchown,
  • fcntlFlock,
  • fcntlLong,
  • fcntlVoid,
  • fdatasync,
  • fstat,
  • fstatvfs

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Notification (javax.management)
  • JCheckBox (javax.swing)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now