-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathos.html
More file actions
1432 lines (1426 loc) · 59.6 KB
/
os.html
File metadata and controls
1432 lines (1426 loc) · 59.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>OS | Node.js v12.0.0 Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/hljs.css">
<link rel="canonical" href="https://nodejs.org/api/os.html">
</head>
<body class="alt apidoc" id="api-section-os">
<div id="content" class="clearfix">
<div id="column2" class="interior">
<div id="intro" class="interior">
<a href="/" title="Go back to the home page">
Node.js
</a>
</div>
<ul>
<li><a href="documentation.html" class="nav-documentation">About these Docs</a></li>
<li><a href="synopsis.html" class="nav-synopsis">Usage & Example</a></li>
</ul>
<div class="line"></div>
<ul>
<li><a href="assert.html" class="nav-assert">Assertion Testing</a></li>
<li><a href="async_hooks.html" class="nav-async_hooks">Async Hooks</a></li>
<li><a href="buffer.html" class="nav-buffer">Buffer</a></li>
<li><a href="addons.html" class="nav-addons">C++ Addons</a></li>
<li><a href="n-api.html" class="nav-n-api">C/C++ Addons - N-API</a></li>
<li><a href="child_process.html" class="nav-child_process">Child Processes</a></li>
<li><a href="cluster.html" class="nav-cluster">Cluster</a></li>
<li><a href="cli.html" class="nav-cli">Command Line Options</a></li>
<li><a href="console.html" class="nav-console">Console</a></li>
<li><a href="crypto.html" class="nav-crypto">Crypto</a></li>
<li><a href="debugger.html" class="nav-debugger">Debugger</a></li>
<li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li>
<li><a href="dns.html" class="nav-dns">DNS</a></li>
<li><a href="domain.html" class="nav-domain">Domain</a></li>
<li><a href="esm.html" class="nav-esm">ECMAScript Modules</a></li>
<li><a href="errors.html" class="nav-errors">Errors</a></li>
<li><a href="events.html" class="nav-events">Events</a></li>
<li><a href="fs.html" class="nav-fs">File System</a></li>
<li><a href="globals.html" class="nav-globals">Globals</a></li>
<li><a href="http.html" class="nav-http">HTTP</a></li>
<li><a href="http2.html" class="nav-http2">HTTP/2</a></li>
<li><a href="https.html" class="nav-https">HTTPS</a></li>
<li><a href="inspector.html" class="nav-inspector">Inspector</a></li>
<li><a href="intl.html" class="nav-intl">Internationalization</a></li>
<li><a href="modules.html" class="nav-modules">Modules</a></li>
<li><a href="net.html" class="nav-net">Net</a></li>
<li><a href="os.html" class="nav-os active">OS</a></li>
<li><a href="path.html" class="nav-path">Path</a></li>
<li><a href="perf_hooks.html" class="nav-perf_hooks">Performance Hooks</a></li>
<li><a href="process.html" class="nav-process">Process</a></li>
<li><a href="punycode.html" class="nav-punycode">Punycode</a></li>
<li><a href="querystring.html" class="nav-querystring">Query Strings</a></li>
<li><a href="readline.html" class="nav-readline">Readline</a></li>
<li><a href="repl.html" class="nav-repl">REPL</a></li>
<li><a href="stream.html" class="nav-stream">Stream</a></li>
<li><a href="string_decoder.html" class="nav-string_decoder">String Decoder</a></li>
<li><a href="timers.html" class="nav-timers">Timers</a></li>
<li><a href="tls.html" class="nav-tls">TLS/SSL</a></li>
<li><a href="tracing.html" class="nav-tracing">Trace Events</a></li>
<li><a href="tty.html" class="nav-tty">TTY</a></li>
<li><a href="dgram.html" class="nav-dgram">UDP/Datagram</a></li>
<li><a href="url.html" class="nav-url">URL</a></li>
<li><a href="util.html" class="nav-util">Utilities</a></li>
<li><a href="v8.html" class="nav-v8">V8</a></li>
<li><a href="vm.html" class="nav-vm">VM</a></li>
<li><a href="worker_threads.html" class="nav-worker_threads">Worker Threads</a></li>
<li><a href="zlib.html" class="nav-zlib">ZLIB</a></li>
</ul>
<div class="line"></div>
<ul>
<li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">GitHub Repo & Issue Tracker</a></li>
</ul>
</div>
<div id="column1" data-id="os" class="interior">
<header>
<h1>Node.js v12.0.0 Documentation</h1>
<div id="gtoc">
<ul>
<li>
<a href="index.html" name="toc">Index</a>
</li>
<li>
<a href="all.html">View on single page</a>
</li>
<li>
<a href="os.json">View as JSON</a>
</li>
<li class="version-picker">
<a href="#">View another version <span>▼</span></a>
<ol class="version-picker"><li><a href="https://nodejs.org/docs/latest-v11.x/api/os.html">11.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v10.x/api/os.html">10.x <b>LTS</b></a></li>
<li><a href="https://nodejs.org/docs/latest-v9.x/api/os.html">9.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v8.x/api/os.html">8.x <b>LTS</b></a></li>
<li><a href="https://nodejs.org/docs/latest-v7.x/api/os.html">7.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v6.x/api/os.html">6.x <b>LTS</b></a></li>
<li><a href="https://nodejs.org/docs/latest-v5.x/api/os.html">5.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v4.x/api/os.html">4.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v0.12.x/api/os.html">0.12.x</a></li>
<li><a href="https://nodejs.org/docs/latest-v0.10.x/api/os.html">0.10.x</a></li></ol>
</li>
<li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/master/doc/api/os.md"><span class="github_icon"><svg height="16" width="16" viewBox="0 0 16.1 16.1" fill="currentColor"><path d="M8 0a8 8 0 0 0-2.5 15.6c.4 0 .5-.2.5-.4v-1.5c-2 .4-2.5-.5-2.7-1 0-.1-.5-.9-.8-1-.3-.2-.7-.6 0-.6.6 0 1 .6 1.2.8.7 1.2 1.9 1 2.4.7 0-.5.2-.9.5-1-1.8-.3-3.7-1-3.7-4 0-.9.3-1.6.8-2.2 0-.2-.3-1 .1-2 0 0 .7-.3 2.2.7a7.4 7.4 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.5 1.1.2 2 .1 2.1.5.6.8 1.3.8 2.2 0 3-1.9 3.7-3.6 4 .3.2.5.7.5 1.4v2.2c0 .2.1.5.5.4A8 8 0 0 0 16 8a8 8 0 0 0-8-8z"/></svg></span>Edit on GitHub</a></li>
</ul>
</div>
<hr>
</header>
<div id="toc">
<h2>Table of Contents</h2>
<ul>
<li>
<p><span class="stability_2"><a href="#os_os">OS</a></span></p>
<ul>
<li><a href="#os_os_eol">os.EOL</a></li>
<li><a href="#os_os_arch">os.arch()</a></li>
<li><a href="#os_os_constants">os.constants</a></li>
<li><a href="#os_os_cpus">os.cpus()</a></li>
<li><a href="#os_os_endianness">os.endianness()</a></li>
<li><a href="#os_os_freemem">os.freemem()</a></li>
<li><a href="#os_os_getpriority_pid">os.getPriority([pid])</a></li>
<li><a href="#os_os_homedir">os.homedir()</a></li>
<li><a href="#os_os_hostname">os.hostname()</a></li>
<li><a href="#os_os_loadavg">os.loadavg()</a></li>
<li><a href="#os_os_networkinterfaces">os.networkInterfaces()</a></li>
<li><a href="#os_os_platform">os.platform()</a></li>
<li><a href="#os_os_release">os.release()</a></li>
<li><a href="#os_os_setpriority_pid_priority">os.setPriority([pid, ]priority)</a></li>
<li><a href="#os_os_tmpdir">os.tmpdir()</a></li>
<li><a href="#os_os_totalmem">os.totalmem()</a></li>
<li><a href="#os_os_type">os.type()</a></li>
<li><a href="#os_os_uptime">os.uptime()</a></li>
<li><a href="#os_os_userinfo_options">os.userInfo([options])</a></li>
<li>
<p><a href="#os_os_constants_1">OS Constants</a></p>
<ul>
<li><a href="#os_signal_constants">Signal Constants</a></li>
<li>
<p><a href="#os_error_constants">Error Constants</a></p>
<ul>
<li><a href="#os_posix_error_constants">POSIX Error Constants</a></li>
<li><a href="#os_windows_specific_error_constants">Windows Specific Error Constants</a></li>
</ul>
</li>
<li><a href="#os_dlopen_constants">dlopen Constants</a></li>
<li><a href="#os_priority_constants">Priority Constants</a></li>
<li><a href="#os_libuv_constants">libuv Constants</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div id="apicontent">
<h1>OS<span><a class="mark" href="#os_os" id="os_os">#</a></span></h1>
<p></p><div class="api_stability api_stability_2"><a href="documentation.html#documentation_stability_index">Stability: 2</a> - Stable</div><p></p>
<p>The <code>os</code> module provides a number of operating system-related utility methods.
It can be accessed using:</p>
<pre><code class="language-js"><span class="hljs-keyword">const</span> os = <span class="hljs-built_in">require</span>(<span class="hljs-string">'os'</span>);</code></pre>
<h2>os.EOL<span><a class="mark" href="#os_os_eol" id="os_os_eol">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.7.8</span>
</div>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>A string constant defining the operating system-specific end-of-line marker:</p>
<ul>
<li><code>\n</code> on POSIX</li>
<li><code>\r\n</code> on Windows</li>
</ul>
<h2>os.arch()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L110">[src]</a><span><a class="mark" href="#os_os_arch" id="os_os_arch">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.5.0</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.arch()</code> method returns a string identifying the operating system CPU
architecture for which the Node.js binary was compiled.</p>
<p>The current possible values are: <code>'arm'</code>, <code>'arm64'</code>, <code>'ia32'</code>, <code>'mips'</code>,
<code>'mipsel'</code>, <code>'ppc'</code>, <code>'ppc64'</code>, <code>'s390'</code>, <code>'s390x'</code>, <code>'x32'</code>, and <code>'x64'</code>.</p>
<p>Equivalent to <a href="process.html#process_process_arch"><code>process.arch</code></a>.</p>
<h2>os.constants<span><a class="mark" href="#os_os_constants" id="os_os_constants">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v6.3.0</span>
</div>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></li>
</ul>
<p>Returns an object containing commonly used operating system specific constants
for error codes, process signals, and so on. The specific constants currently
defined are described in <a href="#os_os_constants_1">OS Constants</a>.</p>
<h2>os.cpus()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L91">[src]</a><span><a class="mark" href="#os_os_cpus" id="os_os_cpus">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object[]></a></li>
</ul>
<p>The <code>os.cpus()</code> method returns an array of objects containing information about
each logical CPU core.</p>
<p>The properties included on each object include:</p>
<ul>
<li><code>model</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
<li><code>speed</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> (in MHz)</li>
<li>
<p><code>times</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></p>
<ul>
<li><code>user</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The number of milliseconds the CPU has spent in user mode.</li>
<li><code>nice</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The number of milliseconds the CPU has spent in nice mode.</li>
<li><code>sys</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The number of milliseconds the CPU has spent in sys mode.</li>
<li><code>idle</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The number of milliseconds the CPU has spent in idle mode.</li>
<li><code>irq</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The number of milliseconds the CPU has spent in irq mode.</li>
</ul>
</li>
</ul>
<!-- eslint-disable semi -->
<pre><code class="language-js">[
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">252020</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">30340</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1070356870</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">0</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">306960</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">26980</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1071569080</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">0</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">248450</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">21750</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1070919370</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">0</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">256880</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">19430</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1070905480</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">20</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">511580</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">20</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">40900</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1070842510</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">0</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">291660</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">34360</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1070888000</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">10</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">308260</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">55410</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1071129970</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">880</span>
}
},
{
<span class="hljs-attr">model</span>: <span class="hljs-string">'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'</span>,
<span class="hljs-attr">speed</span>: <span class="hljs-number">2926</span>,
<span class="hljs-attr">times</span>: {
<span class="hljs-attr">user</span>: <span class="hljs-number">266450</span>,
<span class="hljs-attr">nice</span>: <span class="hljs-number">1480</span>,
<span class="hljs-attr">sys</span>: <span class="hljs-number">34920</span>,
<span class="hljs-attr">idle</span>: <span class="hljs-number">1072572010</span>,
<span class="hljs-attr">irq</span>: <span class="hljs-number">30</span>
}
}
]</code></pre>
<p>Because <code>nice</code> values are UNIX-specific, on Windows the <code>nice</code> values of all
processors are always 0.</p>
<h2>os.endianness()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L141">[src]</a><span><a class="mark" href="#os_os_endianness" id="os_os_endianness">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.9.4</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.endianness()</code> method returns a string identifying the endianness of the
CPU <em>for which the Node.js binary was compiled</em>.</p>
<p>Possible values are:</p>
<ul>
<li><code>'BE'</code> for big endian</li>
<li><code>'LE'</code> for little endian.</li>
</ul>
<h2>os.freemem()<span><a class="mark" href="#os_os_freemem" id="os_os_freemem">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li>
</ul>
<p>The <code>os.freemem()</code> method returns the amount of free system memory in bytes as
an integer.</p>
<h2>os.getPriority([pid])<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L224">[src]</a><span><a class="mark" href="#os_os_getpriority_pid" id="os_os_getpriority_pid">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v10.10.0</span>
</div>
<ul>
<li><code>pid</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a> The process ID to retrieve scheduling priority for.
<strong>Default</strong> <code>0</code>.</li>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li>
</ul>
<p>The <code>os.getPriority()</code> method returns the scheduling priority for the process
specified by <code>pid</code>. If <code>pid</code> is not provided, or is <code>0</code>, the priority of the
current process is returned.</p>
<h2>os.homedir()<span><a class="mark" href="#os_os_homedir" id="os_os_homedir">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v2.3.0</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.homedir()</code> method returns the home directory of the current user as a
string.</p>
<h2>os.hostname()<span><a class="mark" href="#os_os_hostname" id="os_os_hostname">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.hostname()</code> method returns the hostname of the operating system as a
string.</p>
<h2>os.loadavg()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L86">[src]</a><span><a class="mark" href="#os_os_loadavg" id="os_os_loadavg">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number[]></a></li>
</ul>
<p>The <code>os.loadavg()</code> method returns an array containing the 1, 5, and 15 minute
load averages.</p>
<p>The load average is a measure of system activity, calculated by the operating
system and expressed as a fractional number. As a rule of thumb, the load
average should ideally be less than the number of logical CPUs in the system.</p>
<p>The load average is a UNIX-specific concept with no real equivalent on
Windows platforms. On Windows, the return value is always <code>[0, 0, 0]</code>.</p>
<h2>os.networkInterfaces()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L195">[src]</a><span><a class="mark" href="#os_os_networkinterfaces" id="os_os_networkinterfaces">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.6.0</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></li>
</ul>
<p>The <code>os.networkInterfaces()</code> method returns an object containing only network
interfaces that have been assigned a network address.</p>
<p>Each key on the returned object identifies a network interface. The associated
value is an array of objects that each describe an assigned network address.</p>
<p>The properties available on the assigned network address object include:</p>
<ul>
<li><code>address</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> The assigned IPv4 or IPv6 address</li>
<li><code>netmask</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> The IPv4 or IPv6 network mask</li>
<li><code>family</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> Either <code>IPv4</code> or <code>IPv6</code></li>
<li><code>mac</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> The MAC address of the network interface</li>
<li><code>internal</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type" class="type"><boolean></a> <code>true</code> if the network interface is a loopback or
similar interface that is not remotely accessible; otherwise <code>false</code></li>
<li><code>scopeid</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><number></a> The numeric IPv6 scope ID (only specified when <code>family</code>
is <code>IPv6</code>)</li>
<li><code>cidr</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> The assigned IPv4 or IPv6 address with the routing prefix
in CIDR notation. If the <code>netmask</code> is invalid, this property is set
to <code>null</code>.</li>
</ul>
<!-- eslint-skip -->
<pre><code class="language-js">{
<span class="hljs-attr">lo</span>: [
{
<span class="hljs-attr">address</span>: <span class="hljs-string">'127.0.0.1'</span>,
<span class="hljs-attr">netmask</span>: <span class="hljs-string">'255.0.0.0'</span>,
<span class="hljs-attr">family</span>: <span class="hljs-string">'IPv4'</span>,
<span class="hljs-attr">mac</span>: <span class="hljs-string">'00:00:00:00:00:00'</span>,
<span class="hljs-attr">internal</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">cidr</span>: <span class="hljs-string">'127.0.0.1/8'</span>
},
{
<span class="hljs-attr">address</span>: <span class="hljs-string">'::1'</span>,
<span class="hljs-attr">netmask</span>: <span class="hljs-string">'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'</span>,
<span class="hljs-attr">family</span>: <span class="hljs-string">'IPv6'</span>,
<span class="hljs-attr">mac</span>: <span class="hljs-string">'00:00:00:00:00:00'</span>,
<span class="hljs-attr">internal</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">cidr</span>: <span class="hljs-string">'::1/128'</span>
}
],
<span class="hljs-attr">eth0</span>: [
{
<span class="hljs-attr">address</span>: <span class="hljs-string">'192.168.1.108'</span>,
<span class="hljs-attr">netmask</span>: <span class="hljs-string">'255.255.255.0'</span>,
<span class="hljs-attr">family</span>: <span class="hljs-string">'IPv4'</span>,
<span class="hljs-attr">mac</span>: <span class="hljs-string">'01:02:03:0a:0b:0c'</span>,
<span class="hljs-attr">internal</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">cidr</span>: <span class="hljs-string">'192.168.1.108/24'</span>
},
{
<span class="hljs-attr">address</span>: <span class="hljs-string">'fe80::a00:27ff:fe4e:66a1'</span>,
<span class="hljs-attr">netmask</span>: <span class="hljs-string">'ffff:ffff:ffff:ffff::'</span>,
<span class="hljs-attr">family</span>: <span class="hljs-string">'IPv6'</span>,
<span class="hljs-attr">mac</span>: <span class="hljs-string">'01:02:03:0a:0b:0c'</span>,
<span class="hljs-attr">internal</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">cidr</span>: <span class="hljs-string">'fe80::a00:27ff:fe4e:66a1/64'</span>
}
]
}</code></pre>
<h2>os.platform()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L115">[src]</a><span><a class="mark" href="#os_os_platform" id="os_os_platform">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.5.0</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.platform()</code> method returns a string identifying the operating system
platform as set during compile time of Node.js.</p>
<p>Currently possible values are:</p>
<ul>
<li><code>'aix'</code></li>
<li><code>'darwin'</code></li>
<li><code>'freebsd'</code></li>
<li><code>'linux'</code></li>
<li><code>'openbsd'</code></li>
<li><code>'sunos'</code></li>
<li><code>'win32'</code></li>
</ul>
<p>Equivalent to <a href="process.html#process_process_platform"><code>process.platform</code></a>.</p>
<p>The value <code>'android'</code> may also be returned if the Node.js is built on the
Android operating system. However, Android support in Node.js is considered
<a href="https://github.com/nodejs/node/blob/master/BUILDING.md#androidandroid-based-devices-eg-firefox-os">to be experimental</a> at this time.</p>
<h2>os.release()<span><a class="mark" href="#os_os_release" id="os_os_release">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.release()</code> method returns a string identifying the operating system
release.</p>
<p>On POSIX systems, the operating system release is determined by calling
<a href="https://linux.die.net/man/3/uname"></a><a href="http://man7.org/linux/man-pages/man3/uname.3.html"><code>uname(3)</code></a>. On Windows, <code>GetVersionExW()</code> is used. Please see
<a href="https://en.wikipedia.org/wiki/Uname#Examples">https://en.wikipedia.org/wiki/Uname#Examples</a> for more information.</p>
<h2>os.setPriority([pid, ]priority)<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L209">[src]</a><span><a class="mark" href="#os_os_setpriority_pid_priority" id="os_os_setpriority_pid_priority">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v10.10.0</span>
</div>
<ul>
<li><code>pid</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a> The process ID to set scheduling priority for.
<strong>Default</strong> <code>0</code>.</li>
<li><code>priority</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a> The scheduling priority to assign to the process.</li>
</ul>
<p>The <code>os.setPriority()</code> method attempts to set the scheduling priority for the
process specified by <code>pid</code>. If <code>pid</code> is not provided, or is <code>0</code>, the priority
of the current process is used.</p>
<p>The <code>priority</code> input must be an integer between <code>-20</code> (high priority) and <code>19</code>
(low priority). Due to differences between Unix priority levels and Windows
priority classes, <code>priority</code> is mapped to one of six priority constants in
<code>os.constants.priority</code>. When retrieving a process priority level, this range
mapping may cause the return value to be slightly different on Windows. To avoid
confusion, it is recommended to set <code>priority</code> to one of the priority constants.</p>
<p>On Windows setting priority to <code>PRIORITY_HIGHEST</code> requires elevated user,
otherwise the set priority will be silently reduced to <code>PRIORITY_HIGH</code>.</p>
<h2>os.tmpdir()<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L120">[src]</a><span><a class="mark" href="#os_os_tmpdir" id="os_os_tmpdir">#</a></span></h2>
<div class="api_metadata">
<details class="changelog"><summary>History</summary>
<table>
<tbody><tr><th>Version</th><th>Changes</th></tr>
<tr><td>v2.0.0</td>
<td><p>This function is now cross-platform consistent and no longer returns a path with a trailing slash on any platform</p></td></tr>
<tr><td>v0.9.9</td>
<td><p><span>Added in: v0.9.9</span></p></td></tr>
</tbody></table>
</details>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.tmpdir()</code> method returns a string specifying the operating system's
default directory for temporary files.</p>
<h2>os.totalmem()<span><a class="mark" href="#os_os_totalmem" id="os_os_totalmem">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li>
</ul>
<p>The <code>os.totalmem()</code> method returns the total amount of system memory in bytes
as an integer.</p>
<h2>os.type()<span><a class="mark" href="#os_os_type" id="os_os_type">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v0.3.3</span>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a></li>
</ul>
<p>The <code>os.type()</code> method returns a string identifying the operating system name
as returned by <a href="https://linux.die.net/man/3/uname"></a><a href="http://man7.org/linux/man-pages/man3/uname.3.html"><code>uname(3)</code></a>. For example, <code>'Linux'</code> on Linux, <code>'Darwin'</code> on
macOS, and <code>'Windows_NT'</code> on Windows.</p>
<p>Please see <a href="https://en.wikipedia.org/wiki/Uname#Examples">https://en.wikipedia.org/wiki/Uname#Examples</a> for additional
information about the output of running <a href="https://linux.die.net/man/3/uname"></a><a href="http://man7.org/linux/man-pages/man3/uname.3.html"><code>uname(3)</code></a> on various operating
systems.</p>
<h2>os.uptime()<span><a class="mark" href="#os_os_uptime" id="os_os_uptime">#</a></span></h2>
<div class="api_metadata">
<details class="changelog"><summary>History</summary>
<table>
<tbody><tr><th>Version</th><th>Changes</th></tr>
<tr><td>v10.0.0</td>
<td><p>The result of this function no longer contains a fraction component on Windows.</p></td></tr>
<tr><td>v0.3.3</td>
<td><p><span>Added in: v0.3.3</span></p></td></tr>
</tbody></table>
</details>
</div>
<ul>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type" class="type"><integer></a></li>
</ul>
<p>The <code>os.uptime()</code> method returns the system uptime in number of seconds.</p>
<h2>os.userInfo([options])<a class="srclink" href="https://github.com/runkitdev/node/blob/cf1ce2bcc1a88ef6ff1bf745a19913a69607fb02/lib/os.js#L239">[src]</a><span><a class="mark" href="#os_os_userinfo_options" id="os_os_userinfo_options">#</a></span></h2>
<div class="api_metadata">
<span>Added in: v6.0.0</span>
</div>
<ul>
<li>
<p><code>options</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></p>
<ul>
<li><code>encoding</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type" class="type"><string></a> Character encoding used to interpret resulting strings.
If <code>encoding</code> is set to <code>'buffer'</code>, the <code>username</code>, <code>shell</code>, and <code>homedir</code>
values will be <code>Buffer</code> instances. <strong>Default:</strong> <code>'utf8'</code>.</li>
</ul>
</li>
<li>Returns: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="type"><Object></a></li>
</ul>
<p>The <code>os.userInfo()</code> method returns information about the currently effective
user — on POSIX platforms, this is typically a subset of the password file. The
returned object includes the <code>username</code>, <code>uid</code>, <code>gid</code>, <code>shell</code>, and <code>homedir</code>.
On Windows, the <code>uid</code> and <code>gid</code> fields are <code>-1</code>, and <code>shell</code> is <code>null</code>.</p>
<p>The value of <code>homedir</code> returned by <code>os.userInfo()</code> is provided by the operating
system. This differs from the result of <code>os.homedir()</code>, which queries several
environment variables for the home directory before falling back to the
operating system response.</p>
<h2>OS Constants<span><a class="mark" href="#os_os_constants_1" id="os_os_constants_1">#</a></span></h2>
<p>The following constants are exported by <code>os.constants</code>.</p>
<p>Not all constants will be available on every operating system.</p>
<h3>Signal Constants<span><a class="mark" href="#os_signal_constants" id="os_signal_constants">#</a></span></h3>
<div class="api_metadata">
<details class="changelog"><summary>History</summary>
<table>
<tbody><tr><th>Version</th><th>Changes</th></tr>
<tr><td>v5.11.0</td>
<td><p>Added support for <code>SIGINFO</code>.</p></td></tr>
</tbody></table>
</details>
</div>
<p>The following signal constants are exported by <code>os.constants.signals</code>:</p>
<table>
<tbody><tr>
<th>Constant</th>
<th>Description</th>
</tr>
<tr>
<td><code>SIGHUP</code></td>
<td>Sent to indicate when a controlling terminal is closed or a parent
process exits.</td>
</tr>
<tr>
<td><code>SIGINT</code></td>
<td>Sent to indicate when a user wishes to interrupt a process
(<code>(Ctrl+C)</code>).</td>
</tr>
<tr>
<td><code>SIGQUIT</code></td>
<td>Sent to indicate when a user wishes to terminate a process and perform a
core dump.</td>
</tr>
<tr>
<td><code>SIGILL</code></td>
<td>Sent to a process to notify that it has attempted to perform an illegal,
malformed, unknown, or privileged instruction.</td>
</tr>
<tr>
<td><code>SIGTRAP</code></td>
<td>Sent to a process when an exception has occurred.</td>
</tr>
<tr>
<td><code>SIGABRT</code></td>
<td>Sent to a process to request that it abort.</td>
</tr>
<tr>
<td><code>SIGIOT</code></td>
<td>Synonym for <code>SIGABRT</code></td>
</tr>
<tr>
<td><code>SIGBUS</code></td>
<td>Sent to a process to notify that it has caused a bus error.</td>
</tr>
<tr>
<td><code>SIGFPE</code></td>
<td>Sent to a process to notify that it has performed an illegal arithmetic
operation.</td>
</tr>
<tr>
<td><code>SIGKILL</code></td>
<td>Sent to a process to terminate it immediately.</td>
</tr>
<tr>
<td><code>SIGUSR1</code> <code>SIGUSR2</code></td>
<td>Sent to a process to identify user-defined conditions.</td>
</tr>
<tr>
<td><code>SIGSEGV</code></td>
<td>Sent to a process to notify of a segmentation fault.</td>
</tr>
<tr>
<td><code>SIGPIPE</code></td>
<td>Sent to a process when it has attempted to write to a disconnected
pipe.</td>
</tr>
<tr>
<td><code>SIGALRM</code></td>
<td>Sent to a process when a system timer elapses.</td>
</tr>
<tr>
<td><code>SIGTERM</code></td>
<td>Sent to a process to request termination.</td>
</tr>
<tr>
<td><code>SIGCHLD</code></td>
<td>Sent to a process when a child process terminates.</td>
</tr>
<tr>
<td><code>SIGSTKFLT</code></td>
<td>Sent to a process to indicate a stack fault on a coprocessor.</td>
</tr>
<tr>
<td><code>SIGCONT</code></td>
<td>Sent to instruct the operating system to continue a paused process.</td>
</tr>
<tr>
<td><code>SIGSTOP</code></td>
<td>Sent to instruct the operating system to halt a process.</td>
</tr>
<tr>
<td><code>SIGTSTP</code></td>
<td>Sent to a process to request it to stop.</td>
</tr>
<tr>
<td><code>SIGBREAK</code></td>
<td>Sent to indicate when a user wishes to interrupt a process.</td>
</tr>
<tr>
<td><code>SIGTTIN</code></td>
<td>Sent to a process when it reads from the TTY while in the
background.</td>
</tr>
<tr>
<td><code>SIGTTOU</code></td>
<td>Sent to a process when it writes to the TTY while in the
background.</td>
</tr>
<tr>
<td><code>SIGURG</code></td>
<td>Sent to a process when a socket has urgent data to read.</td>
</tr>
<tr>
<td><code>SIGXCPU</code></td>
<td>Sent to a process when it has exceeded its limit on CPU usage.</td>
</tr>
<tr>
<td><code>SIGXFSZ</code></td>
<td>Sent to a process when it grows a file larger than the maximum
allowed.</td>
</tr>
<tr>
<td><code>SIGVTALRM</code></td>
<td>Sent to a process when a virtual timer has elapsed.</td>
</tr>
<tr>
<td><code>SIGPROF</code></td>
<td>Sent to a process when a system timer has elapsed.</td>
</tr>
<tr>
<td><code>SIGWINCH</code></td>
<td>Sent to a process when the controlling terminal has changed its
size.</td>
</tr>
<tr>
<td><code>SIGIO</code></td>
<td>Sent to a process when I/O is available.</td>
</tr>
<tr>
<td><code>SIGPOLL</code></td>
<td>Synonym for <code>SIGIO</code></td>
</tr>
<tr>
<td><code>SIGLOST</code></td>
<td>Sent to a process when a file lock has been lost.</td>
</tr>
<tr>
<td><code>SIGPWR</code></td>
<td>Sent to a process to notify of a power failure.</td>
</tr>
<tr>
<td><code>SIGINFO</code></td>
<td>Synonym for <code>SIGPWR</code></td>
</tr>
<tr>
<td><code>SIGSYS</code></td>
<td>Sent to a process to notify of a bad argument.</td>
</tr>
<tr>
<td><code>SIGUNUSED</code></td>
<td>Synonym for <code>SIGSYS</code></td>
</tr>
</tbody></table>
<h3>Error Constants<span><a class="mark" href="#os_error_constants" id="os_error_constants">#</a></span></h3>
<p>The following error constants are exported by <code>os.constants.errno</code>:</p>
<h4>POSIX Error Constants<span><a class="mark" href="#os_posix_error_constants" id="os_posix_error_constants">#</a></span></h4>
<table>
<tbody><tr>
<th>Constant</th>
<th>Description</th>
</tr>
<tr>
<td><code>E2BIG</code></td>
<td>Indicates that the list of arguments is longer than expected.</td>
</tr>
<tr>
<td><code>EACCES</code></td>
<td>Indicates that the operation did not have sufficient permissions.</td>
</tr>
<tr>
<td><code>EADDRINUSE</code></td>
<td>Indicates that the network address is already in use.</td>
</tr>
<tr>
<td><code>EADDRNOTAVAIL</code></td>
<td>Indicates that the network address is currently unavailable for
use.</td>
</tr>
<tr>
<td><code>EAFNOSUPPORT</code></td>
<td>Indicates that the network address family is not supported.</td>
</tr>
<tr>
<td><code>EAGAIN</code></td>
<td>Indicates that there is currently no data available and to try the
operation again later.</td>
</tr>
<tr>
<td><code>EALREADY</code></td>
<td>Indicates that the socket already has a pending connection in
progress.</td>
</tr>
<tr>
<td><code>EBADF</code></td>
<td>Indicates that a file descriptor is not valid.</td>
</tr>
<tr>
<td><code>EBADMSG</code></td>
<td>Indicates an invalid data message.</td>
</tr>
<tr>
<td><code>EBUSY</code></td>
<td>Indicates that a device or resource is busy.</td>
</tr>
<tr>
<td><code>ECANCELED</code></td>
<td>Indicates that an operation was canceled.</td>
</tr>
<tr>
<td><code>ECHILD</code></td>
<td>Indicates that there are no child processes.</td>
</tr>
<tr>
<td><code>ECONNABORTED</code></td>
<td>Indicates that the network connection has been aborted.</td>
</tr>
<tr>
<td><code>ECONNREFUSED</code></td>
<td>Indicates that the network connection has been refused.</td>
</tr>
<tr>
<td><code>ECONNRESET</code></td>
<td>Indicates that the network connection has been reset.</td>
</tr>
<tr>
<td><code>EDEADLK</code></td>
<td>Indicates that a resource deadlock has been avoided.</td>
</tr>
<tr>
<td><code>EDESTADDRREQ</code></td>
<td>Indicates that a destination address is required.</td>
</tr>
<tr>
<td><code>EDOM</code></td>
<td>Indicates that an argument is out of the domain of the function.</td>
</tr>
<tr>
<td><code>EDQUOT</code></td>
<td>Indicates that the disk quota has been exceeded.</td>
</tr>
<tr>
<td><code>EEXIST</code></td>
<td>Indicates that the file already exists.</td>
</tr>
<tr>
<td><code>EFAULT</code></td>
<td>Indicates an invalid pointer address.</td>
</tr>
<tr>
<td><code>EFBIG</code></td>
<td>Indicates that the file is too large.</td>
</tr>
<tr>
<td><code>EHOSTUNREACH</code></td>
<td>Indicates that the host is unreachable.</td>
</tr>
<tr>
<td><code>EIDRM</code></td>
<td>Indicates that the identifier has been removed.</td>
</tr>
<tr>
<td><code>EILSEQ</code></td>
<td>Indicates an illegal byte sequence.</td>
</tr>
<tr>
<td><code>EINPROGRESS</code></td>
<td>Indicates that an operation is already in progress.</td>
</tr>
<tr>
<td><code>EINTR</code></td>
<td>Indicates that a function call was interrupted.</td>
</tr>
<tr>
<td><code>EINVAL</code></td>
<td>Indicates that an invalid argument was provided.</td>
</tr>
<tr>
<td><code>EIO</code></td>
<td>Indicates an otherwise unspecified I/O error.</td>
</tr>
<tr>
<td><code>EISCONN</code></td>
<td>Indicates that the socket is connected.</td>
</tr>
<tr>
<td><code>EISDIR</code></td>
<td>Indicates that the path is a directory.</td>
</tr>
<tr>
<td><code>ELOOP</code></td>
<td>Indicates too many levels of symbolic links in a path.</td>
</tr>
<tr>
<td><code>EMFILE</code></td>
<td>Indicates that there are too many open files.</td>
</tr>
<tr>
<td><code>EMLINK</code></td>
<td>Indicates that there are too many hard links to a file.</td>
</tr>
<tr>
<td><code>EMSGSIZE</code></td>
<td>Indicates that the provided message is too long.</td>
</tr>
<tr>
<td><code>EMULTIHOP</code></td>
<td>Indicates that a multihop was attempted.</td>
</tr>
<tr>
<td><code>ENAMETOOLONG</code></td>
<td>Indicates that the filename is too long.</td>
</tr>
<tr>
<td><code>ENETDOWN</code></td>
<td>Indicates that the network is down.</td>
</tr>
<tr>
<td><code>ENETRESET</code></td>
<td>Indicates that the connection has been aborted by the network.</td>
</tr>
<tr>
<td><code>ENETUNREACH</code></td>
<td>Indicates that the network is unreachable.</td>
</tr>
<tr>
<td><code>ENFILE</code></td>
<td>Indicates too many open files in the system.</td>
</tr>
<tr>
<td><code>ENOBUFS</code></td>
<td>Indicates that no buffer space is available.</td>
</tr>
<tr>
<td><code>ENODATA</code></td>
<td>Indicates that no message is available on the stream head read
queue.</td>
</tr>
<tr>
<td><code>ENODEV</code></td>
<td>Indicates that there is no such device.</td>
</tr>
<tr>
<td><code>ENOENT</code></td>
<td>Indicates that there is no such file or directory.</td>
</tr>
<tr>
<td><code>ENOEXEC</code></td>
<td>Indicates an exec format error.</td>
</tr>
<tr>
<td><code>ENOLCK</code></td>
<td>Indicates that there are no locks available.</td>
</tr>
<tr>
<td><code>ENOLINK</code></td>
<td>Indications that a link has been severed.</td>
</tr>
<tr>
<td><code>ENOMEM</code></td>
<td>Indicates that there is not enough space.</td>
</tr>
<tr>
<td><code>ENOMSG</code></td>
<td>Indicates that there is no message of the desired type.</td>
</tr>
<tr>
<td><code>ENOPROTOOPT</code></td>
<td>Indicates that a given protocol is not available.</td>
</tr>
<tr>
<td><code>ENOSPC</code></td>
<td>Indicates that there is no space available on the device.</td>
</tr>
<tr>
<td><code>ENOSR</code></td>
<td>Indicates that there are no stream resources available.</td>
</tr>
<tr>
<td><code>ENOSTR</code></td>
<td>Indicates that a given resource is not a stream.</td>
</tr>
<tr>
<td><code>ENOSYS</code></td>
<td>Indicates that a function has not been implemented.</td>
</tr>
<tr>
<td><code>ENOTCONN</code></td>
<td>Indicates that the socket is not connected.</td>
</tr>
<tr>
<td><code>ENOTDIR</code></td>
<td>Indicates that the path is not a directory.</td>
</tr>
<tr>
<td><code>ENOTEMPTY</code></td>
<td>Indicates that the directory is not empty.</td>
</tr>