Move doc/ to documentation/api/
[project/luci.git] / documentation / api / modules / nixio.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5     <title>Reference</title>
6     <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7         <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
8 </head>
9
10 <body>
11 <div id="container">
12
13 <div id="product">
14         <div id="product_logo"></div>
15         <div id="product_name"><big><b></b></big></div>
16         <div id="product_description"></div>
17 </div> <!-- id="product" -->
18
19 <div id="main">
20
21 <div id="navigation">
22
23
24 <h1>LuaDoc</h1>
25 <ul>
26         
27         <li><a href="../index.html">Index</a></li>
28         
29 </ul>
30
31
32 <!-- Module list -->
33
34 <h1>Modules</h1>
35 <ul>
36
37         <li>
38                 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
39         </li>
40
41         <li>
42                 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
43         </li>
44
45         <li>
46                 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
47         </li>
48
49         <li>
50                 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
51         </li>
52
53         <li>
54                 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
55         </li>
56
57         <li>
58                 <a href="../modules/luci.i18n.html">luci.i18n</a>
59         </li>
60
61         <li>
62                 <a href="../modules/luci.ip.html">luci.ip</a>
63         </li>
64
65         <li>
66                 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
67         </li>
68
69         <li>
70                 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
71         </li>
72
73         <li>
74                 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
75         </li>
76
77         <li>
78                 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
79         </li>
80
81         <li>
82                 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
83         </li>
84
85         <li>
86                 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
87         </li>
88
89         <li>
90                 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
91         </li>
92
93         <li>
94                 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
95         </li>
96
97         <li>
98                 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
99         </li>
100
101         <li><strong>nixio</strong></li>
102         
103         <li>
104                 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
105         </li>
106
107         <li>
108                 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
109         </li>
110
111         <li>
112                 <a href="../modules/nixio.File.html">nixio.File</a>
113         </li>
114
115         <li>
116                 <a href="../modules/nixio.README.html">nixio.README</a>
117         </li>
118
119         <li>
120                 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
121         </li>
122
123         <li>
124                 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
125         </li>
126
127         <li>
128                 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
129         </li>
130
131         <li>
132                 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
133         </li>
134
135         <li>
136                 <a href="../modules/nixio.bin.html">nixio.bin</a>
137         </li>
138
139         <li>
140                 <a href="../modules/nixio.bit.html">nixio.bit</a>
141         </li>
142
143         <li>
144                 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
145         </li>
146
147         <li>
148                 <a href="../modules/nixio.fs.html">nixio.fs</a>
149         </li>
150
151 </ul>
152
153
154
155 <!-- File list -->
156
157
158
159
160
161
162
163 </div><!-- id="navigation" -->
164
165 <div id="content">
166
167 <h1>Class <code>nixio</code></h1>
168
169 <p>
170  General POSIX IO library.</p>
171
172
173
174
175
176
177
178 <h2>Functions</h2>
179 <table class="function_list">
180
181         <tr>
182         <td class="name" nowrap><a href="#nixio.bind">bind</a>&nbsp;(host, port, family, socktype)</td>
183         <td class="summary">
184  Create a new socket and bind it to a network address.</td>
185         </tr>
186
187         <tr>
188         <td class="name" nowrap><a href="#nixio.chdir">chdir</a>&nbsp;(path)</td>
189         <td class="summary">
190  Change the working directory.</td>
191         </tr>
192
193         <tr>
194         <td class="name" nowrap><a href="#nixio.closelog">closelog</a>&nbsp;()</td>
195         <td class="summary">
196  (POSIX) Close the connection to the system logger.</td>
197         </tr>
198
199         <tr>
200         <td class="name" nowrap><a href="#nixio.connect">connect</a>&nbsp;(host, port, family, socktype)</td>
201         <td class="summary">
202  Create a new socket and connect to a network address.</td>
203         </tr>
204
205         <tr>
206         <td class="name" nowrap><a href="#nixio.crypt">crypt</a>&nbsp;(key, salt)</td>
207         <td class="summary">
208  (POSIX) Encrypt a user password.</td>
209         </tr>
210
211         <tr>
212         <td class="name" nowrap><a href="#nixio.dup">dup</a>&nbsp;(oldfd, newfd)</td>
213         <td class="summary">
214  Duplicate a file descriptor.</td>
215         </tr>
216
217         <tr>
218         <td class="name" nowrap><a href="#nixio.errno">errno</a>&nbsp;()</td>
219         <td class="summary">
220  Get the last system error code.</td>
221         </tr>
222
223         <tr>
224         <td class="name" nowrap><a href="#nixio.exec">exec</a>&nbsp;(executable, ...)</td>
225         <td class="summary">
226  Execute a file to replace the current process.</td>
227         </tr>
228
229         <tr>
230         <td class="name" nowrap><a href="#nixio.exece">exece</a>&nbsp;(executable, arguments, environment)</td>
231         <td class="summary">
232  Execute a file with a custom environment to replace the current process.</td>
233         </tr>
234
235         <tr>
236         <td class="name" nowrap><a href="#nixio.execp">execp</a>&nbsp;(executable, ...)</td>
237         <td class="summary">
238  Invoke the shell and execute a file to replace the current process.</td>
239         </tr>
240
241         <tr>
242         <td class="name" nowrap><a href="#nixio.fork">fork</a>&nbsp;()</td>
243         <td class="summary">
244  (POSIX) Clone the current process.</td>
245         </tr>
246
247         <tr>
248         <td class="name" nowrap><a href="#nixio.getaddrinfo">getaddrinfo</a>&nbsp;(host, family, service)</td>
249         <td class="summary">
250  Look up a hostname and service via DNS.</td>
251         </tr>
252
253         <tr>
254         <td class="name" nowrap><a href="#nixio.getcwd">getcwd</a>&nbsp;()</td>
255         <td class="summary">
256  Get the current working directory.</td>
257         </tr>
258
259         <tr>
260         <td class="name" nowrap><a href="#nixio.getenv">getenv</a>&nbsp;(variable)</td>
261         <td class="summary">
262  Get the current environment table or a specific environment variable.</td>
263         </tr>
264
265         <tr>
266         <td class="name" nowrap><a href="#nixio.getgid">getgid</a>&nbsp;()</td>
267         <td class="summary">
268  (POSIX) Get the group id of the current process.</td>
269         </tr>
270
271         <tr>
272         <td class="name" nowrap><a href="#nixio.getgr">getgr</a>&nbsp;(group)</td>
273         <td class="summary">
274  (POSIX) Get all or a specific user group.</td>
275         </tr>
276
277         <tr>
278         <td class="name" nowrap><a href="#nixio.getifaddrs">getifaddrs</a>&nbsp;()</td>
279         <td class="summary">
280  (Linux, BSD) Get a list of available network interfaces and their addresses.</td>
281         </tr>
282
283         <tr>
284         <td class="name" nowrap><a href="#nixio.getnameinfo">getnameinfo</a>&nbsp;(ipaddr)</td>
285         <td class="summary">
286  Reverse look up an IP-Address via DNS.</td>
287         </tr>
288
289         <tr>
290         <td class="name" nowrap><a href="#nixio.getpid">getpid</a>&nbsp;()</td>
291         <td class="summary">
292  Get the ID of the current process.</td>
293         </tr>
294
295         <tr>
296         <td class="name" nowrap><a href="#nixio.getppid">getppid</a>&nbsp;()</td>
297         <td class="summary">
298  (POSIX) Get the parent process id of the current process.</td>
299         </tr>
300
301         <tr>
302         <td class="name" nowrap><a href="#nixio.getproto">getproto</a>&nbsp;(proto)</td>
303         <td class="summary">
304  Get all or a specifc proto entry.</td>
305         </tr>
306
307         <tr>
308         <td class="name" nowrap><a href="#nixio.getprotobyname">getprotobyname</a>&nbsp;(name)</td>
309         <td class="summary">
310  Get protocol entry by name.</td>
311         </tr>
312
313         <tr>
314         <td class="name" nowrap><a href="#nixio.getprotobynumber">getprotobynumber</a>&nbsp;(proto)</td>
315         <td class="summary">
316  Get protocol entry by number.</td>
317         </tr>
318
319         <tr>
320         <td class="name" nowrap><a href="#nixio.getpw">getpw</a>&nbsp;(user)</td>
321         <td class="summary">
322  (POSIX) Get all or a specific user account.</td>
323         </tr>
324
325         <tr>
326         <td class="name" nowrap><a href="#nixio.getsp">getsp</a>&nbsp;(user)</td>
327         <td class="summary">
328  (Linux, Solaris) Get all or a specific shadow password entry.</td>
329         </tr>
330
331         <tr>
332         <td class="name" nowrap><a href="#nixio.getuid">getuid</a>&nbsp;()</td>
333         <td class="summary">
334  (POSIX) Get the user id of the current process.</td>
335         </tr>
336
337         <tr>
338         <td class="name" nowrap><a href="#nixio.kill">kill</a>&nbsp;(target, signal)</td>
339         <td class="summary">
340  (POSIX) Send a signal to one or more processes.</td>
341         </tr>
342
343         <tr>
344         <td class="name" nowrap><a href="#nixio.nanosleep">nanosleep</a>&nbsp;(seconds, nanoseconds)</td>
345         <td class="summary">
346  Sleep for a specified amount of time.</td>
347         </tr>
348
349         <tr>
350         <td class="name" nowrap><a href="#nixio.nice">nice</a>&nbsp;(nice)</td>
351         <td class="summary">
352  (POSIX) Change priority of current process.</td>
353         </tr>
354
355         <tr>
356         <td class="name" nowrap><a href="#nixio.open">open</a>&nbsp;(path, flags, mode)</td>
357         <td class="summary">
358  Open a file.</td>
359         </tr>
360
361         <tr>
362         <td class="name" nowrap><a href="#nixio.open_flags">open_flags</a>&nbsp;(flag1, ...)</td>
363         <td class="summary">
364  Generate flags for a call to open().</td>
365         </tr>
366
367         <tr>
368         <td class="name" nowrap><a href="#nixio.openlog">openlog</a>&nbsp;(ident, flag1, ...)</td>
369         <td class="summary">
370  (POSIX) Open a connection to the system logger.</td>
371         </tr>
372
373         <tr>
374         <td class="name" nowrap><a href="#nixio.pipe">pipe</a>&nbsp;()</td>
375         <td class="summary">
376  Create a pipe.</td>
377         </tr>
378
379         <tr>
380         <td class="name" nowrap><a href="#nixio.poll">poll</a>&nbsp;(fds, timeout)</td>
381         <td class="summary">
382  Wait for some event on a file descriptor.</td>
383         </tr>
384
385         <tr>
386         <td class="name" nowrap><a href="#nixio.poll_flags">poll_flags</a>&nbsp;(mode1, ...)</td>
387         <td class="summary">
388  Generate events-bitfield or parse revents-bitfield for poll.</td>
389         </tr>
390
391         <tr>
392         <td class="name" nowrap><a href="#nixio.sendfile">sendfile</a>&nbsp;(socket, file, length)</td>
393         <td class="summary">
394  (POSIX) Send data from a file to a socket in kernel-space.</td>
395         </tr>
396
397         <tr>
398         <td class="name" nowrap><a href="#nixio.setenv">setenv</a>&nbsp;(variable, value)</td>
399         <td class="summary">
400  Set or unset a environment variable.</td>
401         </tr>
402
403         <tr>
404         <td class="name" nowrap><a href="#nixio.setgid">setgid</a>&nbsp;(gid)</td>
405         <td class="summary">
406  (POSIX) Set the group id of the current process.</td>
407         </tr>
408
409         <tr>
410         <td class="name" nowrap><a href="#nixio.setlogmask">setlogmask</a>&nbsp;(priority)</td>
411         <td class="summary">
412  (POSIX) Set the logmask of the system logger for current process.</td>
413         </tr>
414
415         <tr>
416         <td class="name" nowrap><a href="#nixio.setsid">setsid</a>&nbsp;()</td>
417         <td class="summary">
418  (POSIX) Create a new session and set the process group ID.</td>
419         </tr>
420
421         <tr>
422         <td class="name" nowrap><a href="#nixio.setuid">setuid</a>&nbsp;(gid)</td>
423         <td class="summary">
424  (POSIX) Set the user id of the current process.</td>
425         </tr>
426
427         <tr>
428         <td class="name" nowrap><a href="#nixio.signal">signal</a>&nbsp;(signal, handler)</td>
429         <td class="summary">
430  Ignore or use set the default handler for a signal.</td>
431         </tr>
432
433         <tr>
434         <td class="name" nowrap><a href="#nixio.socket">socket</a>&nbsp;(domain, type)</td>
435         <td class="summary">
436  Create a new socket.</td>
437         </tr>
438
439         <tr>
440         <td class="name" nowrap><a href="#nixio.splice">splice</a>&nbsp;(fdin, fdout, length, flags)</td>
441         <td class="summary">
442  (Linux) Send data from / to a pipe in kernel-space.</td>
443         </tr>
444
445         <tr>
446         <td class="name" nowrap><a href="#nixio.splice_flags">splice_flags</a>&nbsp;(flag1, ...)</td>
447         <td class="summary">
448  (Linux) Generate a flag bitfield for a call to splice.</td>
449         </tr>
450
451         <tr>
452         <td class="name" nowrap><a href="#nixio.strerror">strerror</a>&nbsp;(errno)</td>
453         <td class="summary">
454  Get the error message for the corresponding error code.</td>
455         </tr>
456
457         <tr>
458         <td class="name" nowrap><a href="#nixio.sysinfo">sysinfo</a>&nbsp;()</td>
459         <td class="summary">
460  (Linux) Get overall system statistics.</td>
461         </tr>
462
463         <tr>
464         <td class="name" nowrap><a href="#nixio.syslog">syslog</a>&nbsp;(priority)</td>
465         <td class="summary">
466  (POSIX) Write a message to the system logger.</td>
467         </tr>
468
469         <tr>
470         <td class="name" nowrap><a href="#nixio.times">times</a>&nbsp;()</td>
471         <td class="summary">
472  (POSIX) Get process times.</td>
473         </tr>
474
475         <tr>
476         <td class="name" nowrap><a href="#nixio.tls">tls</a>&nbsp;(mode)</td>
477         <td class="summary">
478  Create a new TLS context.</td>
479         </tr>
480
481         <tr>
482         <td class="name" nowrap><a href="#nixio.umask">umask</a>&nbsp;(mask)</td>
483         <td class="summary">
484  Sets the file mode creation mask.</td>
485         </tr>
486
487         <tr>
488         <td class="name" nowrap><a href="#nixio.uname">uname</a>&nbsp;()</td>
489         <td class="summary">
490  (POSIX) Get information about current system and kernel.</td>
491         </tr>
492
493         <tr>
494         <td class="name" nowrap><a href="#nixio.waitpid">waitpid</a>&nbsp;(pid, flag1, ...)</td>
495         <td class="summary">
496  (POSIX) Wait for a process to change state.</td>
497         </tr>
498
499 </table>
500
501
502
503
504
505
506 <br/>
507 <br/>
508
509
510 <h2><a name="functions"></a>Functions</h2>
511 <dl class="function">
512
513
514
515 <dt><a name="nixio.bind"></a><strong>bind</strong>&nbsp;(host, port, family, socktype)</dt>
516 <dd>
517
518  Create a new socket and bind it to a network address. 
519  This function is a shortcut for calling nixio.socket and then bind() 
520  on the socket object.
521
522
523 <h3>Parameters</h3>
524 <ul>
525         
526         <li>
527           host: Hostname or IP-Address (optional, default: all addresses)
528         </li>
529         
530         <li>
531           port: Port or service description
532         </li>
533         
534         <li>
535           family: Address family [<strong>"any"</strong>, "inet", "inet6"]
536         </li>
537         
538         <li>
539           socktype: Socket Type [<strong>"stream"</strong>, "dgram"]
540         </li>
541         
542 </ul>
543
544
545
546
547 <h3>Usage</h3>
548 <ul>
549         
550         <li>This functions calls getaddrinfo(), socket(), 
551  setsockopt() and bind() but NOT listen().
552         
553         <li>The <em>reuseaddr</em>-option is automatically set before binding.
554         
555 </ul>
556
557
558
559 <h3>Return value:</h3>
560 Socket Object
561
562
563
564 </dd>
565
566
567
568
569 <dt><a name="nixio.chdir"></a><strong>chdir</strong>&nbsp;(path)</dt>
570 <dd>
571
572  Change the working directory.
573
574
575 <h3>Parameters</h3>
576 <ul>
577         
578         <li>
579           path: New working directory
580         </li>
581         
582 </ul>
583
584
585
586
587
588
589 <h3>Return value:</h3>
590 true
591
592
593
594 </dd>
595
596
597
598
599 <dt><a name="nixio.closelog"></a><strong>closelog</strong>&nbsp;()</dt>
600 <dd>
601
602  (POSIX) Close the connection to the system logger.
603
604
605
606
607
608
609
610
611
612 </dd>
613
614
615
616
617 <dt><a name="nixio.connect"></a><strong>connect</strong>&nbsp;(host, port, family, socktype)</dt>
618 <dd>
619
620  Create a new socket and connect to a network address. 
621  This function is a shortcut for calling nixio.socket and then connect() 
622  on the socket object.
623
624
625 <h3>Parameters</h3>
626 <ul>
627         
628         <li>
629           host: Hostname or IP-Address (optional, default: localhost)
630         </li>
631         
632         <li>
633           port: Port or service description
634         </li>
635         
636         <li>
637           family: Address family [<strong>"any"</strong>, "inet", "inet6"]
638         </li>
639         
640         <li>
641           socktype: Socket Type [<strong>"stream"</strong>, "dgram"]
642         </li>
643         
644 </ul>
645
646
647
648
649 <h3>Usage:</h3>
650 This functions calls getaddrinfo(), socket() and connect().
651
652
653
654 <h3>Return value:</h3>
655 Socket Object
656
657
658
659 </dd>
660
661
662
663
664 <dt><a name="nixio.crypt"></a><strong>crypt</strong>&nbsp;(key, salt)</dt>
665 <dd>
666
667  (POSIX) Encrypt a user password.
668
669
670 <h3>Parameters</h3>
671 <ul>
672         
673         <li>
674           key: Key
675         </li>
676         
677         <li>
678           salt: Salt
679         </li>
680         
681 </ul>
682
683
684
685
686
687
688 <h3>Return value:</h3>
689 password hash
690
691
692
693 </dd>
694
695
696
697
698 <dt><a name="nixio.dup"></a><strong>dup</strong>&nbsp;(oldfd, newfd)</dt>
699 <dd>
700
701  Duplicate a file descriptor.
702
703
704 <h3>Parameters</h3>
705 <ul>
706         
707         <li>
708           oldfd: Old descriptor [File Object, Socket Object (POSIX only)]
709         </li>
710         
711         <li>
712           newfd: New descriptor to serve as copy (optional)
713         </li>
714         
715 </ul>
716
717
718
719
720 <h3>Usage:</h3>
721 This funcation calls dup2() if <em>newfd</em> is set, otherwise dup().
722
723
724
725 <h3>Return value:</h3>
726 File Object of new descriptor
727
728
729
730 </dd>
731
732
733
734
735 <dt><a name="nixio.errno"></a><strong>errno</strong>&nbsp;()</dt>
736 <dd>
737
738  Get the last system error code.
739
740
741
742
743
744
745
746 <h3>Return value:</h3>
747 Error code
748
749
750
751 </dd>
752
753
754
755
756 <dt><a name="nixio.exec"></a><strong>exec</strong>&nbsp;(executable, ...)</dt>
757 <dd>
758
759  Execute a file to replace the current process.
760
761
762 <h3>Parameters</h3>
763 <ul>
764         
765         <li>
766           executable: Executable
767         </li>
768         
769         <li>
770           ...: Parameters
771         </li>
772         
773 </ul>
774
775
776
777
778 <h3>Usage</h3>
779 <ul>
780         
781         <li>The name of the executable is automatically passed as argv[0]
782         
783         <li>This function does not return on success.
784         
785 </ul>
786
787
788
789
790
791 </dd>
792
793
794
795
796 <dt><a name="nixio.exece"></a><strong>exece</strong>&nbsp;(executable, arguments, environment)</dt>
797 <dd>
798
799  Execute a file with a custom environment to replace the current process.
800
801
802 <h3>Parameters</h3>
803 <ul>
804         
805         <li>
806           executable: Executable
807         </li>
808         
809         <li>
810           arguments: Argument Table
811         </li>
812         
813         <li>
814           environment: Environment Table (optional)
815         </li>
816         
817 </ul>
818
819
820
821
822 <h3>Usage</h3>
823 <ul>
824         
825         <li>The name of the executable is automatically passed as argv[0]
826         
827         <li>This function does not return on success.
828         
829 </ul>
830
831
832
833
834
835 </dd>
836
837
838
839
840 <dt><a name="nixio.execp"></a><strong>execp</strong>&nbsp;(executable, ...)</dt>
841 <dd>
842
843  Invoke the shell and execute a file to replace the current process.
844
845
846 <h3>Parameters</h3>
847 <ul>
848         
849         <li>
850           executable: Executable
851         </li>
852         
853         <li>
854           ...: Parameters
855         </li>
856         
857 </ul>
858
859
860
861
862 <h3>Usage</h3>
863 <ul>
864         
865         <li>The name of the executable is automatically passed as argv[0]
866         
867         <li>This function does not return on success.
868         
869 </ul>
870
871
872
873
874
875 </dd>
876
877
878
879
880 <dt><a name="nixio.fork"></a><strong>fork</strong>&nbsp;()</dt>
881 <dd>
882
883  (POSIX) Clone the current process.
884
885
886
887
888
889
890
891 <h3>Return value:</h3>
892 the child process id for the parent process, 0 for the child process
893
894
895
896 </dd>
897
898
899
900
901 <dt><a name="nixio.getaddrinfo"></a><strong>getaddrinfo</strong>&nbsp;(host, family, service)</dt>
902 <dd>
903
904  Look up a hostname and service via DNS.
905
906
907 <h3>Parameters</h3>
908 <ul>
909         
910         <li>
911           host: hostname to lookup      (optional)
912         </li>
913         
914         <li>
915           family: address family [<strong>"any"</strong>, "inet", "inet6"]  
916         </li>
917         
918         <li>
919           service: service name or port (optional)
920         </li>
921         
922 </ul>
923
924
925
926
927
928
929 <h3>Return value:</h3>
930 Table containing one or more tables containing: <ul> 
931  <li>family = ["inet", "inet6"]</li> 
932  <li>socktype = ["stream", "dgram", "raw"]</li> 
933  <li>address = Resolved IP-Address</li> 
934  <li>port = Resolved Port (if service was given)</li> 
935  </ul>
936
937
938
939 </dd>
940
941
942
943
944 <dt><a name="nixio.getcwd"></a><strong>getcwd</strong>&nbsp;()</dt>
945 <dd>
946
947  Get the current working directory.
948
949
950
951
952
953
954
955 <h3>Return value:</h3>
956 workign directory
957
958
959
960 </dd>
961
962
963
964
965 <dt><a name="nixio.getenv"></a><strong>getenv</strong>&nbsp;(variable)</dt>
966 <dd>
967
968  Get the current environment table or a specific environment variable.
969
970
971 <h3>Parameters</h3>
972 <ul>
973         
974         <li>
975           variable: Variable (optional)
976         </li>
977         
978 </ul>
979
980
981
982
983
984
985 <h3>Return value:</h3>
986 environment table or single environment variable
987
988
989
990 </dd>
991
992
993
994
995 <dt><a name="nixio.getgid"></a><strong>getgid</strong>&nbsp;()</dt>
996 <dd>
997
998  (POSIX) Get the group id of the current process.
999
1000
1001
1002
1003
1004
1005
1006 <h3>Return value:</h3>
1007 process group id
1008
1009
1010
1011 </dd>
1012
1013
1014
1015
1016 <dt><a name="nixio.getgr"></a><strong>getgr</strong>&nbsp;(group)</dt>
1017 <dd>
1018
1019  (POSIX) Get all or a specific user group.
1020
1021
1022 <h3>Parameters</h3>
1023 <ul>
1024         
1025         <li>
1026           group: Group ID or groupname (optional)
1027         </li>
1028         
1029 </ul>
1030
1031
1032
1033
1034
1035
1036 <h3>Return value:</h3>
1037 Table containing: <ul> 
1038  <li>name = Group Name</li> 
1039  <li>gid = Group ID</li> 
1040  <li>passwd = Password</li> 
1041  <li>mem = {Member #1, Member #2, ...}</li> 
1042  </ul>
1043
1044
1045
1046 </dd>
1047
1048
1049
1050
1051 <dt><a name="nixio.getifaddrs"></a><strong>getifaddrs</strong>&nbsp;()</dt>
1052 <dd>
1053
1054  (Linux, BSD) Get a list of available network interfaces and their addresses.
1055
1056
1057
1058
1059
1060
1061
1062 <h3>Return value:</h3>
1063 Table containing one or more tables containing: <ul> 
1064  <li>name = Interface Name</li> 
1065  <li>family = ["inet", "inet6", "packet"]</li> 
1066  <li>addr = Interface Address (IPv4, IPv6, MAC, ...)</li> 
1067  <li>broadaddr = Broadcast Address</li> 
1068  <li>dstaddr = Destination Address (Point-to-Point)</li> 
1069  <li>netmask = Netmask (if available)</li> 
1070  <li>prefix = Prefix (if available)</li> 
1071  <li>flags = Table of interface flags (up, multicast, loopback, ...)</li> 
1072  <li>data = Statistics (Linux, "packet"-family)</li> 
1073  <li>hatype = Hardware Type Identifier (Linix, "packet"-family)</li> 
1074  <li>ifindex = Interface Index (Linux, "packet"-family)</li> 
1075  </ul>
1076
1077
1078
1079 </dd>
1080
1081
1082
1083
1084 <dt><a name="nixio.getnameinfo"></a><strong>getnameinfo</strong>&nbsp;(ipaddr)</dt>
1085 <dd>
1086
1087  Reverse look up an IP-Address via DNS.
1088
1089
1090 <h3>Parameters</h3>
1091 <ul>
1092         
1093         <li>
1094           ipaddr: IPv4 or IPv6-Address
1095         </li>
1096         
1097 </ul>
1098
1099
1100
1101
1102
1103
1104 <h3>Return value:</h3>
1105 FQDN
1106
1107
1108
1109 </dd>
1110
1111
1112
1113
1114 <dt><a name="nixio.getpid"></a><strong>getpid</strong>&nbsp;()</dt>
1115 <dd>
1116
1117  Get the ID of the current process.
1118
1119
1120
1121
1122
1123
1124
1125 <h3>Return value:</h3>
1126 process id
1127
1128
1129
1130 </dd>
1131
1132
1133
1134
1135 <dt><a name="nixio.getppid"></a><strong>getppid</strong>&nbsp;()</dt>
1136 <dd>
1137
1138  (POSIX) Get the parent process id of the current process.
1139
1140
1141
1142
1143
1144
1145
1146 <h3>Return value:</h3>
1147 parent process id
1148
1149
1150
1151 </dd>
1152
1153
1154
1155
1156 <dt><a name="nixio.getproto"></a><strong>getproto</strong>&nbsp;(proto)</dt>
1157 <dd>
1158
1159  Get all or a specifc proto entry.
1160
1161
1162 <h3>Parameters</h3>
1163 <ul>
1164         
1165         <li>
1166           proto: protocol number or name to lookup (optional)
1167         </li>
1168         
1169 </ul>
1170
1171
1172
1173
1174
1175
1176 <h3>Return value:</h3>
1177 Table (or if no parameter is given, a table of tables) 
1178                   containing the following fields: <ul> 
1179  <li>name = Protocol Name</li> 
1180  <li>proto = Protocol Number</li> 
1181  <li>aliases = Table of alias names</li> 
1182  </ul>
1183
1184
1185
1186 </dd>
1187
1188
1189
1190
1191 <dt><a name="nixio.getprotobyname"></a><strong>getprotobyname</strong>&nbsp;(name)</dt>
1192 <dd>
1193
1194  Get protocol entry by name.
1195
1196
1197 <h3>Parameters</h3>
1198 <ul>
1199         
1200         <li>
1201           name: protocol name to lookup
1202         </li>
1203         
1204 </ul>
1205
1206
1207
1208
1209 <h3>Usage:</h3>
1210 This function returns nil if the given protocol is unknown.
1211
1212
1213
1214 <h3>Return value:</h3>
1215 Table containing the following fields: <ul> 
1216  <li>name = Protocol Name</li> 
1217  <li>proto = Protocol Number</li> 
1218  <li>aliases = Table of alias names</li> 
1219  </ul>
1220
1221
1222
1223 </dd>
1224
1225
1226
1227
1228 <dt><a name="nixio.getprotobynumber"></a><strong>getprotobynumber</strong>&nbsp;(proto)</dt>
1229 <dd>
1230
1231  Get protocol entry by number.
1232
1233
1234 <h3>Parameters</h3>
1235 <ul>
1236         
1237         <li>
1238           proto: protocol number to lookup
1239         </li>
1240         
1241 </ul>
1242
1243
1244
1245
1246 <h3>Usage:</h3>
1247 This function returns nil if the given protocol is unknown.
1248
1249
1250
1251 <h3>Return value:</h3>
1252 Table containing the following fields: <ul> 
1253  <li>name = Protocol Name</li> 
1254  <li>proto = Protocol Number</li> 
1255  <li>aliases = Table of alias names</li> 
1256  </ul>
1257
1258
1259
1260 </dd>
1261
1262
1263
1264
1265 <dt><a name="nixio.getpw"></a><strong>getpw</strong>&nbsp;(user)</dt>
1266 <dd>
1267
1268  (POSIX) Get all or a specific user account.
1269
1270
1271 <h3>Parameters</h3>
1272 <ul>
1273         
1274         <li>
1275           user: User ID or username (optional)
1276         </li>
1277         
1278 </ul>
1279
1280
1281
1282
1283
1284
1285 <h3>Return value:</h3>
1286 Table containing: <ul> 
1287  <li>name = Name</li> 
1288  <li>uid = ID</li> 
1289  <li>gid = Group ID</li> 
1290  <li>passwd = Password</li> 
1291  <li>dir = Home directory</li> 
1292  <li>gecos = Information</li> 
1293  <li>shell = Shell</li> 
1294  </ul>
1295
1296
1297
1298 </dd>
1299
1300
1301
1302
1303 <dt><a name="nixio.getsp"></a><strong>getsp</strong>&nbsp;(user)</dt>
1304 <dd>
1305
1306  (Linux, Solaris) Get all or a specific shadow password entry.
1307
1308
1309 <h3>Parameters</h3>
1310 <ul>
1311         
1312         <li>
1313           user: username (optional)
1314         </li>
1315         
1316 </ul>
1317
1318
1319
1320
1321
1322
1323 <h3>Return value:</h3>
1324 Table containing: <ul> 
1325  <li>namp = Name</li> 
1326  <li>expire = Expiration Date</li> 
1327  <li>flag = Flags</li> 
1328  <li>inact = Inactivity Date</li> 
1329  <li>lstchg = Last change</li> 
1330  <li>max = Maximum</li> 
1331  <li>min = Minimum</li> 
1332  <li>warn = Warning</li> 
1333  <li>pwdp = Password Hash</li> 
1334  </ul>
1335
1336
1337
1338 </dd>
1339
1340
1341
1342
1343 <dt><a name="nixio.getuid"></a><strong>getuid</strong>&nbsp;()</dt>
1344 <dd>
1345
1346  (POSIX) Get the user id of the current process.
1347
1348
1349
1350
1351
1352
1353
1354 <h3>Return value:</h3>
1355 process user id
1356
1357
1358
1359 </dd>
1360
1361
1362
1363
1364 <dt><a name="nixio.kill"></a><strong>kill</strong>&nbsp;(target, signal)</dt>
1365 <dd>
1366
1367  (POSIX) Send a signal to one or more processes.
1368
1369
1370 <h3>Parameters</h3>
1371 <ul>
1372         
1373         <li>
1374           target: Target process of process group.
1375         </li>
1376         
1377         <li>
1378           signal: Signal to send
1379         </li>
1380         
1381 </ul>
1382
1383
1384
1385
1386
1387
1388 <h3>Return value:</h3>
1389 true
1390
1391
1392
1393 </dd>
1394
1395
1396
1397
1398 <dt><a name="nixio.nanosleep"></a><strong>nanosleep</strong>&nbsp;(seconds, nanoseconds)</dt>
1399 <dd>
1400
1401  Sleep for a specified amount of time.
1402
1403
1404 <h3>Parameters</h3>
1405 <ul>
1406         
1407         <li>
1408           seconds: Seconds to wait (optional)
1409         </li>
1410         
1411         <li>
1412           nanoseconds: Nanoseconds to wait (optional)
1413         </li>
1414         
1415 </ul>
1416
1417
1418
1419
1420 <h3>Usage</h3>
1421 <ul>
1422         
1423         <li>Not all systems support nanosecond precision but you can expect 
1424  to have at least maillisecond precision.
1425         
1426         <li>This function is not signal-protected and may fail with EINTR.
1427         
1428 </ul>
1429
1430
1431
1432 <h3>Return value:</h3>
1433 true
1434
1435
1436
1437 </dd>
1438
1439
1440
1441
1442 <dt><a name="nixio.nice"></a><strong>nice</strong>&nbsp;(nice)</dt>
1443 <dd>
1444
1445  (POSIX) Change priority of current process.
1446
1447
1448 <h3>Parameters</h3>
1449 <ul>
1450         
1451         <li>
1452           nice: Nice Value
1453         </li>
1454         
1455 </ul>
1456
1457
1458
1459
1460
1461
1462 <h3>Return value:</h3>
1463 true
1464
1465
1466
1467 </dd>
1468
1469
1470
1471
1472 <dt><a name="nixio.open"></a><strong>open</strong>&nbsp;(path, flags, mode)</dt>
1473 <dd>
1474
1475  Open a file.
1476
1477
1478 <h3>Parameters</h3>
1479 <ul>
1480         
1481         <li>
1482           path: Filesystem path to open
1483         </li>
1484         
1485         <li>
1486           flags: Flag string or number (see open_flags). 
1487  [<strong>"r"</strong>, "r+", "w", "w+", "a", "a+"]
1488         </li>
1489         
1490         <li>
1491           mode: File mode for newly created files (see chmod, umask).
1492         </li>
1493         
1494 </ul>
1495
1496
1497
1498
1499 <h3>Usage:</h3>
1500 Although this function also supports the traditional fopen()  
1501  file flags it does not create a file stream but uses the open() syscall.
1502
1503
1504
1505 <h3>Return value:</h3>
1506 File Object
1507
1508
1509
1510 <h3>See also:</h3>
1511 <ul>
1512         
1513         <li><a href="#nixio.umask">
1514                 umask
1515         </a>
1516         
1517         <li><a href="#nixio.open_flags">
1518                 open_flags
1519         </a>
1520         
1521 </ul>
1522
1523 </dd>
1524
1525
1526
1527
1528 <dt><a name="nixio.open_flags"></a><strong>open_flags</strong>&nbsp;(flag1, ...)</dt>
1529 <dd>
1530
1531  Generate flags for a call to open().
1532
1533
1534 <h3>Parameters</h3>
1535 <ul>
1536         
1537         <li>
1538           flag1: First Flag ["append", "creat", "excl", "nonblock", "ndelay", 
1539  "sync", "trunc", "rdonly", "wronly", "rdwr"]
1540         </li>
1541         
1542         <li>
1543           ...: More Flags [-"-]
1544         </li>
1545         
1546 </ul>
1547
1548
1549
1550
1551 <h3>Usage</h3>
1552 <ul>
1553         
1554         <li>This function cannot fail and will never return nil.
1555         
1556         <li>The "nonblock" and "ndelay" flags are aliases.
1557         
1558         <li>The "nonblock", "ndelay" and "sync" flags are no-ops on Windows.
1559         
1560 </ul>
1561
1562
1563
1564 <h3>Return value:</h3>
1565 flag to be used as second paramter to open
1566
1567
1568
1569 </dd>
1570
1571
1572
1573
1574 <dt><a name="nixio.openlog"></a><strong>openlog</strong>&nbsp;(ident, flag1, ...)</dt>
1575 <dd>
1576
1577  (POSIX) Open a connection to the system logger.
1578
1579
1580 <h3>Parameters</h3>
1581 <ul>
1582         
1583         <li>
1584           ident: Identifier
1585         </li>
1586         
1587         <li>
1588           flag1: Flag 1 ["cons", "nowait", "pid", "perror", "ndelay", "odelay"]
1589         </li>
1590         
1591         <li>
1592           ...: More flags [-"-]
1593         </li>
1594         
1595 </ul>
1596
1597
1598
1599
1600
1601
1602
1603
1604 </dd>
1605
1606
1607
1608
1609 <dt><a name="nixio.pipe"></a><strong>pipe</strong>&nbsp;()</dt>
1610 <dd>
1611
1612  Create a pipe.
1613
1614
1615
1616
1617
1618
1619
1620 <h3>Return values:</h3>
1621 <ol>
1622         
1623         <li>File Object of the read end
1624         
1625         <li>File Object of the write end
1626         
1627 </ol>
1628
1629
1630
1631 </dd>
1632
1633
1634
1635
1636 <dt><a name="nixio.poll"></a><strong>poll</strong>&nbsp;(fds, timeout)</dt>
1637 <dd>
1638
1639  Wait for some event on a file descriptor. 
1640  poll() sets the revents-field of the tables provided by fds to a bitfield 
1641  indicating the events that occured.
1642
1643
1644 <h3>Parameters</h3>
1645 <ul>
1646         
1647         <li>
1648           fds: Table containing one or more tables containing <ul> 
1649  <li> fd = I/O Descriptor [Socket Object, File Object (POSIX)]</li> 
1650  <li> events = events to wait for (bitfield generated with poll_flags)</li> 
1651  </ul>
1652         </li>
1653         
1654         <li>
1655           timeout: Timeout in milliseconds
1656         </li>
1657         
1658 </ul>
1659
1660
1661
1662
1663 <h3>Usage</h3>
1664 <ul>
1665         
1666         <li>This function works in-place on the provided table and only 
1667  writes the revents field, you can use other fields on your demand.
1668         
1669         <li>All metamethods on the tables provided as fds are ignored.
1670         
1671         <li>The revents-fields are not reset when the call times out. 
1672  You have to check the first return value to be 0 to handle this case.
1673         
1674         <li>If you want to wait on a TLS-Socket you have to use the underlying 
1675  socket instead.
1676         
1677         <li>On Windows poll is emulated through select(), can only be used 
1678  on socket descriptors and cannot take more than 64 descriptors per call.
1679         
1680         <li>This function is not signal-protected and may fail with EINTR.
1681         
1682 </ul>
1683
1684
1685
1686 <h3>Return values:</h3>
1687 <ol>
1688         
1689         <li>number of ready IO descriptors
1690         
1691         <li>the fds-table with revents-fields set
1692         
1693 </ol>
1694
1695
1696
1697 <h3>See also:</h3>
1698 <ul>
1699         
1700         <li><a href="#nixio.poll_flags">
1701                 poll_flags
1702         </a>
1703         
1704 </ul>
1705
1706 </dd>
1707
1708
1709
1710
1711 <dt><a name="nixio.poll_flags"></a><strong>poll_flags</strong>&nbsp;(mode1, ...)</dt>
1712 <dd>
1713
1714  Generate events-bitfield or parse revents-bitfield for poll.
1715
1716
1717 <h3>Parameters</h3>
1718 <ul>
1719         
1720         <li>
1721           mode1: revents-Flag bitfield returned from poll to parse OR  
1722  ["in", "out", "err", "pri" (POSIX), "hup" (POSIX), "nval" (POSIX)]
1723         </li>
1724         
1725         <li>
1726           ...: More mode strings for generating the flag [-"-]
1727         </li>
1728         
1729 </ul>
1730
1731
1732
1733
1734
1735
1736 <h3>Return value:</h3>
1737 table with boolean fields reflecting the mode parameter  
1738  <strong>OR</strong> bitfield to use for the events-Flag field
1739
1740
1741
1742 <h3>See also:</h3>
1743 <ul>
1744         
1745         <li><a href="#nixio.poll">
1746                 poll
1747         </a>
1748         
1749 </ul>
1750
1751 </dd>
1752
1753
1754
1755
1756 <dt><a name="nixio.sendfile"></a><strong>sendfile</strong>&nbsp;(socket, file, length)</dt>
1757 <dd>
1758
1759  (POSIX) Send data from a file to a socket in kernel-space.
1760
1761
1762 <h3>Parameters</h3>
1763 <ul>
1764         
1765         <li>
1766           socket: Socket Object
1767         </li>
1768         
1769         <li>
1770           file: File Object
1771         </li>
1772         
1773         <li>
1774           length: Amount of data to send (in Bytes).
1775         </li>
1776         
1777 </ul>
1778
1779
1780
1781
1782
1783
1784 <h3>Return value:</h3>
1785 bytes sent
1786
1787
1788
1789 </dd>
1790
1791
1792
1793
1794 <dt><a name="nixio.setenv"></a><strong>setenv</strong>&nbsp;(variable, value)</dt>
1795 <dd>
1796
1797  Set or unset a environment variable.
1798
1799
1800 <h3>Parameters</h3>
1801 <ul>
1802         
1803         <li>
1804           variable: Variable
1805         </li>
1806         
1807         <li>
1808           value: Value (optional)
1809         </li>
1810         
1811 </ul>
1812
1813
1814
1815
1816 <h3>Usage:</h3>
1817 The environment variable will be unset if value is ommited.
1818
1819
1820
1821 <h3>Return value:</h3>
1822 true
1823
1824
1825
1826 </dd>
1827
1828
1829
1830
1831 <dt><a name="nixio.setgid"></a><strong>setgid</strong>&nbsp;(gid)</dt>
1832 <dd>
1833
1834  (POSIX) Set the group id of the current process.
1835
1836
1837 <h3>Parameters</h3>
1838 <ul>
1839         
1840         <li>
1841           gid: New Group ID
1842         </li>
1843         
1844 </ul>
1845
1846
1847
1848
1849
1850
1851 <h3>Return value:</h3>
1852 true
1853
1854
1855
1856 </dd>
1857
1858
1859
1860
1861 <dt><a name="nixio.setlogmask"></a><strong>setlogmask</strong>&nbsp;(priority)</dt>
1862 <dd>
1863
1864  (POSIX) Set the logmask of the system logger for current process.
1865
1866
1867 <h3>Parameters</h3>
1868 <ul>
1869         
1870         <li>
1871           priority: Priority ["emerg", "alert", "crit", "err", "warning", 
1872  "notice", "info", "debug"]
1873         </li>
1874         
1875 </ul>
1876
1877
1878
1879
1880
1881
1882
1883
1884 </dd>
1885
1886
1887
1888
1889 <dt><a name="nixio.setsid"></a><strong>setsid</strong>&nbsp;()</dt>
1890 <dd>
1891
1892  (POSIX) Create a new session and set the process group ID.
1893
1894
1895
1896
1897
1898
1899
1900 <h3>Return value:</h3>
1901 session id
1902
1903
1904
1905 </dd>
1906
1907
1908
1909
1910 <dt><a name="nixio.setuid"></a><strong>setuid</strong>&nbsp;(gid)</dt>
1911 <dd>
1912
1913  (POSIX) Set the user id of the current process.
1914
1915
1916 <h3>Parameters</h3>
1917 <ul>
1918         
1919         <li>
1920           gid: New User ID
1921         </li>
1922         
1923 </ul>
1924
1925
1926
1927
1928
1929
1930 <h3>Return value:</h3>
1931 true
1932
1933
1934
1935 </dd>
1936
1937
1938
1939
1940 <dt><a name="nixio.signal"></a><strong>signal</strong>&nbsp;(signal, handler)</dt>
1941 <dd>
1942
1943  Ignore or use set the default handler for a signal.
1944
1945
1946 <h3>Parameters</h3>
1947 <ul>
1948         
1949         <li>
1950           signal: Signal
1951         </li>
1952         
1953         <li>
1954           handler: ["ign", "dfl"]
1955         </li>
1956         
1957 </ul>
1958
1959
1960
1961
1962
1963
1964 <h3>Return value:</h3>
1965 true
1966
1967
1968
1969 </dd>
1970
1971
1972
1973
1974 <dt><a name="nixio.socket"></a><strong>socket</strong>&nbsp;(domain, type)</dt>
1975 <dd>
1976
1977  Create a new socket.
1978
1979
1980 <h3>Parameters</h3>
1981 <ul>
1982         
1983         <li>
1984           domain: Domain ["inet", "inet6", "unix"]
1985         </li>
1986         
1987         <li>
1988           type: Type   ["stream", "dgram", "raw"]
1989         </li>
1990         
1991 </ul>
1992
1993
1994
1995
1996
1997
1998 <h3>Return value:</h3>
1999 Socket Object
2000
2001
2002
2003 </dd>
2004
2005
2006
2007
2008 <dt><a name="nixio.splice"></a><strong>splice</strong>&nbsp;(fdin, fdout, length, flags)</dt>
2009 <dd>
2010
2011  (Linux) Send data from / to a pipe in kernel-space.
2012
2013
2014 <h3>Parameters</h3>
2015 <ul>
2016         
2017         <li>
2018           fdin: Input I/O descriptor 
2019         </li>
2020         
2021         <li>
2022           fdout: Output I/O descriptor
2023         </li>
2024         
2025         <li>
2026           length: Amount of data to send (in Bytes).
2027         </li>
2028         
2029         <li>
2030           flags: (optional, bitfield generated by splice_flags)
2031         </li>
2032         
2033 </ul>
2034
2035
2036
2037
2038
2039
2040 <h3>Return value:</h3>
2041 bytes sent
2042
2043
2044
2045 <h3>See also:</h3>
2046 <ul>
2047         
2048         <li><a href="#nixio.splice_flags">
2049                 splice_flags
2050         </a>
2051         
2052 </ul>
2053
2054 </dd>
2055
2056
2057
2058
2059 <dt><a name="nixio.splice_flags"></a><strong>splice_flags</strong>&nbsp;(flag1, ...)</dt>
2060 <dd>
2061
2062  (Linux) Generate a flag bitfield for a call to splice.
2063
2064
2065 <h3>Parameters</h3>
2066 <ul>
2067         
2068         <li>
2069           flag1: First Flag     ["move", "nonblock", "more"]
2070         </li>
2071         
2072         <li>
2073           ...: More flags       [-"-]
2074         </li>
2075         
2076 </ul>
2077
2078
2079
2080
2081
2082
2083 <h3>Return value:</h3>
2084 Flag bitfield
2085
2086
2087
2088 <h3>See also:</h3>
2089 <ul>
2090         
2091         <li><a href="#nixio.splice">
2092                 splice
2093         </a>
2094         
2095 </ul>
2096
2097 </dd>
2098
2099
2100
2101
2102 <dt><a name="nixio.strerror"></a><strong>strerror</strong>&nbsp;(errno)</dt>
2103 <dd>
2104
2105  Get the error message for the corresponding error code.
2106
2107
2108 <h3>Parameters</h3>
2109 <ul>
2110         
2111         <li>
2112           errno: System error code
2113         </li>
2114         
2115 </ul>
2116
2117
2118
2119
2120
2121
2122 <h3>Return value:</h3>
2123 Error message
2124
2125
2126
2127 </dd>
2128
2129
2130
2131
2132 <dt><a name="nixio.sysinfo"></a><strong>sysinfo</strong>&nbsp;()</dt>
2133 <dd>
2134
2135  (Linux) Get overall system statistics.
2136
2137
2138
2139
2140
2141
2142
2143 <h3>Return value:</h3>
2144 Table containing: <ul> 
2145  <li>uptime = system uptime in seconds</li> 
2146  <li>loads = {loadavg1, loadavg5, loadavg15}</li> 
2147  <li>totalram = total RAM</li> 
2148  <li>freeram = free RAM</li> 
2149  <li>sharedram = shared RAM</li> 
2150  <li>bufferram = buffered RAM</li> 
2151  <li>totalswap = total SWAP</li> 
2152  <li>freeswap = free SWAP</li> 
2153  <li>procs = number of running processes</li> 
2154  </ul>
2155
2156
2157
2158 </dd>
2159
2160
2161
2162
2163 <dt><a name="nixio.syslog"></a><strong>syslog</strong>&nbsp;(priority)</dt>
2164 <dd>
2165
2166  (POSIX) Write a message to the system logger.
2167
2168
2169 <h3>Parameters</h3>
2170 <ul>
2171         
2172         <li>
2173           priority: Priority ["emerg", "alert", "crit", "err", "warning", 
2174  "notice", "info", "debug"]
2175         </li>
2176         
2177 </ul>
2178
2179
2180
2181
2182
2183
2184
2185
2186 </dd>
2187
2188
2189
2190
2191 <dt><a name="nixio.times"></a><strong>times</strong>&nbsp;()</dt>
2192 <dd>
2193
2194  (POSIX) Get process times.
2195
2196
2197
2198
2199
2200
2201
2202 <h3>Return value:</h3>
2203 Table containing: <ul> 
2204  <li>utime = user time</li> 
2205  <li>utime = system time</li> 
2206  <li>cutime = children user time</li> 
2207  <li>cstime = children system time</li> 
2208  </ul>
2209
2210
2211
2212 </dd>
2213
2214
2215
2216
2217 <dt><a name="nixio.tls"></a><strong>tls</strong>&nbsp;(mode)</dt>
2218 <dd>
2219
2220  Create a new TLS context.
2221
2222
2223 <h3>Parameters</h3>
2224 <ul>
2225         
2226         <li>
2227           mode: TLS-Mode ["client", "server"]
2228         </li>
2229         
2230 </ul>
2231
2232
2233
2234
2235
2236
2237 <h3>Return value:</h3>
2238 TLSContext Object
2239
2240
2241
2242 </dd>
2243
2244
2245
2246
2247 <dt><a name="nixio.umask"></a><strong>umask</strong>&nbsp;(mask)</dt>
2248 <dd>
2249
2250  Sets the file mode creation mask.
2251
2252
2253 <h3>Parameters</h3>
2254 <ul>
2255         
2256         <li>
2257           mask: New creation mask (see chmod for format specifications)
2258         </li>
2259         
2260 </ul>
2261
2262
2263
2264
2265
2266
2267 <h3>Return values:</h3>
2268 <ol>
2269         
2270         <li>the old umask as decimal mode number
2271         
2272         <li>the old umask as mode string
2273         
2274 </ol>
2275
2276
2277
2278 </dd>
2279
2280
2281
2282
2283 <dt><a name="nixio.uname"></a><strong>uname</strong>&nbsp;()</dt>
2284 <dd>
2285
2286  (POSIX) Get information about current system and kernel.
2287
2288
2289
2290
2291
2292
2293
2294 <h3>Return value:</h3>
2295 Table containing: <ul> 
2296  <li>sysname = operating system</li> 
2297  <li>nodename = network name (usually hostname)</li> 
2298  <li>release = OS release</li> 
2299  <li>version = OS version</li> 
2300  <li>machine = hardware identifier</li> 
2301  </ul>
2302
2303
2304
2305 </dd>
2306
2307
2308
2309
2310 <dt><a name="nixio.waitpid"></a><strong>waitpid</strong>&nbsp;(pid, flag1, ...)</dt>
2311 <dd>
2312
2313  (POSIX) Wait for a process to change state.
2314
2315
2316 <h3>Parameters</h3>
2317 <ul>
2318         
2319         <li>
2320           pid: Process ID       (optional, default: any childprocess)
2321         </li>
2322         
2323         <li>
2324           flag1: Flag   (optional) ["nohang", "untraced", "continued"]
2325         </li>
2326         
2327         <li>
2328           ...: More Flags [-"-]
2329         </li>
2330         
2331 </ul>
2332
2333
2334
2335
2336 <h3>Usage:</h3>
2337 If the "nohang" is given this function becomes non-blocking.
2338
2339
2340
2341 <h3>Return values:</h3>
2342 <ol>
2343         
2344         <li>process id of child or 0 if no child has changed state
2345         
2346         <li>["exited", "signaled", "stopped"]
2347         
2348         <li>[exit code, terminate signal, stop signal]
2349         
2350 </ol>
2351
2352
2353
2354 </dd>
2355
2356
2357 </dl>
2358
2359
2360
2361
2362
2363 </div> <!-- id="content" -->
2364
2365 </div> <!-- id="main" -->
2366
2367 <div id="about">
2368         <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
2369 </div> <!-- id="about" -->
2370
2371 </div> <!-- id="container" -->
2372 </body>
2373 </html>