mozilla

Revision 235035 of JavaScript OS.Constants

  • Revision slug: JavaScript_OS.Constants
  • Revision title: JavaScript OS.Constants
  • Revision id: 235035
  • Created:
  • Creator: Yoric
  • Is current revision? No
  • Comment 335 words added, 5 words removed

Revision Content

JavaScript module OS.Constants contains Operating System-specific constants.

At the time of this writing, this module is available only to chrome workers.

OS.Constants.Sys

OS.Constants.libc

Constants for interacting with libc. Useful mostly for using js-ctypes to interact with the following platforms:

  • MacOS X;
  • Android;
  • Linux;
  • other variants of Unix.

OS.Constants.libc is available on all platforms, although some constants are not defined everywhere. Before using a constant, you should check that it is defined.

Error values

EACCES Permission denied
EAGAIN Resource temporarily unavailable
EBADF Bad file descriptor
EEXIST File exists
EFAULT Bad address
EFBIG File too large
EINVAL Invalid argument
EIO Input/output error
EISDIR Is a directory
ELOOP

Too many levels of symbolic links.
May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.

EMFILE Too many open files in the process
ENAMETOOLONG Name too long
ENFILE Too many open files on the system
ENOENT No such file or directory
ENOMEM Cannot allocate memory
ENOSPC No space on device
ENOTDIR Is not a directory
ENXIO Device no configured or does not support operation
EOPNOTSUPP Operation not supported.
May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.
EOVERFLOW Value too large to be stored in datatype.
May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.
EPERM Operation not permitted
ERANGE Result too large
ETIMEDOUT Operation timed out.
May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.
EWOULDBLOCK Operation would block.
May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.
EXDEV Cross-device link

Opening files

(tbd)

OS.Constants.Win

Constants for interacting with the Windows API. OS.Constants.Win is undefined on non-Windows platforms. Useful mostly in conjunction with js-ctypes.

(tbd)

Revision Source

<p>JavaScript module <code>OS.Constants</code> contains Operating System-specific constants.</p>
<p>At the time of this writing, this module is available only to <a href="/en/DOM/ChromeWorker" rel="internal" title="ChromeWorker">chrome workers</a>.</p>
<h2>OS.Constants.Sys</h2>

<h2>OS.Constants.libc</h2>
<p>Constants for interacting with libc. Useful mostly for using <a href="/en/js-ctypes" title="en/js-ctypes">js-ctypes</a> to interact with the following platforms:</p>
<ul> <li>MacOS X;</li> <li>Android;</li> <li>Linux;</li> <li>other variants of Unix.</li>
</ul>
<p><code>OS.Constants.libc</code> is available on all platforms, although some constants are not defined everywhere. Before using a constant, you should check that it is defined.</p>
<h3>Error values</h3>
<table border="1" cellpadding="1" cellspacing="1" style="table-layout: fixed;"> <tbody> <tr> <td>EACCES</td> <td>Permission denied</td> </tr> <tr> <td>EAGAIN</td> <td>Resource temporarily unavailable</td> </tr> <tr> <td>EBADF</td> <td>Bad file descriptor</td> </tr> <tr> <td>EEXIST</td> <td>File exists</td> </tr> <tr> <td>EFAULT</td> <td>Bad address</td> </tr> <tr> <td>EFBIG</td> <td>File too large</td> </tr> <tr> <td>EINVAL</td> <td>Invalid argument</td> </tr> <tr> <td>EIO</td> <td>Input/output error</td> </tr> <tr> <td>EISDIR</td> <td>Is a directory</td> </tr> <tr> <td>ELOOP</td> <td> <p>Too many levels of symbolic links.<br> <span style="color:#a9a9a9;">May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.</span></p> </td> </tr> <tr> <td>EMFILE</td> <td>Too many open files in the process</td> </tr> <tr> <td>ENAMETOOLONG</td> <td>Name too long</td> </tr> <tr> <td>ENFILE</td> <td>Too many open files on the system</td> </tr> <tr> <td>ENOENT</td> <td>No such file or directory</td> </tr> <tr> <td>ENOMEM</td> <td>Cannot allocate memory</td> </tr> <tr> <td>ENOSPC</td> <td>No space on device</td> </tr> <tr> <td>ENOTDIR</td> <td>Is not a directory</td> </tr> <tr> <td>ENXIO</td> <td>Device no configured or does not support operation</td> </tr> <tr> <td>EOPNOTSUPP</td> <td>Operation not supported.<br> <span style="color:#a9a9a9;">May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.</span></td> </tr> <tr> <td>EOVERFLOW</td> <td>Value too large to be stored in datatype.<br> <span style="color:#a9a9a9;">May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.</span></td> </tr> <tr> <td>EPERM</td> <td>Operation not permitted</td> </tr> <tr> <td>ERANGE</td> <td>Result too large</td> </tr> <tr> <td>ETIMEDOUT</td> <td>Operation timed out.<br> <span style="color:#a9a9a9;">May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.</span></td> </tr> <tr> <td>EWOULDBLOCK</td> <td>Operation would block.<br> <span style="color:#a9a9a9;">May not be available under Windows for old versions of Firefox or custom versions of Firefox compiled with VC9 or older.</span></td> </tr> <tr> <td>EXDEV</td> <td>Cross-device link</td> </tr> </tbody>
</table>
<h3>Opening files</h3>
<p>(tbd)</p>
<h2>OS.Constants.Win</h2>
<p>Constants for interacting with the Windows API. <code>OS.Constants.Win</code> is <code>undefined</code> on non-Windows platforms. Useful mostly in conjunction with <a href="/en/js-ctypes" title="en/js-ctypes">js-ctypes</a>.</p>
<p>(tbd)</p>
Revert to this revision