add directory study

This commit is contained in:
gohigh
2024-02-19 00:25:23 -05:00
parent b1306b38b1
commit f3774e2f8c
4001 changed files with 2285787 additions and 0 deletions

View File

@@ -0,0 +1,138 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - Table of Contents</TITLE>
<H1>Syscall specifications of Linux</H1>
<P>
<UL>
<LI><A NAME="SEC1" HREF="syscalls_1.html#SEC1" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_1.html#SEC1">Introduction</A>
<UL>
<LI><A NAME="SEC2" HREF="syscalls_2.html#SEC2" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_2.html#SEC2">Conventions</A>
</UL>
<LI><A NAME="SEC3" HREF="syscalls_3.html#SEC3" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_3.html#SEC3">File system subsystem</A>
<UL>
<LI><A NAME="SEC4" HREF="syscalls_4.html#SEC4" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_4.html#SEC4">access</A>
<LI><A NAME="SEC5" HREF="syscalls_5.html#SEC5" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_5.html#SEC5">chdir and fchdir</A>
<LI><A NAME="SEC6" HREF="syscalls_6.html#SEC6" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_6.html#SEC6">chmod and fchmod</A>
<LI><A NAME="SEC7" HREF="syscalls_7.html#SEC7" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_7.html#SEC7">chown and fchown</A>
<LI><A NAME="SEC8" HREF="syscalls_8.html#SEC8" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_8.html#SEC8">chroot</A>
<LI><A NAME="SEC9" HREF="syscalls_9.html#SEC9" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_9.html#SEC9">close</A>
<LI><A NAME="SEC10" HREF="syscalls_10.html#SEC10" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_10.html#SEC10">creat and open</A>
<LI><A NAME="SEC11" HREF="syscalls_11.html#SEC11" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html#SEC11">dup and dup2</A>
<LI><A NAME="SEC12" HREF="syscalls_12.html#SEC12" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_12.html#SEC12">fcntl</A>
<LI><A NAME="SEC13" HREF="syscalls_13.html#SEC13" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_13.html#SEC13">fstat, stat and lstat</A>
<LI><A NAME="SEC14" HREF="syscalls_14.html#SEC14" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_14.html#SEC14">fstatfs and statfs</A>
<LI><A NAME="SEC15" HREF="syscalls_15.html#SEC15" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_15.html#SEC15">fsync</A>
<LI><A NAME="SEC16" HREF="syscalls_16.html#SEC16" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_16.html#SEC16">ftruncate and truncate</A>
<LI><A NAME="SEC17" HREF="syscalls_17.html#SEC17" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html#SEC17">ioctl</A>
<LI><A NAME="SEC18" HREF="syscalls_18.html#SEC18" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html#SEC18">link</A>
<LI><A NAME="SEC19" HREF="syscalls_19.html#SEC19" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html#SEC19">lseek</A>
<LI><A NAME="SEC20" HREF="syscalls_20.html#SEC20" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html#SEC20">mkdir</A>
<LI><A NAME="SEC21" HREF="syscalls_21.html#SEC21" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_21.html#SEC21">mknod</A>
<LI><A NAME="SEC22" HREF="syscalls_22.html#SEC22" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_22.html#SEC22">mount and umount</A>
<LI><A NAME="SEC23" HREF="syscalls_23.html#SEC23" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_23.html#SEC23">pipe</A>
<LI><A NAME="SEC24" HREF="syscalls_24.html#SEC24" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html#SEC24">read</A>
<LI><A NAME="SEC25" HREF="syscalls_25.html#SEC25" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_25.html#SEC25">readdir</A>
<LI><A NAME="SEC26" HREF="syscalls_26.html#SEC26" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html#SEC26">readlink</A>
<LI><A NAME="SEC27" HREF="syscalls_27.html#SEC27" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_27.html#SEC27">rename</A>
<LI><A NAME="SEC28" HREF="syscalls_28.html#SEC28" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_28.html#SEC28">rmdir</A>
<LI><A NAME="SEC29" HREF="syscalls_29.html#SEC29" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_29.html#SEC29">select</A>
<LI><A NAME="SEC30" HREF="syscalls_30.html#SEC30" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_30.html#SEC30">symlink</A>
<LI><A NAME="SEC31" HREF="syscalls_31.html#SEC31" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_31.html#SEC31">sync</A>
<LI><A NAME="SEC32" HREF="syscalls_32.html#SEC32" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_32.html#SEC32">umask</A>
<LI><A NAME="SEC33" HREF="syscalls_33.html#SEC33" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_33.html#SEC33">unlink</A>
<LI><A NAME="SEC34" HREF="syscalls_34.html#SEC34" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_34.html#SEC34">utime</A>
<LI><A NAME="SEC35" HREF="syscalls_35.html#SEC35" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_35.html#SEC35">write</A>
</UL>
<LI><A NAME="SEC36" HREF="syscalls_36.html#SEC36" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_36.html#SEC36">Virtual memory subsystem</A>
<UL>
<LI><A NAME="SEC37" HREF="syscalls_37.html#SEC37" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_37.html#SEC37">brk</A>
<LI><A NAME="SEC38" HREF="syscalls_38.html#SEC38" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_38.html#SEC38">getpagesize</A>
<LI><A NAME="SEC39" HREF="syscalls_39.html#SEC39" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_39.html#SEC39">mmap and munmap</A>
</UL>
<LI><A NAME="SEC40" HREF="syscalls_40.html#SEC40" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_40.html#SEC40">Network subsystem</A>
<UL>
<LI><A NAME="SEC41" HREF="syscalls_41.html#SEC41" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_41.html#SEC41">accept</A>
<LI><A NAME="SEC42" HREF="syscalls_42.html#SEC42" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_42.html#SEC42">bind</A>
<LI><A NAME="SEC43" HREF="syscalls_43.html#SEC43" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_43.html#SEC43">connect</A>
<LI><A NAME="SEC44" HREF="syscalls_44.html#SEC44" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_44.html#SEC44">getdomainname and setdomainname</A>
<LI><A NAME="SEC45" HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_45.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_45.html#SEC45'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_45.html#SEC45">gethostid and sethostid</A>
<LI><A NAME="SEC46" HREF="syscalls_46.html#SEC46" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_46.html#SEC46">gethostname and sethostname</A>
<LI><A NAME="SEC47" HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_47.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_47.html#SEC47'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_47.html#SEC47">getpeername</A>
<LI><A NAME="SEC48" HREF="syscalls_48.html#SEC48" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html#SEC48">getsockname</A>
<LI><A NAME="SEC49" HREF="syscalls_49.html#SEC49" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_49.html#SEC49">getsockopt</A>
<LI><A NAME="SEC50" HREF="syscalls_50.html#SEC50" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_50.html#SEC50">listen</A>
<LI><A NAME="SEC51" HREF="syscalls_51.html#SEC51" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_51.html#SEC51">recv, recvfrom and recvmsg</A>
<LI><A NAME="SEC52" HREF="syscalls_52.html#SEC52" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_52.html#SEC52">send, sendmsg and sendto</A>
<LI><A NAME="SEC53" HREF="syscalls_53.html#SEC53" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_53.html#SEC53">shutdown</A>
<LI><A NAME="SEC54" HREF="syscalls_54.html#SEC54" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html#SEC54">socket</A>
<LI><A NAME="SEC55" HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_55.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_55.html#SEC55'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_55.html#SEC55">socketpair</A>
</UL>
<LI><A NAME="SEC56" HREF="syscalls_56.html#SEC56" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_56.html#SEC56">Processus control subsystem</A>
<UL>
<LI><A NAME="SEC57" HREF="syscalls_57.html#SEC57" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_57.html#SEC57">_exit</A>
<LI><A NAME="SEC58" HREF="syscalls_58.html#SEC58" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_58.html#SEC58">execve</A>
<LI><A NAME="SEC59" HREF="syscalls_59.html#SEC59" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_59.html#SEC59">template</A>
<LI><A NAME="SEC60" HREF="syscalls_60.html#SEC60" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_60.html#SEC60">getegid and getgid</A>
<LI><A NAME="SEC61" HREF="syscalls_61.html#SEC61" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_61.html#SEC61">geteuid and getuid</A>
<LI><A NAME="SEC62" HREF="syscalls_62.html#SEC62" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_62.html#SEC62">getpgrp, setpgid and setpgrp</A>
<LI><A NAME="SEC63" HREF="syscalls_63.html#SEC63" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_63.html#SEC63">getppid</A>
<LI><A NAME="SEC64" HREF="syscalls_64.html#SEC64" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_64.html#SEC64">getpriority and setpriority</A>
<LI><A NAME="SEC65" HREF="syscalls_65.html#SEC65" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_65.html#SEC65">nice</A>
<LI><A NAME="SEC66" HREF="syscalls_66.html#SEC66" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_66.html#SEC66">setgid</A>
<LI><A NAME="SEC67" HREF="syscalls_67.html#SEC67" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_67.html#SEC67">setregid</A>
<LI><A NAME="SEC68" HREF="syscalls_68.html#SEC68" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_68.html#SEC68">setreuid</A>
<LI><A NAME="SEC69" HREF="syscalls_69.html#SEC69" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_69.html#SEC69">setuid</A>
<LI><A NAME="SEC70" HREF="syscalls_70.html#SEC70" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_70.html#SEC70">vm86</A>
<LI><A NAME="SEC71" HREF="syscalls_71.html#SEC71" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_71.html#SEC71">wait4</A>
</UL>
<LI><A NAME="SEC72" HREF="syscalls_72.html#SEC72" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html#SEC72">Inter Process Communication Subsystem</A>
<UL>
<LI><A NAME="SEC73" HREF="syscalls_73.html#SEC73" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_73.html#SEC73">ipc</A>
<LI><A NAME="SEC74" HREF="syscalls_74.html#SEC74" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html#SEC74">msgctl</A>
<LI><A NAME="SEC75" HREF="syscalls_75.html#SEC75" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_75.html#SEC75">msgget</A>
<LI><A NAME="SEC76" HREF="syscalls_76.html#SEC76" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_76.html#SEC76">msgrcv and msgsnd</A>
<LI><A NAME="SEC77" HREF="syscalls_77.html#SEC77" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_77.html#SEC77">semctl</A>
<LI><A NAME="SEC78" HREF="syscalls_78.html#SEC78" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_78.html#SEC78">semget</A>
<LI><A NAME="SEC79" HREF="syscalls_79.html#SEC79" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_79.html#SEC79">semop</A>
<LI><A NAME="SEC80" HREF="syscalls_80.html#SEC80" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_80.html#SEC80">shmat and shmdt</A>
<LI><A NAME="SEC81" HREF="syscalls_81.html#SEC81" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_81.html#SEC81">shmctl</A>
<LI><A NAME="SEC82" HREF="syscalls_82.html#SEC82" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_82.html#SEC82">shmget</A>
</UL>
<LI><A NAME="SEC83" HREF="syscalls_83.html#SEC83" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_83.html#SEC83">Other calls</A>
<UL>
<LI><A NAME="SEC84" HREF="syscalls_84.html#SEC84" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_84.html#SEC84">acct</A>
<LI><A NAME="SEC85" HREF="syscalls_85.html#SEC85" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_85.html#SEC85">alarm</A>
<LI><A NAME="SEC86" HREF="syscalls_86.html#SEC86" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_86.html#SEC86">getgroups and setgroups</A>
<LI><A NAME="SEC87" HREF="syscalls_87.html#SEC87" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_87.html#SEC87">getitimer and setitimer</A>
<LI><A NAME="SEC88" HREF="syscalls_88.html#SEC88" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_88.html#SEC88">getrlimit, getrusage and setrlimit</A>
<LI><A NAME="SEC89" HREF="syscalls_89.html#SEC89" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_89.html#SEC89">gettimeofday and settimeofday</A>
<LI><A NAME="SEC90" HREF="syscalls_90.html#SEC90" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_90.html#SEC90">idle</A>
<LI><A NAME="SEC91" HREF="syscalls_91.html#SEC91" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_91.html#SEC91">ioperm</A>
<LI><A NAME="SEC92" HREF="syscalls_92.html#SEC92" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_92.html#SEC92">iopl</A>
<LI><A NAME="SEC93" HREF="syscalls_93.html#SEC93" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_93.html#SEC93">kill</A>
<LI><A NAME="SEC94" HREF="syscalls_94.html#SEC94" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_94.html#SEC94">killpg</A>
<LI><A NAME="SEC95" HREF="syscalls_95.html#SEC95" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_95.html#SEC95">pause</A>
<LI><A NAME="SEC96" HREF="syscalls_96.html#SEC96" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_96.html#SEC96">ptrace</A>
<LI><A NAME="SEC97" HREF="syscalls_97.html#SEC97" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_97.html#SEC97">reboot</A>
<LI><A NAME="SEC98" HREF="syscalls_98.html#SEC98" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_98.html#SEC98">setup</A>
<LI><A NAME="SEC99" HREF="syscalls_99.html#SEC99" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_99.html#SEC99">sigaction and signal</A>
<LI><A NAME="SEC100" HREF="syscalls_100.html#SEC100" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_100.html#SEC100">sgetmask and ssetmask</A>
<LI><A NAME="SEC101" HREF="syscalls_101.html#SEC101" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_101.html#SEC101">sigsuspend</A>
<LI><A NAME="SEC102" HREF="syscalls_102.html#SEC102" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_102.html#SEC102">sigpending</A>
<LI><A NAME="SEC103" HREF="syscalls_103.html#SEC103" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_103.html#SEC103">sigprocmask</A>
<LI><A NAME="SEC104" HREF="syscalls_104.html#SEC104" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_104.html#SEC104">sigreturn</A>
<LI><A NAME="SEC105" HREF="syscalls_105.html#SEC105" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_105.html#SEC105">stime</A>
<LI><A NAME="SEC106" HREF="syscalls_106.html#SEC106" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_106.html#SEC106">swapoff and swapon</A>
<LI><A NAME="SEC107" HREF="syscalls_107.html#SEC107" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_107.html#SEC107">sysinfo</A>
<LI><A NAME="SEC108" HREF="syscalls_108.html#SEC108" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_108.html#SEC108">time</A>
<LI><A NAME="SEC109" HREF="syscalls_109.html#SEC109" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_109.html#SEC109">times</A>
<LI><A NAME="SEC110" HREF="syscalls_110.html#SEC110" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_110.html#SEC110">uname</A>
<LI><A NAME="SEC111" HREF="syscalls_111.html#SEC111" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_111.html#SEC111">uselib</A>
<LI><A NAME="SEC112" HREF="syscalls_112.html#SEC112" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_112.html#SEC112">vhangup</A>
<LI><A NAME="SEC113" HREF="syscalls_113.html#SEC113" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_113.html#SEC113">template</A>
</UL>
<LI><A NAME="SEC114" HREF="syscalls_114.html#SEC114" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html#SEC114">Errors</A>
<LI><A NAME="SEC115" HREF="syscalls_115.html#SEC115" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_115.html#SEC115">References</A>
<LI><A NAME="SEC116" HREF="syscalls_116.html#SEC116" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_116.html#SEC116">Concept Index</A>
</UL>

View File

@@ -0,0 +1,53 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - Introduction</TITLE>
<P>Go to the <A HREF="syscalls_2.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_2.html">next</A> section.<P>
<P>
Linux 1.0 Syscalls
<P>
Copyright (C) 1994 Louis-Dominique Dubeau.
<P>
You may without charge, royalty or other payment, copy and distribute
copies of this work and derivative works of this work in source or
binary form provided that:
<P>
(1) you appropriately publish on each copy an appropriate copyright
notice; (2) faithfully reproduce all prior copyright notices included in
the original work (you may add your own copyright notice); and (3) agree
to indemnify and hold all prior authors, copyright holders and licensors
of the work harmless from and against all damages arising from the use
of the work.
<P>
You may distribute sources of derivative works of the work privided
that:
<P>
(1) (a) all source files of the original work that have been modified,
(b) all source files of the derivative work that contain any party of the
original work, and (c) all source files of the derivative work that are
necessary to compile, link and run the derivative work without
unresolved external calls and with the same functionnality of the
original work ("Necessary Sources") carry a prominent notice explaining
the nature and date of the modification and/or creation. You are
encouraged to make the Necessary Sources available under this license in
order to further development and acceptance of the work.
<P>
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED WITHOUT ANY
EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING BUT NOT LIMITED TO,
ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR TITLE. EXCEPT AS OTHERWISE PROVIDED BY LAW, NO
AUTHOR, COPYRIGHT HOLDER OR LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES
OF ANY KIND, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
<P>
<H1><A NAME="SEC1" HREF="syscalls_toc.html#SEC1" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC1">Introduction</A></H1>
<P>
The scope of the specifications is general enough to serve for
specification document for designing Linux personalities for
microkernels or for creating Linux compatible libraries. It contains the
complete specifications of the interface. The description of each
syscall contains a rough sketch (almost pseudo-code) of the code that needs
written in order to implement the syscall correctly for Linux compatiblity.
<P>
This information is accurate as of version 1.0 of Linux.
<P>
<P>Go to the <A HREF="syscalls_2.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_2.html">next</A> section.<P>

View File

@@ -0,0 +1,91 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - creat</TITLE>
<P>Go to the <A HREF="syscalls_9.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_9.html">previous</A>, <A HREF="syscalls_11.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html">next</A> section.<P>
<H2><A NAME="SEC10" HREF="syscalls_toc.html#SEC10" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC10">creat and open</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int open(const char *<VAR>path</VAR>, int <VAR>flags</VAR>);</CODE>
<P>
<CODE>int open(const char *<VAR>path</VAR>, int <VAR>flags</VAR>, mode_t
<VAR>mode</VAR>);</CODE>
<P>
<CODE>int creat(const char *<VAR>path</VAR>, mode_t <VAR>mode</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] the path of the new file to create.
<P>
<VAR>mode</VAR>: [in] the new permission mask of the file. It is masked by
the <CODE>umask</CODE> value: <CODE>(mode &#38; ~umask)</CODE>.
<P>
<VAR>flags</VAR>: [in] flags (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
<VAR>open</VAR> opens an file. The <VAR>flags</VAR> parameter must be one of the
following:
<P>
<DL COMPACT>
<DT><CODE>O_RDONLY</CODE>
<DD>the file is opened for reading.
<P>
<DT><CODE>O_WRONLY</CODE>
<DD>the file is opened for writing.
<P>
<DT><CODE>O_RDWR</CODE>
<DD>the file is opened for both reading and writing.
</DL>
<P>
The following values may be or'ed together and with one of the preceding
values:
<P>
<DL COMPACT>
<DT><CODE>O_CREAT</CODE>
<DD>create the file if it does not exist.
<P>
<DT><CODE>O_EXCL</CODE>
<DD>used with <CODE>O_CREAT</CODE>, if the file exists, the call fails. The test
for existence and the creation if the file does not exists is atomic
operation according to POSIX.1.
<P>
<DT><CODE>O_NOCTTY</CODE>
<DD>the file will not become the controly tty of the task even if the file
is a tty and the task does not have a controling terminal.
<P>
<DT><CODE>O_TRUNC</CODE>
<DD>if the file already exists, truncate its lenght to 0.
<P>
<DT><CODE>O_APPEND</CODE>
<DD>the file is opened for appending. The file pointer is always at the end
of the file.
<P>
<DT><CODE>O_NONBLOCK or O_NDELAY</CODE>
<DD>the calls manipulating the file never block.
<P>
<DT><CODE>O_SYNC</CODE>
<DD>the file buffers are always synchronized with the on disk file. The
write calls block until the data is completely written on disk. This is
not POSIX.1.
</DL>
<CODE>create</CODE> creates a new file. The new file is open for writing
only. If a file with the same path already existed, then it is trucated.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, a file descriptor for the file is returned. This file
descriptor is the lowest numbered unused descriptor. On error, those
calls return -1, and errno is set to one of the following values.
<P>
<UL>
<LI><CODE>EISDIR</CODE>: the last component of the path is a directory.
<LI><CODE>ETXTBSY</CODE>: tried to create an already used executable.
<LI><CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOTDIR</CODE>, <CODE>EMFILE</CODE>, <CODE>ENFILE</CODE>, <CODE>ENOMEM</CODE>,
<CODE>EROFS</CODE>, <CODE>ELOOP</CODE>, <CODE>EEXIST</CODE> or <CODE>ENOSPC</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_9.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_9.html">previous</A>, <A HREF="syscalls_11.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html">next</A> section.<P>

View File

@@ -0,0 +1,29 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sgetmask</TITLE>
<P>Go to the <A HREF="syscalls_99.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_99.html">previous</A>, <A HREF="syscalls_101.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_101.html">next</A> section.<P>
<H2><A NAME="SEC100" HREF="syscalls_toc.html#SEC100" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC100">sgetmask and ssetmask</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>sigset_t sgetmask(void);</CODE>
<P>
<CODE>sigset_t ssetmask(sigset_t <VAR>mask</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>mask</VAR>: [in] the new signal mask.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>sgetmask</CODE> retreives the signal mask of the current task and
<CODE>ssetmask</CODE> sets it to <VAR>mask</VAR>. A signal is blocked by setting
the bit corresponding to the signal number in <VAR>mask</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
Both calls return the signal mask at the time of the call (that means,
in the case of <CODE>ssetmask</CODE> before modifying it).
<P>
<P>Go to the <A HREF="syscalls_99.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_99.html">previous</A>, <A HREF="syscalls_101.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_101.html">next</A> section.<P>

View File

@@ -0,0 +1,31 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sigsuspend</TITLE>
<P>Go to the <A HREF="syscalls_100.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_100.html">previous</A>, <A HREF="syscalls_102.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_102.html">next</A> section.<P>
<H2><A NAME="SEC101" HREF="syscalls_toc.html#SEC101" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC101">sigsuspend</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>sigsuspend(int <VAR>restart</VAR>, sigset_t <VAR>old_mask</VAR>, sigset_t
<VAR>set</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>restart</VAR>: [in] the sources take the address of this parameter to
alter the stack frame...
<P>
<VAR>old_mask</VAR>: [in] this is not used in the kernel sources!!!
<P>
<VAR>set</VAR>: [in] the new signal mask.
<P>
<H3>DESCRIPTION</H3>
<P>
Atomically sets the signal mask to <VAR>set</VAR> and waits for a signal to
occur.
<P>
<H3>RETURN VALUE</H3>
<P>
Always -1 and <CODE>errno</CODE> is set to <CODE>EINTR</CODE>.
<P>
<P>Go to the <A HREF="syscalls_100.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_100.html">previous</A>, <A HREF="syscalls_102.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_102.html">next</A> section.<P>

View File

@@ -0,0 +1,25 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sigpending</TITLE>
<P>Go to the <A HREF="syscalls_101.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_101.html">previous</A>, <A HREF="syscalls_103.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_103.html">next</A> section.<P>
<H2><A NAME="SEC102" HREF="syscalls_toc.html#SEC102" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC102">sigpending</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int sigpending(sigset_t *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>buf</VAR>: [out] points to a buffer where to store the signal set.
<P>
<H3>DESCRIPTION</H3>
<P>
Retreives the set of pending signals.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and <CODE>errno</CODE> is set
to <CODE>EFAULT</CODE>.
<P>
<P>Go to the <A HREF="syscalls_101.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_101.html">previous</A>, <A HREF="syscalls_103.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_103.html">next</A> section.<P>

View File

@@ -0,0 +1,49 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sigprocmask</TITLE>
<P>Go to the <A HREF="syscalls_102.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_102.html">previous</A>, <A HREF="syscalls_104.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_104.html">next</A> section.<P>
<H2><A NAME="SEC103" HREF="syscalls_toc.html#SEC103" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC103">sigprocmask</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int sigprocmask(int <VAR>how</VAR>, const sigset_t *<VAR>set</VAR>, sigset_t
*<VAR>oset</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>how</VAR>: [in] what to do whit the signal set.
<P>
<VAR>set</VAR>: [in] the signal set.
<P>
<VAR>oset</VAR>: [out] the previous signal mask.
<H3>DESCRIPTION</H3>
<P>
Modifies the signal mask. The parameter <VAR>how</VAR> can take one of the
following values:
<P>
<DL COMPACT>
<DT><CODE>SIG_BLOCK</CODE>
<DD><CODE>mask |= <VAR>set</VAR></CODE>. Adds new signals to the set of blocked
signals.
<P>
<DT><CODE>SIG_UNBLOCK</CODE>
<DD><CODE>mask &#38;= ~<VAR>set</VAR></CODE>. Removes the signals from he set of blocked
signals.
<P>
<DT><CODE>SIG_SETMASK</CODE>
<DD><CODE>mask = <VAR>set</VAR></CODE>. <VAR>set</VAR> becomes the new signal mask.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>how</VAR> has an invalid value.
<LI><CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_102.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_102.html">previous</A>, <A HREF="syscalls_104.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_104.html">next</A> section.<P>

View File

@@ -0,0 +1,25 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sigreturn</TITLE>
<P>Go to the <A HREF="syscalls_103.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_103.html">previous</A>, <A HREF="syscalls_105.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_105.html">next</A> section.<P>
<H2><A NAME="SEC104" HREF="syscalls_toc.html#SEC104" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC104">sigreturn</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int sys_sigreturn(unsigned long __unused);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>__unused</VAR>: unused
<P>
<H3>DESCRIPTION</H3>
<P>
This syscall is not used in source code. This syscall is generated by
the kernel (!) so that it is call upon return from a signal handler.
<P>
<H3>RETURN VALUE</H3>
<P>
Very variable.
<P>
<P>Go to the <A HREF="syscalls_103.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_103.html">previous</A>, <A HREF="syscalls_105.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_105.html">next</A> section.<P>

View File

@@ -0,0 +1,28 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - stime</TITLE>
<P>Go to the <A HREF="syscalls_104.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_104.html">previous</A>, <A HREF="syscalls_106.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_106.html">next</A> section.<P>
<H2><A NAME="SEC105" HREF="syscalls_toc.html#SEC105" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC105">stime</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int stime(time_t *<VAR>t</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>t</VAR>: [in] the new time.
<P>
<H3>DESCRIPTION</H3>
<P>
Sets the time and date of the system. <VAR>t</VAR> is measured in seconds
since 00:00:00 GMT January 1, 1970. The calling task must have superuser
privileges for the call to succeed.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to <CODE>EPERM</CODE> because the calling task did not have superuser
privileges.
<P>
<P>Go to the <A HREF="syscalls_104.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_104.html">previous</A>, <A HREF="syscalls_106.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_106.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - swapoff</TITLE>
<P>Go to the <A HREF="syscalls_105.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_105.html">previous</A>, <A HREF="syscalls_107.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_107.html">next</A> section.<P>
<H2><A NAME="SEC106" HREF="syscalls_toc.html#SEC106" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC106">swapoff and swapon</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int swapon(const char *<VAR>path</VAR>);</CODE>
<P>
<CODE>int swapoff(const char *<VAR>path</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path to add/remove.
<H3>DESCRIPTION</H3>
<P>
<CODE>swapon</CODE> adds the swap area specified by <VAR>path</VAR> to the swap
pool. <CODE>swapoff</CODE> removes the swap area specified by <VAR>path</VAR> from
the swap pool. The calling task must have superuser privileges.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to one of the following:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the calling task does not have superuser privileges.
<LI><CODE>EINVAL</CODE>: path is not a block device nor a regular path.
<LI><CODE>ENOENT</CODE> or <CODE>ENOMEM</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_105.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_105.html">previous</A>, <A HREF="syscalls_107.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_107.html">next</A> section.<P>

View File

@@ -0,0 +1,41 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sysinfo</TITLE>
<P>Go to the <A HREF="syscalls_106.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_106.html">previous</A>, <A HREF="syscalls_108.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_108.html">next</A> section.<P>
<H2><A NAME="SEC107" HREF="syscalls_toc.html#SEC107" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC107">sysinfo</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int sysinfo(struct sysinfo *<VAR>info</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>info</VAR>: [out] buffer where to store the info.
<P>
<H3>DESCRIPTION</H3>
<P>
Returns system information and statistics. (What a surprise!!!) The
<CODE>sysinfo</CODE> structure has the following layout:
<P>
<PRE>
struct sysinfo }
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
</PRE>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to <CODE>EFAULT</CODE>.
<P>
<P>Go to the <A HREF="syscalls_106.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_106.html">previous</A>, <A HREF="syscalls_108.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_108.html">next</A> section.<P>

View File

@@ -0,0 +1,25 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - time</TITLE>
<P>Go to the <A HREF="syscalls_107.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_107.html">previous</A>, <A HREF="syscalls_109.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_109.html">next</A> section.<P>
<H2><A NAME="SEC108" HREF="syscalls_toc.html#SEC108" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC108">time</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>time_t time(time_t *<VAR>t</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>t</VAR>: [out] where to store the time.
<P>
<H3>DESCRIPTION</H3>
<P>
Returns the time in seconds from 00:00:00 GMT January 1, 1970. If
<VAR>t</VAR> is not <CODE>NULL</CODE>, the value is also stored there.
<P>
<H3>RETURN VALUE</H3>
<P>
The time (see description).
<P>
<P>Go to the <A HREF="syscalls_107.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_107.html">previous</A>, <A HREF="syscalls_109.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_109.html">next</A> section.<P>

View File

@@ -0,0 +1,34 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - times</TITLE>
<P>Go to the <A HREF="syscalls_108.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_108.html">previous</A>, <A HREF="syscalls_110.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_110.html">next</A> section.<P>
<H2><A NAME="SEC109" HREF="syscalls_toc.html#SEC109" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC109">times</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>clock_t times(struct tms *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>buf</VAR>: [out] where to store the times.
<P>
<H3>DESCRIPTION</H3>
<P>
Retreives the current task times. The <CODE>tms</CODE> structure has the
layout:
<P>
<PRE>
struct tms {
time_t tms_utime; /* user time */
time_t tms_stime; /* system time */
time_t tms_cutime; /* user time of children */
time_t tms_cstime; /* system time of children */
};
</PRE>
<P>
<H3>RETURN VALUE</H3>
<P>
The number of system ticks elapsed since the system has booted.
<P>
<P>Go to the <A HREF="syscalls_108.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_108.html">previous</A>, <A HREF="syscalls_110.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_110.html">next</A> section.<P>

View File

@@ -0,0 +1,37 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - dup</TITLE>
<P>Go to the <A HREF="syscalls_10.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_10.html">previous</A>, <A HREF="syscalls_12.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_12.html">next</A> section.<P>
<H2><A NAME="SEC11" HREF="syscalls_toc.html#SEC11" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC11">dup and dup2</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int dup(int <VAR>oldfd</VAR>);</CODE>
<P>
<CODE>int dup2(int <VAR>oldfd</VAR>, int <VAR>newfd</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>oldfd</VAR>: [in] the file descriptor to copy.
<P>
<VAR>newfd</VAR>: [in] the file descriptor to copy to.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>dup</CODE> duplicates a file descriptor to the lowest unused file
descriptor available. <CODE>dup2</CODE> duplicates a file descriptor to
another specified file descriptor. If the destination file descriptor is
already used, it is closed. The two descriptors share all (ie. file
locks, position, etc.) but the close-on-exec flag.
<P>
<H3>RETURN VALUE</H3>
<P>
The call returns the new descriptor on success. It returns -1 on error
and sets <CODE>errno</CODE> to one of the following values: <CODE>EBADF</CODE> or
<CODE>EMFILE</CODE>.
<P>
<STRONG>NOTE</STRONG>: <CODE>EINVAL</CODE> might well be added to the set of possible
errors in the future. (Take a look in the kernel source.)
<P>
<P>Go to the <A HREF="syscalls_10.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_10.html">previous</A>, <A HREF="syscalls_12.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_12.html">next</A> section.<P>

View File

@@ -0,0 +1,37 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - uname</TITLE>
<P>Go to the <A HREF="syscalls_109.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_109.html">previous</A>, <A HREF="syscalls_111.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_111.html">next</A> section.<P>
<H2><A NAME="SEC110" HREF="syscalls_toc.html#SEC110" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC110">uname</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int uname(struct utsname *<VAR>buf</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>buf</VAR>: [out] where to store the information.
<P>
<H3>DESCRIPTION</H3>
<P>
Retreives some information on the system. The structure <CODE>utsname</CODE>
has the following layout:
<P>
<PRE>
struct utsname {
char sysname[65];
char nodename[65];
char release[65];
char version[65];
char machine[65];
char domainname[65];
};
</PRE>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to <CODE>EFAULT</CODE>.
<P>
<P>Go to the <A HREF="syscalls_109.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_109.html">previous</A>, <A HREF="syscalls_111.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_111.html">next</A> section.<P>

View File

@@ -0,0 +1,31 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - uselib</TITLE>
<P>Go to the <A HREF="syscalls_110.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_110.html">previous</A>, <A HREF="syscalls_112.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_112.html">next</A> section.<P>
<H2><A NAME="SEC111" HREF="syscalls_toc.html#SEC111" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC111">uselib</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int uselib(const char *<VAR>library</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>library</VAR>: [in] points to the path of the shared library to load.
<P>
<H3>DESCRIPTION</H3>
<P>
Loads and map a shared library in the current task address space.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI>all the possible error values of <CODE>open</CODE> and <CODE>mmap</CODE>.
<LI><CODE>NOEXEC</CODE>: the file does not have the necessary magic number
or it is not executable.
</UL>
<P>
<P>Go to the <A HREF="syscalls_110.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_110.html">previous</A>, <A HREF="syscalls_112.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_112.html">next</A> section.<P>

View File

@@ -0,0 +1,21 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - vhangup</TITLE>
<P>Go to the <A HREF="syscalls_111.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_111.html">previous</A>, <A HREF="syscalls_113.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_113.html">next</A> section.<P>
<H2><A NAME="SEC112" HREF="syscalls_toc.html#SEC112" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC112">vhangup</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int vhangup(void);</CODE>
<H3>DESCRIPTION</H3>
<P>
Simulates a hang up on the current terminal.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to <CODE>EPERM</CODE>: the calling taks does not have superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_111.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_111.html">previous</A>, <A HREF="syscalls_113.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_113.html">next</A> section.<P>

View File

@@ -0,0 +1,12 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - template</TITLE>
<P>Go to the <A HREF="syscalls_112.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_112.html">previous</A>, <A HREF="syscalls_114.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html">next</A> section.<P>
<H2><A NAME="SEC113" HREF="syscalls_toc.html#SEC113" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC113">template</A></H2>
<P>
<H3>SYNOPSIS</H3>
<H3>PARAMETERS</H3>
<H3>DESCRIPTION</H3>
<H3>RETURN VALUE</H3>
<P>Go to the <A HREF="syscalls_112.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_112.html">previous</A>, <A HREF="syscalls_114.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html">next</A> section.<P>

View File

@@ -0,0 +1,377 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - errors</TITLE>
<P>Go to the <A HREF="syscalls_113.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_113.html">previous</A>, <A HREF="syscalls_115.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_115.html">next</A> section.<P>
<H1><A NAME="SEC114" HREF="syscalls_toc.html#SEC114" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC114">Errors</A></H1>
<P>
<DL COMPACT>
<DT><CODE>EPERM</CODE>
<DD>Operation not permitted
<P>
<DT><CODE>ENOENT</CODE>
<DD>An element of the path does not exist.
<P>
<DT><CODE>ESRCH</CODE>
<DD>The specified process does not exist.
<P>
<DT><CODE>EINTR</CODE>
<DD>The system call was interrupted by a signal.
<P>
<DT><CODE>EIO</CODE>
<DD>An I/O error occured.
<P>
<DT><CODE>ENXIO</CODE>
<DD>No such device or address
<P>
<DT><CODE>E2BIG</CODE>
<DD>The argument list (or vector) too long.
<P>
<DT><CODE>ENOEXEC</CODE>
<DD>Exec format error
<P>
<DT><CODE>EBADF</CODE>
<DD>Bad file descriptor number
<P>
<DT><CODE>ECHILD</CODE>
<DD>No child processes
<P>
<DT><CODE>EAGAIN</CODE>
<DD>Try again
<P>
<DT><CODE>ENOMEM</CODE>
<DD>Out of kernel memory to complete the call.
<P>
<DT><CODE>EACCESS</CODE>
<DD>The taks does not have enough privilege to perform the operation.
<P>
<DT><CODE>EFAULT</CODE>
<DD>A pointer points to an invalid address
<P>
<DT><CODE>ENOTBLK</CODE>
<DD>Block device required
<P>
<DT><CODE>EBUSY</CODE>
<DD>Device or resource busy
<P>
<DT><CODE>EEXIST</CODE>
<DD>Tried to create a file that already exists.
<P>
<DT><CODE>EXDEV</CODE>
<DD>Tried to create a cross-device link.
<P>
<DT><CODE>ENODEV</CODE>
<DD>No such device
<P>
<DT><CODE>ENOTDIR</CODE>
<DD>An element of the path that should have been a directory is not, in
fact, a directory.
<P>
<DT><CODE>EISDIR</CODE>
<DD>The file descriptor is a directory.
<P>
<DT><CODE>EINVAL</CODE>
<DD>Invalid argument
<P>
<DT><CODE>ENFILE</CODE>
<DD>The kernel has too many open files.
<P>
<DT><CODE>EMFILE</CODE>
<DD>The task has too many open files .
<P>
<DT><CODE>ENOTTY</CODE>
<DD>Not a typewriter
<P>
<DT><CODE>ETXTBSY</CODE>
<DD>Text file busy
<P>
<DT><CODE>EFBIG</CODE>
<DD>File too large
<P>
<DT><CODE>ENOSPC</CODE>
<DD>Not enough space left on device to complete the call.
<P>
<DT><CODE>ESPIPE</CODE>
<DD>Illegal seek
<P>
<DT><CODE>EROFS</CODE>
<DD>Attemps to modify a read-only file system .
<P>
<DT><CODE>EMLINK</CODE>
<DD>The file maximum number of links has been reached.
<P>
<DT><CODE>EPIPE</CODE>
<DD>Broken pipe
<P>
<DT><CODE>EDOM</CODE>
<DD>Math argument out of domain of func
<P>
<DT><CODE>ERANGE</CODE>
<DD>Math result not representable
<P>
<DT><CODE>EDEADLK</CODE>
<DD>Resource deadlock would occur
<P>
<DT><CODE>ENAMETOOLONG</CODE>
<DD>File name too long
<P>
<DT><CODE>ENOLCK</CODE>
<DD>No record locks available
<P>
<DT><CODE>ENOSYS</CODE>
<DD>Function not implemented
<P>
<DT><CODE>ENOTEMPTY</CODE>
<DD>The destination directory is not empty.
<P>
<DT><CODE>ELOOP</CODE>
<DD>Too many symbolic links or cyclic path encountered
<P>
<DT><CODE>EWOULDBLOCK</CODE>
<DD>The operation would block if it has been requested as a blocking call.
<P>
<DT><CODE>ENOMSG</CODE>
<DD>No message of desired type
<P>
<DT><CODE>EIDRM</CODE>
<DD>Identifier removed
<P>
<DT><CODE>ECHRNG</CODE>
<DD>Channel number out of range
<P>
<DT><CODE>EL2NSYNC</CODE>
<DD>Level 2 not synchronized
<P>
<DT><CODE>EL3HLT</CODE>
<DD>Level 3 halted
<P>
<DT><CODE>EL3RST</CODE>
<DD>Level 3 reset
<P>
<DT><CODE>ELNRNG</CODE>
<DD>Link number out of range
<P>
<DT><CODE>EUNATCH</CODE>
<DD>Protocol driver not attached
<P>
<DT><CODE>ENOCSI</CODE>
<DD>No CSI structure available
<P>
<DT><CODE>EL2HLT</CODE>
<DD>Level 2 halted
<P>
<DT><CODE>EBADE</CODE>
<DD>Invalid exchange
<P>
<DT><CODE>EBADR</CODE>
<DD>Invalid request descriptor
<P>
<DT><CODE>EXFULL</CODE>
<DD>Exchange full
<P>
<DT><CODE>ENOANO</CODE>
<DD>No anode
<P>
<DT><CODE>EBADRQC</CODE>
<DD>Invalid request code
<P>
<DT><CODE>EBADSLT</CODE>
<DD>Invalid slot
<P>
<DT><CODE>EDEADLOCK</CODE>
<DD>File locking deadlock error
<P>
<DT><CODE>EBFONT</CODE>
<DD>Bad font file format
<P>
<DT><CODE>ENOSTR</CODE>
<DD>Device not a stream
<P>
<DT><CODE>ENODATA</CODE>
<DD>No data available
<P>
<DT><CODE>ETIME</CODE>
<DD>Timer expired
<P>
<DT><CODE>ENOSR</CODE>
<DD>Out of streams resources
<P>
<DT><CODE>ENONET</CODE>
<DD>Machine is not on the network
<P>
<DT><CODE>ENOPKG</CODE>
<DD>Package not installed
<P>
<DT><CODE>EREMOTE</CODE>
<DD>Object is remote
<P>
<DT><CODE>ENOLINK</CODE>
<DD>Link has been severed
<P>
<DT><CODE>EADV</CODE>
<DD>Advertise error
<P>
<DT><CODE>ESRMNT</CODE>
<DD>Srmount error
<P>
<DT><CODE>ECOMM</CODE>
<DD>Communication error on send
<P>
<DT><CODE>EPROTO</CODE>
<DD>Protocol error
<P>
<DT><CODE>EMULTIHOP</CODE>
<DD>Multihop attempted
<P>
<DT><CODE>EDOTDOT</CODE>
<DD>RFS specific error
<P>
<DT><CODE>EBADMSG</CODE>
<DD>Not a data message
<P>
<DT><CODE>EOVERFLOW</CODE>
<DD>Value too large for defined data type
<P>
<DT><CODE>ENOTUNIQ</CODE>
<DD>Name not unique on network
<P>
<DT><CODE>EBADFD</CODE>
<DD>File descriptor in bad state
<P>
<DT><CODE>EREMCHG</CODE>
<DD>Remote address changed
<P>
<DT><CODE>ELIBACC</CODE>
<DD>Can not access a needed shared library
<P>
<DT><CODE>ELIBBAD</CODE>
<DD>Accessing a corrupted shared library
<P>
<DT><CODE>ELIBSCN</CODE>
<DD>.lib section in a.out corrupted
<P>
<DT><CODE>ELIBMAX</CODE>
<DD>Attempting to link in too many shared libraries
<P>
<DT><CODE>ELIBEXEC</CODE>
<DD>Cannot exec a shared library directly
<P>
<DT><CODE>EILSEQ</CODE>
<DD>Illegal byte sequence
<P>
<DT><CODE>ERESTART</CODE>
<DD>Interrupted system call should be restarted
<P>
<DT><CODE>ESTRPIPE</CODE>
<DD>Streams pipe error
<P>
<DT><CODE>EUSERS</CODE>
<DD>Too many users
<P>
<DT><CODE>ENOTSOCK</CODE>
<DD>Socket operation on non-socket
<P>
<DT><CODE>EDESTADDRREQ</CODE>
<DD>Destination address required
<P>
<DT><CODE>EMSGSIZE</CODE>
<DD>Message too long
<P>
<DT><CODE>EPROTOTYPE</CODE>
<DD>Protocol wrong type for socket
<P>
<DT><CODE>ENOPROTOOPT</CODE>
<DD>Protocol not available
<P>
<DT><CODE>EPROTONOSUPPORT</CODE>
<DD>The protocol requested is not supported.
<P>
<DT><CODE>ESOCKTNOSUPPORT</CODE>
<DD>Socket type not supported
<P>
<DT><CODE>EOPNOTSUPP</CODE>
<DD>The requested operation not supported on transport endpoint.
<P>
<DT><CODE>EPFNOSUPPORT</CODE>
<DD>Protocol family not supported
<P>
<DT><CODE>EAFNOSUPPORT</CODE>
<DD>The address family is not supported on the machine.
<P>
<DT><CODE>EADDRINUSE</CODE>
<DD>Address already in use
<P>
<DT><CODE>EADDRNOTAVAIL</CODE>
<DD>Cannot assign requested address
<P>
<DT><CODE>ENETDOWN</CODE>
<DD>Network is down
<P>
<DT><CODE>ENETUNREACH</CODE>
<DD>Network is unreachable
<P>
<DT><CODE>ENETRESET</CODE>
<DD>Network dropped connection because of reset
<P>
<DT><CODE>ECONNABORTED</CODE>
<DD>Software caused connection abort
<P>
<DT><CODE>ECONNRESET</CODE>
<DD>Connection reset by peer
<P>
<DT><CODE>ENOBUFS</CODE>
<DD>Not enough buffer space available to complete the call.
<P>
<DT><CODE>EISCONN</CODE>
<DD>Transport endpoint is already connected
<P>
<DT><CODE>ENOTCONN</CODE>
<DD>Transport endpoint is not connected.
<P>
<DT><CODE>ESHUTDOWN</CODE>
<DD>Cannot send after transport endpoint shutdown
<P>
<DT><CODE>ETOOMANYREFS</CODE>
<DD>Too many references: cannot splice
<P>
<DT><CODE>ETIMEDOUT</CODE>
<DD>Connection timed out
<P>
<DT><CODE>ECONNREFUSED</CODE>
<DD>Connection refused
<P>
<DT><CODE>EHOSTDOWN</CODE>
<DD>Host is down
<P>
<DT><CODE>EHOSTUNREACH</CODE>
<DD>No route to host
<P>
<DT><CODE>EALREADY</CODE>
<DD>Operation already in progress
<P>
<DT><CODE>EINPROGRESS</CODE>
<DD>Operation now in progress
<P>
<DT><CODE>ESTALE</CODE>
<DD>Stale NFS file handle
<P>
<DT><CODE>EUCLEAN</CODE>
<DD>Structure needs cleaning
<P>
<DT><CODE>ENOTNAM</CODE>
<DD>Not a XENIX named type file
<P>
<DT><CODE>ENAVAIL</CODE>
<DD>No XENIX semaphores available
<P>
<DT><CODE>EISNAM</CODE>
<DD>Is a named type file
<P>
<DT><CODE>EREMOTEIO</CODE>
<DD>Remote I/O error
<P>
<DT><CODE>EDQUOT</CODE>
<DD>Quota exceeded
<P>
</DL>
<P>Go to the <A HREF="syscalls_113.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_113.html">previous</A>, <A HREF="syscalls_115.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_115.html">next</A> section.<P>

View File

@@ -0,0 +1,27 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - References</TITLE>
<P>Go to the <A HREF="syscalls_114.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html">previous</A>, <A HREF="syscalls_116.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_116.html">next</A> section.<P>
<H1><A NAME="SEC115" HREF="syscalls_toc.html#SEC115" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC115">References</A></H1>
<P>
Here are cited the sources used to write this document. Everything is
cited: books, sources, man pages, etc.
<P>
Faith, Rik, and al. The Linux man pages. Available by ftp at
sunsite.unc.edu.
<P>
Lu, H.J., FSF, and al. 1994. The GNU C library sources version 4.5.26
for Linux. Available by ftp at sunsite.unc.edu.
<P>
Stevens, W.R. 1992. <EM>Advanced Programming in the Unix Environment</EM>,
Addison-Wesley, Reading, Mass.
<P>
Sun. SunOS 4.1.3 man pages.
<P>
Sun. Solaris 2.3 man pages.
<P>
Torvalds, Linus, and al. 1994. The Linux 1.0 kernel sources. Available
by ftp at nic.funet.fi.
<P>
<P>Go to the <A HREF="syscalls_114.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html">previous</A>, <A HREF="syscalls_116.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_116.html">next</A> section.<P>

View File

@@ -0,0 +1,13 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - Concept Index</TITLE>
<P>Go to the <A HREF="syscalls_115.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_115.html">previous</A> section.<P>
<H1><A NAME="SEC116" HREF="syscalls_toc.html#SEC116" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC116">Concept Index</A></H1>
<P>
Yes, this is empty!!!
<P>
<DIR>
</DIR>
<P>
<P>Go to the <A HREF="syscalls_115.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_115.html">previous</A> section.<P>

View File

@@ -0,0 +1,136 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fcntl</TITLE>
<P>Go to the <A HREF="syscalls_11.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html">previous</A>, <A HREF="syscalls_13.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_13.html">next</A> section.<P>
<H2><A NAME="SEC12" HREF="syscalls_toc.html#SEC12" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC12">fcntl</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int fcntl(int <VAR>fd</VAR>, int <VAR>cmd</VAR>);</CODE>
<P>
<CODE>int fcntl(int <VAR>fd</VAR>, int <VAR>cmd</VAR>, long <VAR>arg</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor affected by the call.
<P>
<VAR>cmd</VAR>: [in] the operation to apply on the file descriptor.
<P>
<VAR>arg</VAR>: [in] an optionnal argument to the operation.
<P>
<H3>DESCRIPTION</H3>
<P>
This call directly applies an operation on a file descriptor. The
possible operations are:
<P>
<DL COMPACT>
<DT><CODE>F_DUPFD</CODE>
<DD>Duplicates <VAR>fd</VAR> the the new file descriptor specified by <VAR>arg</VAR>.
If <VAR>arg</VAR> specifies a file descriptor that was already opened, then
the file descriptor is first closed. It has the same effect has
<CODE>dup2</CODE>. See section <A HREF="syscalls_11.html#SEC11" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html#SEC11">dup and dup2</A>
<P>
<DT><CODE>F_GETFD</CODE>
<DD>Returns the close-on-exec flag of <VAR>fd</VAR>.
<P>
<DT><CODE>F_SETFD</CODE>
<DD>Sets the close-on-exec flag of <VAR>fd</VAR>.
<P>
<DT><CODE>F_GETFL</CODE>
<DD>Returns the file descriptor flags (as specified by <CODE>open</CODE>).
<P>
<DT><CODE>F_SETFL</CODE>
<DD>Sets the file descriptor flags to <VAR>arg</VAR>. The only flags that can be
modified are <CODE>O_APPEND</CODE> and <CODE>O_NONBLOCK</CODE>. See section <A HREF="syscalls_10.html#SEC10" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_10.html#SEC10">creat and open</A>
<P>
<DT><CODE>F_GETLK</CODE>
<DD>Determine if the lock described by <VAR>arg</VAR> can be set on the file. If
so, the <CODE>l_type</CODE> member is set to <CODE>F_UNLCK</CODE>. Otherwise,
<VAR>arg</VAR> is modified to describe the lock preventing the set operation.
<DT><CODE>F_SETLK</CODE>
<DD>Set the lock described by <VAR>arg</VAR> on the file or release an already
existing lock.
<P>
<DT><CODE>F_SETLKW</CODE>
<DD>Same as <CODE>F_SETLK</CODE> but block if the lock can not be set.
<P>
<DT><CODE>F_GETOWN</CODE>
<DD>Returns the process id or the process group of a socket. A process group
is returned as a negative value.
<P>
<DT><CODE>F_SETOWN</CODE>
<DD>Sets the process id or the process group that owns a socket. The owner
of the socket receives the <CODE>SIGIO</CODE> and <CODE>SIGURG</CODE> signals. A
process group is specified by a negative value.
</DL>
When using the <CODE>F_GETLK</CODE>, <CODE>F_SETLK</CODE> or <CODE>F_SETLKW</CODE>
commands, the argument is a pointer to a <CODE>flock</CODE> structure. This
structure has the following layout:
<P>
<PRE>
struct flock {
short l_type; /* read, write or unlock */
short l_whence; /* how to interpret l_start */
off_t l_start; /* where to begin the locking area */
off_t l_len; /* the lenght of the area to lock */
pid_t l_pid; /* the pid of the task holding the lock:
returned by F_GETLK */
};
</PRE>
<P>
The <CODE>l_whence</CODE> member has the same meaning as for <CODE>lseek</CODE>.
See section <A HREF="syscalls_19.html#SEC19" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html#SEC19">lseek</A> <CODE>l_type</CODE> can take one of the following values:
<P>
<DL COMPACT>
<DT><CODE>F_RDLCK</CODE>
<DD>for a shared read lock on.
<P>
<DT><CODE>F_WRLCK</CODE>
<DD>for an exclusive write lock.
<P>
<DT><CODE>F_UNLCK</CODE>
<DD>to unlock the region.
</DL>
<P>
The system merges adjacent locking regions of the same type and owned by
the same task. When a subregion inside a region is unlocked, the region
is split in two parts.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, it depends on the <VAR>cmd</VAR> parameter:
<P>
<DL COMPACT>
<DT><CODE>F_DUPFD</CODE>
<DD>the new file descriptor.
<P>
<DT><CODE>F_GETFD</CODE>
<DD>the value of the close-on-exec flag.
<P>
<DT><CODE>F_GETFL</CODE>
<DD>the value of the file descriptor flags.
<P>
<DT><CODE>F_GETOWN</CODE>
<DD>the owner of the file descriptor.
<P>
</DL>
<P>
On error, the call returns -1 and <CODE>errno</CODE> is set to one of the
following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: for <CODE>F_DUPFD</CODE>, <VAR>arg</VAR> is invalid or the
maximum number of opened file descriptor is reached. For <CODE>F_GETLK</CODE>,
specified a lock with <CODE>F_UNLCK</CODE>. Or unlock operation failed.
<LI><CODE>EBADF</CODE>: the file descriptor is invalid, or the task
requested a lock for reading or writing while it does not have the
corresponding read or write access right on the file.
<LI><CODE>EAGAIN</CODE>: impossible to set the lock.
<LI><CODE>ENOLCK</CODE>: impossible to allocate memory for the new lock.
<LI><CODE>EFAULT</CODE>, <CODE>ERESTARTSYS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_11.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_11.html">previous</A>, <A HREF="syscalls_13.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_13.html">next</A> section.<P>

View File

@@ -0,0 +1,83 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fstat</TITLE>
<P>Go to the <A HREF="syscalls_12.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_12.html">previous</A>, <A HREF="syscalls_14.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_14.html">next</A> section.<P>
<H2><A NAME="SEC13" HREF="syscalls_toc.html#SEC13" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC13">fstat, stat and lstat</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int fstat(int <VAR>fd</VAR>, struct stat *<VAR>buf</VAR>);</CODE>
<P>
<CODE>int stat(char *<VAR>path</VAR>, struct stat *<VAR>buf</VAR>);</CODE>
<P>
<CODE>int lstat(char *<VAR>path</VAR>, struct stat *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor we want to get the information from.
<P>
<VAR>path</VAR>: [in] the file path we want to get the information from.
<P>
<VAR>buf</VAR>: [out] points to the buffer that will contain the information.
<P>
<H3>DESCRIPTION</H3>
<P>
Those calls return a <CODE>stat</CODE> structure in <VAR>buf</VAR> with the
following format:
<P>
<PRE>
struct stat {
dev_t st_dev; /* device */
unsigned short __pad1; /* padding */
ino_t st_ino; /* inode
umode_t st_mode; /* access mode */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* uid */
gid_t st_gid; /* gid */
dev_t st_rdev; /* device type */
unsigned short __pad2; /* padding */
off_t st_size; /* size (in bytes) */
unsigned long st_blksize; /* block size */
unsigned long st_blocks; /* number of allocated blocks */
time_t st_atime; /* last access time */
unsigned long __unused1; /* unused */
time_t st_mtime; /* last modification time */
unsigned long __unused2; /* unused */
time_t st_ctime; /* last change time */
unsigned long __unused3; /* unused */
unsigned long __unused4; /* unused */
unsigned long __unused5; /* unused */
};
</PRE>
<P>
The change time is for modifications to the inode, whereas the
modification time is for modifications to the content of the file.
<P>
<CODE>fstat</CODE> gets the information from a file descriptor. <CODE>stat</CODE> and
<CODE>lstat</CODE> get the information from a file path. However, <CODE>lstat</CODE>
used on a link will give get the information from the link itself
instead of the file pointed by the link.
<P>
<STRONG>Note</STRONG>: the kernel contains a older stats functions. However, it
would seem they are no longer used. (Maybe only by very old binaries.)
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
for <CODE>stat</CODE> or <CODE>lstat</CODE>:
<P>
<UL>
<LI><CODE>EFAULT</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOMEM</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE>.
</UL>
<P>
for <CODE>fstat</CODE>:
<P>
<UL>
<LI><CODE>EBADFS</CODE>, <CODE>EFAULT</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_12.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_12.html">previous</A>, <A HREF="syscalls_14.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_14.html">next</A> section.<P>

View File

@@ -0,0 +1,61 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fstatfs</TITLE>
<P>Go to the <A HREF="syscalls_13.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_13.html">previous</A>, <A HREF="syscalls_15.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_15.html">next</A> section.<P>
<H2><A NAME="SEC14" HREF="syscalls_toc.html#SEC14" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC14">fstatfs and statfs</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int fstatfs(int <VAR>fd</VAR>, struct statfs *<VAR>buf</VAR>);</CODE>
<P>
<CODE>int statfs(char *<VAR>path</VAR>, struct statfs *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor we want to get the information from.
<P>
<VAR>path</VAR>: [in] the file path we want to get the information from.
<P>
<VAR>buf</VAR>: [out] points to the buffer that will contain the information.
<P>
<H3>DESCRIPTION</H3>
<P>
Those calls return information about the file systems on which the files
<VAR>fd</VAR> or <VAR>path</VAR> resides. The buffer has the following format:
<P>
<PRE>
struct statfs {
long f_type; /* file system type */
long f_bsize; /* block size */
long f_blocks; /* total number of blocks */
long f_bfree; /* total number of free blocks */
long f_bavail; /* number of free blocks for normal user */
long f_files; /* number of file nodes */
long f_ffree; /* number of free file nodes */
fsid_t f_fsid; /* file system id */
long f_namelen; /* maximum file name length */
long f_spare[6]; /* unused */
};
</PRE>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
In the case of <CODE>fstatfs</CODE>:
<P>
<UL>
<LI><CODE>EBADFS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOSYS</CODE> or <CODE>EIO</CODE>.
</UL>
<P>
In the case of <CODE>statfs</CODE>:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: path contains a caracter outside the ASCII 0-127 range.
<LI><CODE>ENOTDIR</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>EACCESS</CODE>, <CODE>ELOOP</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOSYS</CODE> or <CODE>EIO</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_13.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_13.html">previous</A>, <A HREF="syscalls_15.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_15.html">next</A> section.<P>

View File

@@ -0,0 +1,26 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fsync</TITLE>
<P>Go to the <A HREF="syscalls_14.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_14.html">previous</A>, <A HREF="syscalls_16.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_16.html">next</A> section.<P>
<H2><A NAME="SEC15" HREF="syscalls_toc.html#SEC15" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC15">fsync</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int fsync(int <VAR>fd</VAR>);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
Synchronizes the state of the file on disk with the state of the file in
core. (For one thing, it flushes the file buffers.)
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file to sync.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of: <CODE>EINVAL</CODE>, <CODE>EBADF</CODE> or <CODE>EIO</CODE>.
<P>
<P>Go to the <A HREF="syscalls_14.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_14.html">previous</A>, <A HREF="syscalls_16.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_16.html">next</A> section.<P>

View File

@@ -0,0 +1,47 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - ftruncate</TITLE>
<P>Go to the <A HREF="syscalls_15.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_15.html">previous</A>, <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">next</A> section.<P>
<H2><A NAME="SEC16" HREF="syscalls_toc.html#SEC16" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC16">ftruncate and truncate</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int ftruncate(int <VAR>fd</VAR>, size_t <VAR>length</VAR>);</CODE>
<P>
<CODE>int truncate(char *<VAR>path</VAR>, size_t <VAR>length</VAR>);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
Those calls truncate a file to a specified length. In the case of
<CODE>ftruncate</CODE>, the file must be opened for writing.
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor to truncate.
<P>
<VAR>path</VAR>: [in] points to the path of the file to truncate.
<P>
<VAR>length</VAR>: [in] the new size of the file.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
for <CODE>ftruncate</CODE>:
<P>
<UL>
<LI><CODE>ENOENT</CODE>: the file is invalid.
<LI><CODE>EBADF</CODE>, <CODE>EACCESS</CODE>.
</UL>
<P>
for <CODE>truncate</CODE>:
<P>
<UL>
<LI><CODE>ENOTDIR</CODE>, <CODE>EINVAL</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>EACCESS</CODE>, <CODE>ELOOP</CODE>, <CODE>EISDIR</CODE>, <CODE>EROFS</CODE>,
<CODE>ETXTBSY</CODE>, <CODE>EIO</CODE> or <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_15.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_15.html">previous</A>, <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">next</A> section.<P>

View File

@@ -0,0 +1,463 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - ioctl</TITLE>
<P>Go to the <A HREF="syscalls_16.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_16.html">previous</A>, <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">next</A> section.<P>
<H2><A NAME="SEC17" HREF="syscalls_toc.html#SEC17" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC17">ioctl</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int ioctl(int <VAR>d</VAR>, int <VAR>cmd</VAR>, ...);</CODE>
<P>
The third argument is called <CODE>char *<VAR>argp</VAR></CODE>.
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>d</VAR>: [in] the file descriptor of the file to manipulate.
<P>
<VAR>cmd</VAR>: [in] the type of request.
<P>
<VAR>argp</VAR>: depends on the request.
<P>
<H3>DESCRIPTION</H3>
<P>
Controls the io parameters of character special devices (tty, mt, etc.).
The values that <VAR>cmd</VAR> may take for file operations are:
<P>
<DL COMPACT>
<DT><CODE>FIOCLEX</CODE>
<DD>Sets the close-on-exec flag of the file.
<P>
<DT><CODE>FIONCLEX</CODE>
<DD>Clears the close-on-exec flag of the file.
<P>
<DT><CODE>FIONBIO</CODE>
<DD>If <VAR>argp</VAR> is true, sets the file <CODE>O_NONBLOCK</CODE> flag, otherwise it
clears the flag.
<P>
<DT><CODE>FIOASYNC</CODE>
<DD>If <VAR>argp</VAR> is true, sets the file <CODE>O_SYNC</CODE> flag, otherwise it
clears the flag. (This flag is not used as of Linux 1.0.)
<P>
<DT><CODE>FIONREAD</CODE>
<DD>Returns to a buffer pointed to by <VAR>argp</VAR>, the number of bytes
immediately readable from the file.
<P>
<DT><CODE>FIOSETOWN</CODE>
<DD>Sets the owner of the file to <VAR>argp</VAR> (a pid). The owner is the one
that receives the <CODE>SIGURG</CODE> and <CODE>SIGIO</CODE> signals. (Only for
sockets.)
<P>
<DT><CODE>FIOGETOWN</CODE>
<DD>Returns the owner of the file to a buffer pointed to by <VAR>argp</VAR>.
(Only for sockets.)
<P>
<DT><CODE>FIGETBSZ</CODE>
<DD>Returns the block size of the file to a buffer pointed to by <VAR>argp</VAR>.
(Seems non-standard.)
<P>
<DT><CODE>FIBMAP</CODE>
<DD>Returns the block number in the fs corresponding to the <VAR>argp</VAR>'th
block in the file. (I have guessed right? Anyway, this is non-standard.)
</DL>
The values for magnetic tape operations are:
<P>
<DL COMPACT>
<DT><CODE>MTIOCTOP</CODE>
<DD>Perform an operation on a magnetic tape. <VAR>argp</VAR> is a pointer to a
<CODE>mtop</CODE> structure.
<P>
<DT><CODE>MTIOCGET</CODE>
<DD>Get magnetic tape status. <VAR>argp</VAR> is a pointer to a <CODE>mtget</CODE>
structure.
<P>
<DT><CODE>MTIOCPOS</CODE>
<DD>Set magnetic tape position. <VAR>argp</VAR> points to a long integer
specifying the block number to go to.
</DL>
<P>
The section on magnetic tapes will remain incomplete for a while... I
don't have a clue how it is supposed to work.
<P>
The values for sockets operations are:
<P>
<DL COMPACT>
<DT><CODE>SIOCSPGRP</CODE>
<DD>Same as <CODE>FIOSETOWN</CODE>.
<P>
<DT><CODE>SIOCGPGRP</CODE>
<DD>Same as <CODE>FIOGETOWN</CODE>.
<P>
<DT><CODE>SIOCATMARK</CODE>
<DD>Not supported.
<P>
<DT><CODE>SIOCADDRT</CODE>
<DD>Adds a routing entry in the routing table of the system. The task must
have superuser privileges to perform that operation. <VAR>argp</VAR> points
to a <CODE>rtentry</CODE> structure.
<P>
<DT><CODE>SIOCDELRT</CODE>
<DD>Removes a routing entry from the routing table of the system. The task
must have superuser privileges to perform that operation. <VAR>argp</VAR>
points to a <CODE>rtentry</CODE> structure.
<P>
<DT><CODE>SIOCADDRTOLD</CODE>
<DD>Same as <CODE>SIOCADDRT</CODE> but uses an <CODE>old_rtentry</CODE> structure.
Obsolete. Do not use.
<P>
<DT><CODE>SIOCDELRTOLD</CODE>
<DD>Same as <CODE>SIOCDELRT</CODE> but uses an <CODE>old_rtentry</CODE> structure.
Obsolete. Do not use.
<P>
<DT><CODE>SIOCDARP</CODE>
<DD>Deletes an ARP entry. The calling task must have superuser privileges.
<VAR>argp</VAR> points to an <CODE>arpreq</CODE> structure.
<P>
<DT><CODE>SIOCGARP</CODE>
<DD>Retreive an ARP entry. The calling task must have superuser privileges.
<VAR>argp</VAR> points to an <CODE>arpreq</CODE> structure.
<P>
<DT><CODE>SIOCSARP</CODE>
<DD>Sets an ARP entry. The calling task must have superuser privileges.
<VAR>argp</VAR> points to an <CODE>arpreq</CODE> structure.
<P>
<DT><CODE>IP_SET_DEV</CODE>
<DD>Not supported.
<P>
<DT><CODE>SIOCGIFCONF</CODE>
<DD>Reteives the network interface configuration list in a <CODE>ifconf</CODE>
structure.
<P>
<DT><CODE>SIOCGIFFLAGS</CODE>
<DD>Gets the interface flags. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure.
<P>
<DT><CODE>SIOCSIFFLAGS</CODE>
<DD>Sets the interface flags. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFADDR</CODE>
<DD>Gets the interface address. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure.
<P>
<DT><CODE>SIOCSIFADDR</CODE>
<DD>Sets the interface address. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFDSTADDR</CODE>
<DD>Gets the interface remote address. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure.
<P>
<DT><CODE>SIOCSIFDSTADDR</CODE>
<DD>Sets the interface remote address. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFBRDADDR</CODE>
<DD>Gets the interface broadcast address. <VAR>argp</VAR> points to an
<CODE>ifreq</CODE> structure.
<P>
<DT><CODE>SIOCSIFBRDADDR</CODE>
<DD>Sets the interface broadcast address. <VAR>argp</VAR> points to an
<CODE>ifreq</CODE> structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFNETMASK</CODE>
<DD>Gets the interface network mask. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure.
<P>
<DT><CODE>SIOCSIFNETMASK</CODE>
<DD>Sets the interface network mask. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFMETRIC</CODE>
<DD>Gets the interface routing metric. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure.
<P>
<DT><CODE>SIOCSIFMETRIC</CODE>
<DD>Sets the interface routing metric. <VAR>argp</VAR> points to an <CODE>ifreq</CODE>
structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCGIFMEM or SIOCSIFMEM</CODE>
<DD>Not supported.
<P>
<DT><CODE>SIOCGIFMTU</CODE>
<DD>Gets the interface maximum transmission unit. <VAR>argp</VAR> points to an
<CODE>ifreq</CODE> structure.
<P>
<DT><CODE>SIOCSIFMTU</CODE>
<DD>Sets the interface maximum transmission unit. <VAR>argp</VAR> points to an
<CODE>ifreq</CODE> structure. The calling task must have superuser privileges.
<P>
<DT><CODE>SIOCSIFLINK</CODE>
<DD>Links in an I/O driver into the operating system kernel.
<P>
<DT><CODE>SIOCGIFHWADDR</CODE>
<DD>Gets the interface hardware address. <VAR>argp</VAR> points to an
<CODE>ifreq</CODE> structure.
<P>
<DT><CODE>SIOCSIFHWADDR</CODE>
<DD>Not supported.
<P>
<DT><CODE>SIOCGIFNAME</CODE>
<DD>Not supported.
<P>
<DT><CODE>DDIOCSDBG:</CODE>
<DD>Set the DDI debug level.
</DL>
<P>
<PRE>
struct rtentry {
unsigned long rt_hash; /* hash key for lookups */
struct sockaddr rt_dst; /* target address */
struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
struct sockaddr rt_genmask; /* target network mask (IP) */
short rt_flags;
short rt_refcnt;
unsigned long rt_use;
struct ifnet *rt_ifp;
short rt_metric; /* +1 for binary compatibility! */
char *rt_dev; /* forcing the device at add */
};
</PRE>
<P>
<PRE>
struct old_rtentry {
unsigned long rt_genmask;
struct sockaddr rt_dst;
struct sockaddr rt_gateway;
short rt_flags;
short rt_refcnt;
unsigned long rt_use;
char *rt_dev;
};
</PRE>
<P>
<VAR>rt_flags</VAR> is a or'ed combinaison of one or more of the following:
<P>
<DL COMPACT>
<DT><CODE>RTF_UP</CODE>
<DD>the route is usable.
<P>
<DT><CODE>RTF_GATEWAY</CODE>
<DD>the destination is a gateway.
<P>
<DT><CODE>RTF_HOST</CODE>
<DD>the entry is a host. (If this flag is not set, the entry is a net.)
</DL>
<P>
<PRE>
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
};
</PRE>
<P>
The <CODE>arp_flags</CODE> member may be one or more or'ed values of the
following:
<P>
<DL COMPACT>
<DT><CODE>ATF_INUSE</CODE>
<DD>the entry is in use.
<P>
<DT><CODE>ATF_COM</CODE>
<DD>the entry is complete (ha is valid).
<P>
<DT><CODE>ATF_PERM</CODE>
<DD>the entry is permanent.
<P>
<DT><CODE>ATF_PUBL</CODE>
<DD>publish entry.
<P>
<DT><CODE>ATF_USETRAILERS</CODE>
<DD>has requested trailers.
</DL>
<P>
Here is the layout of the <CODE>ifconf</CODE> structure used to get the
configuration list:
<P>
<PRE>
struct ifconf {
int ifc_len; /* size of buffer */
union {
caddr_t ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
};
</PRE>
<P>
Here is the layout of the <CODE>ifreq</CODE> structure used to send/receive
interface data:
<P>
<PRE>
struct ifreq {
#define IFHWADDRLEN 6
#define IFNAMSIZ 16
union {
char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
char ifrn_hwaddr[IFHWADDRLEN];
} ifr_ifrn;
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
struct sockaddr ifru_netmask;
short ifru_flags;
int ifru_metric;
int ifru_mtu;
caddr_t ifru_data;
} ifr_ifru;
};
</PRE>
<P>
For terminal I/O, the following commands may be used:
<P>
<DL COMPACT>
<DT><CODE>TCGETS</CODE>
<DD>Gets the <CODE>termios</CODE> structure associated with the terminal.
<VAR>argp</VAR> points to a <CODE>termios</CODE> structure.
<P>
<DT><CODE>TCSETS</CODE>
<DD>Sets the <CODE>termios</CODE> structure associated with the terminal. The
change is immediate. <VAR>argp</VAR> points to a <CODE>termios</CODE> structure.
<P>
<DT><CODE>TCSETSW</CODE>
<DD>Same as <CODE>TCSETS</CODE> but wait until the output buffer is empty before
performing the change.
<P>
<DT><CODE>TCSETSF</CODE>
<DD>Same as <CODE>TCSETS</CODE> but wait until the output buffer is empty and
flushes the input buffer before performing the change.
<P>
<DT><CODE>TCGETA</CODE>
<DD>Gets the <CODE>termio</CODE> structure associated with the terminal.
<VAR>argp</VAR> points to a <CODE>termio</CODE> structure.
<P>
<DT><CODE>TCSETS</CODE>
<DD>Sets the <CODE>termio</CODE> structure associated with the terminal. The
change is immediate. <VAR>argp</VAR> points to a <CODE>termio</CODE> structure.
<P>
<DT><CODE>TCSETAW</CODE>
<DD>Same as <CODE>TCSETA</CODE> but wait until the output buffer is empty before
performing the change.
<P>
<DT><CODE>TCSETAF</CODE>
<DD>Same as <CODE>TCSETA</CODE> but wait until the output buffer is empty and
flushes the input buffer before performing the change.
<P>
<DT><CODE>TCXONC</CODE>
<DD>Starts or stops the tty flow. <VAR>argp</VAR> may be one of the following:
<P>
<DT><CODE>TCOOFF</CODE>
<DD>Stops output.
<P>
<DT><CODE>TCOON</CODE>
<DD>Restart output.
<P>
<DT><CODE>TCIOFF</CODE>
<DD>Stops input.
<P>
<DT><CODE>TCION</CODE>
<DD>Restart input.
<P>
<DT><CODE>TCFLSH</CODE>
<DD>Flushes the tty. <VAR>argp</VAR> may be <CODE>TCIFLUSH</CODE> to flush the input,
<CODE>TCOFLUSH</CODE> to flush the output or <CODE>TCIOFLUSH</CODE> to flush both.
<P>
<DT><CODE>TIOCEXCL</CODE>
<DD>Sets the tty in exclusive mode. No further <CODE>open</CODE> operations on the
terminal are permited.
<P>
<DT><CODE>TIOCNXCL</CODE>
<DD>Disable exclusive mode. <CODE>open</CODE> operations are now permitted.
<P>
<DT><CODE>TIOCSCTTY</CODE>
<DD>Sets that termial as the controlling terminal of the current task. The
calling task must be a session leader and not have a controlling tty
already. If the task does not have superuser privileges, normal
authorisations checks are performed. If the task has superuser
privileges and <VAR>argp</VAR> is set to 1, the terminal will be set as the
controling terminal even if it was already the controling terminal of
another task.
<P>
<DT><CODE>TIOCGPGRP</CODE>
<DD>Gets the process group id associated with this terminal. <VAR>argp</VAR>
points to an integer that is set to that id.
<P>
<DT><CODE>TIOCSPGRP</CODE>
<DD>Associate the terminal to the process group which has an id equals to
<VAR>argp</VAR>. The processes of the process group must have the same real
or saved uid of as the effective or save uid of the calling task, or be
descendants of the calling process or the calling process must have
superuser privileges.
<P>
<DT><CODE>TIOCOUTQ</CODE>
<DD>Sets an integer pointed to by <VAR>argp</VAR> to the number of bytes in the
output queue that are not sent.
<P>
<DT><CODE>TIOCSTI</CODE>
<DD>Insert the value of <VAR>argp</VAR> into the input queue of the terminal.
<P>
<DT><CODE>TIOCGWINSZ</CODE>
<DD>Returns the window size into a <CODE>winsize</CODE> structure pointed to by
<VAR>argp</VAR>.
<P>
<DT><CODE>TIOCSWINSZ</CODE>
<DD>Sets the window size to the <CODE>winsize</CODE> structure pointed to by
<VAR>argp</VAR>.
<P>
<DT><CODE>TIOCCONS</CODE>
<DD>Controls the redirection of the console. If <VAR>fd</VAR> is a console, the
redirection is cancelled. If <VAR>fd</VAR> is a pseudo console slave, the
console is redirected to that slave. If <VAR>fd</VAR> is a pseudo console
master, the console is redirected to its slave. The calling taks must be
have superuser privileges.
<P>
<DT><CODE>TIOCNOTTY</CODE>
<DD>Dissociate the controling terminal from the current task. The calling
task must be process leader.
<P>
<DT><CODE>TIOCGETD</CODE>
<DD>Retreives the terminal current line discipline mode. The value is store
to the area pointed to by <VAR>argp</VAR>.
<P>
<DT><CODE>TIOCSETD</CODE>
<DD>Sets the terminal line discipline mode to the value of <VAR>argp</VAR>.
<P>
<DT><CODE>TIOCGLCKTRMIOS</CODE>
<DD>Gets the locking status of the <CODE>termios</CODE> structure of the terminal.
<VAR>argp</VAR> points to a <VAR>termios</VAR> structure.
<P>
<DT><CODE>TIOCSLCKTRMIOS</CODE>
<DD>Sets the locking status of the <CODE>termios</CODE> structure of the terminal.
<VAR>argp</VAR> points to a <VAR>termios</VAR> structure that contains the new
flags. The calling task must have superuser privileges.
<P>
<DT><CODE>TIOCPKT</CODE>
<DD>If <VAR>argp</VAR> is 1, it sets the <CODE>packet</CODE> flag in the tty structure,
otherwise it sets the flag to zero. (What purpose does that serves?)
<P>
<DT><CODE>TIOCLINUX</CODE>
<DD>Linux dependent.
<P>
<DT><CODE>TCSBRK</CODE>
<DD>Waits for the output queue to become empty, then, if <VAR>argp</VAR> is 1,
sends a break.
<P>
<DT><CODE>TCSBRKP</CODE>
<DD>Same as <CODE>TCSBRK</CODE>?
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>cmd</VAR> or <VAR>argp</VAR> have an invalid value.
<LI><CODE>ENOTTY</CODE>: <VAR>d</VAR> is not a character special device or the
request made on <VAR>d</VAR> is not valid for this type of device.
<LI><CODE>EBADF</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_16.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_16.html">previous</A>, <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">next</A> section.<P>

View File

@@ -0,0 +1,36 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - link</TITLE>
<P>Go to the <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">previous</A>, <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">next</A> section.<P>
<H2><A NAME="SEC18" HREF="syscalls_toc.html#SEC18" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC18">link</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int link(const char *<VAR>src</VAR>, const char *<VAR>new</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>src</VAR>: [in] points the the file we want to add a link to.
<P>
<VAR>new</VAR>: [in] points to the path for the new link.
<H3>DESCRIPTION</H3>
<P>
Creates a new (hard) link to a file. There is no way to distinguish
the links.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the file system does not support hard links or
<VAR>oldpath</VAR> is the <CODE>.</CODE> or <CODE>..</CODE> entry of a directory.
<LI><CODE>EXDEV</CODE>, <CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>,
<CODE>ENOENT</CODE>, <CODE>ENOTDIR</CODE>, <CODE>ENOMEM</CODE>, <CODE>EROFS</CODE>,
<CODE>EEXIST</CODE>, <CODE>EMLINK</CODE>, <CODE>ELOOP</CODE> and. <CODE>ESPC</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_17.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_17.html">previous</A>, <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">next</A> section.<P>

View File

@@ -0,0 +1,49 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - lseek</TITLE>
<P>Go to the <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">next</A> section.<P>
<H2><A NAME="SEC19" HREF="syscalls_toc.html#SEC19" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC19">lseek</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>off_t lseek(int <VAR>fd</VAR>, off_t <VAR>offset</VAR>, int <VAR>whence</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor to manipulate.
<P>
<VAR>offset</VAR>: [in] the offset modificator.
<P>
<VAR>whence</VAR>: [in] indicates how to modify the offset.
<P>
<H3>DESCRIPTION</H3>
<P>
Changes the read/write file offset of a file descriptor. The
<VAR>offset</VAR> parameter is interpreted according to the possible
following values of <VAR>whence</VAR>:
<P>
<DL COMPACT>
<DT><CODE>SEEK_SET</CODE>
<DD>the new file offset will be <VAR>offset</VAR>.
<P>
<DT><CODE>SEEK_CUR</CODE>
<DD>the new file offset will be the current offset plus <VAR>offset</VAR>.
<P>
<DT><CODE>SEEK_END</CODE>
<DD>the new file offset will be the end of the file plus <VAR>offset</VAR>.
</DL>
<P>
If we seek past the end of a file, the new file region contain 0.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns the new file offset. On errror, it returns
-1 and sets <CODE>errno</CODE> to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>whence</VAR> does not have a valid value.
<LI><CODE>EBADF</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_18.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_18.html">previous</A>, <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">next</A> section.<P>

View File

@@ -0,0 +1,53 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - Conventions</TITLE>
<P>Go to the <A HREF="syscalls_1.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_1.html">previous</A>, <A HREF="syscalls_3.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_3.html">next</A> section.<P>
<H2><A NAME="SEC2" HREF="syscalls_toc.html#SEC2" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC2">Conventions</A></H2>
<P>
Each syscall has its own subsection and each of this subsections are
divided in four subsubsections:
<P>
<DL COMPACT>
<DT>SYNOPSIS
<DD>contains the syscall definition in ANSI C.
<P>
<DT>PARAMETERS
<DD>describes each parameter of the syscall and specifies the flow of
information for each parameter. Each syscall is followed by <SAMP>`[in]'</SAMP>
when the information flows into the syscall, <SAMP>`[out]'</SAMP> when it flows
out if the syscall and <SAMP>`[in out]'</SAMP> when it flows in on entry and
flows out on return. Of course, in the case of pointers, the pointer
itself always flows in and the bracketed notation indicates the flow of
the data the pointer points to.
<P>
<DT>DESCRIPTON
<DD>describes the operations performed by that syscall.
<P>
<DT>RETURN VALUE
<DD>describes possbile return values from the syscall and the possible
values of <CODE>errno</CODE> for each possible errors. The meaning of those
error codes are not listed if they are evident. See section <A HREF="syscalls_114.html#SEC114" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_114.html#SEC114">Errors</A> For
example, <CODE>EFAULT</CODE> always means that an invalid address or an
address range with incorrect protection attirbutes was passed to the
syscall. If an error code has special meaning for the described syscall,
this meaning is included in the description.
</DL>
<P>
Typeface conventions:
<P>
<DL COMPACT>
<DT>source code
<DD><CODE>code</CODE>.
<P>
<DT>variables
<DD><VAR>var</VAR>
<P>
<DT>examples
<DD><PRE>
this is an example...
vuzul...
bwine...
</PRE>
</DL>
<P>Go to the <A HREF="syscalls_1.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_1.html">previous</A>, <A HREF="syscalls_3.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_3.html">next</A> section.<P>

View File

@@ -0,0 +1,37 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - mkdir</TITLE>
<P>Go to the <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">previous</A>, <A HREF="syscalls_21.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_21.html">next</A> section.<P>
<H2><A NAME="SEC20" HREF="syscalls_toc.html#SEC20" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC20">mkdir</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int mkdir(const char *<VAR>path</VAR>, mode_t <VAR>mode</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path of the new directory.
<P>
<VAR>mode</VAR>: [in] the access bits of the new directory.
<H3>DESCRIPTION</H3>
<P>
Creates a new directory. The uid of the new directory is the same as the
effective uid of the calling task. The gid of the new directory is the
same as its parent directory.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the path contains a character not in the ASCII
[0,127] range.
<LI><CODE>ENOTDIR</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>EACCESS</CODE>, <CODE>ELOOP</CODE>, <CODE>EPERM</CODE>, <CODE>EROFS</CODE>, <CODE>EEXIST</CODE>,
<CODE>ENOSPC</CODE>, <CODE>EDQUOT</CODE>, <CODE>EIO</CODE> and <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_19.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_19.html">previous</A>, <A HREF="syscalls_21.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_21.html">next</A> section.<P>

View File

@@ -0,0 +1,42 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - mknod</TITLE>
<P>Go to the <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">previous</A>, <A HREF="syscalls_22.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_22.html">next</A> section.<P>
<H2><A NAME="SEC21" HREF="syscalls_toc.html#SEC21" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC21">mknod</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int mknod(const char *<VAR>path</VAR>, mode_t <VAR>mode</VAR>, dev_t <VAR>dev</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path of the new file.
<P>
<VAR>mode</VAR>: [in] specifies the kind of special file to create. (Do not
use it to specify the access bits of the file.)
<P>
<VAR>dev</VAR>: [in] the major and minor numbers of the new device.
<P>
<H3>DESCRIPTION</H3>
<P>
Creates a special device file node. Only tasks with superuser privileges
may use this call. The access bits of the new file are the same as those
of the <CODE>umask</CODE> of the current task. If <VAR>mode</VAR> does not specify
a special device file, then <VAR>dev</VAR> is ignored.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the path contains a caracter that is outside the
range [0,127].
<LI><CODE>EPERM</CODE>: the calling process does not have superuser privileges.
<LI><CODE>ENOTDIR</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>EACCESS</CODE>, <CODE>ELOOP</CODE>, <CODE>EIO</CODE>, <CODE>ENOSPC</CODE>, <CODE>EDQUOT</CODE>,
<CODE>EROFS</CODE>, <CODE>EEXIST</CODE> and <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_20.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_20.html">previous</A>, <A HREF="syscalls_22.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_22.html">next</A> section.<P>

View File

@@ -0,0 +1,65 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - mount</TITLE>
<P>Go to the <A HREF="syscalls_21.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_21.html">previous</A>, <A HREF="syscalls_23.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_23.html">next</A> section.<P>
<H2><A NAME="SEC22" HREF="syscalls_toc.html#SEC22" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC22">mount and umount</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int mount(const char *<VAR>specialfile</VAR>, const char *<VAR>dir</VAR>,
const char *<VAR>filesystemtype</VAR>,unsigned long <VAR>rwflag</VAR>, const void
*<VAR>data</VAR>);</CODE>
<P>
<CODE>int umount(const char *<VAR>specialfile</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>specialfile</VAR>: [in] points to the path of the file system to mount.
<P>
<VAR>dir</VAR>: [in] points to the directory where to mount the file system.
<P>
<CODE>filesystemtype</CODE>: [in] the type of file system.
<P>
<VAR>rwflag</VAR>: [in] specifies read/write accesses to the file system.
<P>
<VAR>data</VAR>: [in] fs dependent parameters.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>mount</CODE> mounts the file system and <CODE>umount</CODE> unmounts it. Only
a task with superuser privileges may call those two syscalls.
<P>
The <VAR>rwflag</VAR> parameter may take the one or more of following or'ed
values:
<P>
<DL COMPACT>
<DT><CODE>MS_RDONLY</CODE>
<DD>mount read-only.
<P>
<DT><CODE>MS_NOSUID</CODE>
<DD>ignore suid and sgid bits.
<P>
<DT><CODE>MS_NODEV</CODE>
<DD>disallow access to device special files.
<P>
<DT><CODE>MS_NOEXEC</CODE>
<DD>disallow program execution.
<P>
<DT><CODE>MS_SYNC</CODE>
<DD>writes are synced at once.
<P>
<DT><CODE>MS_REMOUNT</CODE>
<DD>alter flags of a mounted FS.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
<UL>
<LI><CODE>EPERM</CODE>, <CODE>ENODEV</CODE>, <CODE>ENOTBLK</CODE>, <CODE>ENXIO</CODE>,
<CODE>EMFILE</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOMEM</CODE>, <CODE>EINVAL</CODE>,
<CODE>EBUSY</CODE>, <CODE>ENOTDIR</CODE>, <CODE>ENOENT</CODE>, <CODE>ENAMETOOLONG</CODE>,
<CODE>ELOOP</CODE>, <CODE>EROFS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_21.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_21.html">previous</A>, <A HREF="syscalls_23.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_23.html">next</A> section.<P>

View File

@@ -0,0 +1,30 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - pipe</TITLE>
<P>Go to the <A HREF="syscalls_22.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_22.html">previous</A>, <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">next</A> section.<P>
<H2><A NAME="SEC23" HREF="syscalls_toc.html#SEC23" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC23">pipe</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int pipe(int <VAR>filedes[2]</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>filedes</VAR>: [out] the array containing the end points.
<H3>DESCRIPTION</H3>
<P>
Creates a pair of pipe end points. The flow is from <VAR>filedes[1]</VAR> to
<VAR>filedes[0]</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EMFILE</CODE>, <CODE>ENFILE</CODE> and <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_22.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_22.html">previous</A>, <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - read</TITLE>
<P>Go to the <A HREF="syscalls_23.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_23.html">previous</A>, <A HREF="syscalls_25.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_25.html">next</A> section.<P>
<H2><A NAME="SEC24" HREF="syscalls_toc.html#SEC24" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC24">read</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int read(int <VAR>fd</VAR>, char *<VAR>buf</VAR>, size_t <VAR>count</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor to read from.
<P>
<VAR>buf</VAR>: [out] the buffer that will contain information read.
<P>
<VAR>count</VAR>: [in] the maximal size of <VAR>buf</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Reads up to <VAR>count</VAR> bytes into <VAR>buf</VAR> from <VAR>fd</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>fd</VAR> cannot be read.
<LI><CODE>EINTR</CODE>, <CODE>EAGAIN</CODE>, <CODE>EISDIR</CODE>, <CODE>EBADF</CODE> and
<CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_23.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_23.html">previous</A>, <A HREF="syscalls_25.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_25.html">next</A> section.<P>

View File

@@ -0,0 +1,30 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - readdir</TITLE>
<P>Go to the <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">previous</A>, <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">next</A> section.<P>
<H2><A NAME="SEC25" HREF="syscalls_toc.html#SEC25" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC25">readdir</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>struct dirent *readdir(DIR *<VAR>dir</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>dir</VAR>: [in] the file descriptor of a directory.
<P>
<H3>DESCRIPTION</H3>
<P>
This call returns in a <CODE>dirent</CODE> structure the next entry of a
directory or <CODE>NULL</CODE> if the end is reached or an error occurs. The
area where the pointer returned by readdir points to is a static space
that is overwritten by subsequent calls to readdir.
<P>
(It there no way to implement that call in user space???)
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns a pointer to the <CODE>dirent</CODE> structure. On error,
returns -1 and sets <CODE>errno</CODE> to the following value: <CODE>EBADF</CODE>.
<P>
<P>Go to the <A HREF="syscalls_24.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_24.html">previous</A>, <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">next</A> section.<P>

View File

@@ -0,0 +1,37 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - readlink</TITLE>
<P>Go to the <A HREF="syscalls_25.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_25.html">previous</A>, <A HREF="syscalls_27.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_27.html">next</A> section.<P>
<H2><A NAME="SEC26" HREF="syscalls_toc.html#SEC26" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC26">readlink</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int readlink(const char *<VAR>path</VAR>, char *<VAR>buf</VAR>, size_t
<VAR>bufsiz</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the symlink to read.
<P>
<VAR>buf</VAR>: [out] points to the buffer where to put the information.
<P>
<VAR>bufsiz</VAR>: [in] the maximum size of the buffer.
<P>
<H3>DESCRIPTION</H3>
<P>
Reads the content of a symlink.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns the number of bytes read. On error, returns -1 and
sets <CODE>errno</CODE> to one of the following value:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the path contains a character outside the [0,127]
range or the file is not a symlink.
<LI><CODE>ENOTDIR</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>EACCESS</CODE>, <CODE>ELOOP</CODE>, <CODE>EIO</CODE> or <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_25.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_25.html">previous</A>, <A HREF="syscalls_27.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_27.html">next</A> section.<P>

View File

@@ -0,0 +1,38 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - rename</TITLE>
<P>Go to the <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">previous</A>, <A HREF="syscalls_28.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_28.html">next</A> section.<P>
<H2><A NAME="SEC27" HREF="syscalls_toc.html#SEC27" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC27">rename</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int rename(const char *<VAR>src</VAR>, const char *<VAR>dest</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>src</VAR>: [in] the file to more/rename.
<P>
<VAR>dest</VAR>: [in] the new name or place for the file.
<P>
<H3>DESCRIPTION</H3>
<P>
Renames and move files. The destination is overwriten if it already exists.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EISDIR</CODE>: <VAR>newpath</VAR> is an existing directory, but
<VAR>src</VAR> is not.
<LI><CODE>EPERM</CODE>: the directory containing <VAR>src</VAR> and the task's
effective uid is not equal to the uid of the file or the directory
containing it, or the file system does not support renaming.
<LI><CODE>EXDEV</CODE>, <CODE>ENOTEMPTY</CODE>, <CODE>EMLINK</CODE>, <CODE>ENOTDIR</CODE>,
<CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOMEM</CODE>, <CODE>EROFS</CODE>, <CODE>ELOOP</CODE> or <CODE>ENOSPC</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_26.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_26.html">previous</A>, <A HREF="syscalls_28.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_28.html">next</A> section.<P>

View File

@@ -0,0 +1,34 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - rmdir</TITLE>
<P>Go to the <A HREF="syscalls_27.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_27.html">previous</A>, <A HREF="syscalls_29.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_29.html">next</A> section.<P>
<H2><A NAME="SEC28" HREF="syscalls_toc.html#SEC28" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC28">rmdir</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int rmdir(const char *<VAR>path</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to path of directory to remove.
<P>
<H3>DESCRIPTION</H3>
<P>
Removes a directory. The directory to be removed must be empty.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the file system does not support directory removal,
or the directory containing <VAR>path</VAR> and the task's effective uid is
not equal to the uid of the file or the directory containing it.
<LI><CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOTDIR</CODE>, <CODE>ENOTEMPTY</CODE>, <CODE>EBUSY</CODE>, <CODE>ENOMEM</CODE>,
<CODE>EROFS</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_27.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_27.html">previous</A>, <A HREF="syscalls_29.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_29.html">next</A> section.<P>

View File

@@ -0,0 +1,80 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - select</TITLE>
<P>Go to the <A HREF="syscalls_28.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_28.html">previous</A>, <A HREF="syscalls_30.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_30.html">next</A> section.<P>
<H2><A NAME="SEC29" HREF="syscalls_toc.html#SEC29" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC29">select</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int select(int <VAR>numfds</VAR>, fd_set *<VAR>readfds</VAR>, fd_set
*<VAR>writefds</VAR>, fd_set *<VAR>exceptfds</VAR>, struct timeval *<VAR>timeout</VAR>);</CODE>
<P>
Macro utilities:
<P>
<CODE>FD_CLR(int <VAR>fd</VAR>, fd_set *<VAR>set</VAR>);</CODE>
<P>
<CODE>FD_ISSET(int <VAR>fd</VAR>, fd_set *<VAR>set</VAR>);</CODE>
<P>
<CODE>FD_SET(int <VAR>fd</VAR>, fd_set *<VAR>set</VAR>);</CODE>
<P>
<CODE>FD_ZERO(fd_set *<VAR>set</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>numfds</VAR>: [in] the number of file descriptors to watch.
<P>
<VAR>readfds</VAR>: [in out] on entry, the file descriptor to watch for
readability. On exit, the file descriptors that are readable.
<P>
<VAR>writefds</VAR>: [in out] on entry, the file descriptors to watch for
writability. On exit, the file descriptors that are writable.
<P>
<VAR>exceptfds</VAR>: [in out] on entry, the file descriptor to watch
exceptions. On exit, the file descriptors have exceptions raised.
<P>
<VAR>timeout</VAR>: [in out] on entry, the timeout value. On return, contains
the remaining time.
<P>
<H3>DESCRIPTION</H3>
<P>
Makes the calling task sleep until some conditions on the file
descriptors become true or until a timeout value expires. There are
three conditions for which files may be tested:
<P>
<UL>
<LI>with <VAR>readfds</VAR>: Can the file be read?
<LI>with <VAR>writefds</VAR>: Can the file be written?
<LI>with <VAR>exceptfds</VAR>: Is there any exception pending on the file?
</UL>
<P>
Whenever one of the conditions on one the specified files is true, the
call returns.
<P>
There are four utilities provided for manipulation of the file
descriptor sets:
<P>
<DL COMPACT>
<DT><CODE>FD_SET</CODE>
<DD>sets the specified file descriptor flag.
<P>
<DT><CODE>FD_CLR</CODE>
<DD>clears the specified file descriptor flag.
<P>
<DT><CODE>FD_ZERO</CODE>
<DD>clears the set.
<P>
<DT><CODE>FD_ISSET</CODE>
<DD>returns true if the file descriptor flag is set.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>EINTR</CODE>, <CODE>EINVAL</CODE> or <CODE>ENOMEM</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_28.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_28.html">previous</A>, <A HREF="syscalls_30.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_30.html">next</A> section.<P>

View File

@@ -0,0 +1,13 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fs</TITLE>
<P>Go to the <A HREF="syscalls_2.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_2.html">previous</A>, <A HREF="syscalls_4.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_4.html">next</A> section.<P>
<H1><A NAME="SEC3" HREF="syscalls_toc.html#SEC3" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC3">File system subsystem</A></H1>
<P>
The calls of the fs subsystem are defined here. Take note that the error
codes that those call return are file system dependent. (eg. A call
operating on a file accessible through NFS might return a network error
whereas a ext2fs accessible file wouldn't.)
<P>
<P>Go to the <A HREF="syscalls_2.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_2.html">previous</A>, <A HREF="syscalls_4.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_4.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - symlink</TITLE>
<P>Go to the <A HREF="syscalls_29.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_29.html">previous</A>, <A HREF="syscalls_31.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_31.html">next</A> section.<P>
<H2><A NAME="SEC30" HREF="syscalls_toc.html#SEC30" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC30">symlink</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int symlink(const char *<VAR>src</VAR>, const char *<VAR>dest</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>src</VAR>: [in] the new link.
<P>
<VAR>dest</VAR>: [in] the file to point to.
<P>
<H3>DESCRIPTION</H3>
<P>
Creates a symlink form <VAR>src</VAR> to <VAR>dest</VAR>. The destination does not
need to exist at the time of the creation of the link.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the file system does not support symlinks.
<LI><CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOTDIR</CODE>, <CODE>ENOMEM</CODE>, <CODE>EROFS</CODE>, <CODE>EEXIST</CODE>,
<CODE>ELOOP</CODE>, <CODE>ENOSPC</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_29.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_29.html">previous</A>, <A HREF="syscalls_31.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_31.html">next</A> section.<P>

View File

@@ -0,0 +1,21 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - sync</TITLE>
<P>Go to the <A HREF="syscalls_30.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_30.html">previous</A>, <A HREF="syscalls_32.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_32.html">next</A> section.<P>
<H2><A NAME="SEC31" HREF="syscalls_toc.html#SEC31" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC31">sync</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int sync(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
Brings the hard disk state of the file system in sync with the internal
state of the file system.
<P>
<H3>RETURN VALUE</H3>
<P>
Always zero.
<P>
<P>Go to the <A HREF="syscalls_30.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_30.html">previous</A>, <A HREF="syscalls_32.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_32.html">next</A> section.<P>

View File

@@ -0,0 +1,24 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - umask</TITLE>
<P>Go to the <A HREF="syscalls_31.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_31.html">previous</A>, <A HREF="syscalls_33.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_33.html">next</A> section.<P>
<H2><A NAME="SEC32" HREF="syscalls_toc.html#SEC32" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC32">umask</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int umask(int <VAR>mask</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>mask</VAR>: [in] the new mask.
<P>
<H3>DESCRIPTION</H3>
<P>
Sets the umask value to <CODE><VAR>mask</VAR>&#38;0777</CODE>.
<P>
<H3>RETURN VALUE</H3>
<P>
The previous value of the mask.
<P>
<P>Go to the <A HREF="syscalls_31.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_31.html">previous</A>, <A HREF="syscalls_33.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_33.html">next</A> section.<P>

View File

@@ -0,0 +1,33 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - unlink</TITLE>
<P>Go to the <A HREF="syscalls_32.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_32.html">previous</A>, <A HREF="syscalls_34.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_34.html">next</A> section.<P>
<H2><A NAME="SEC33" HREF="syscalls_toc.html#SEC33" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC33">unlink</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int unlink(const char *<VAR>path</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path of the file to unlink.
<P>
<H3>DESCRIPTION</H3>
<P>
Deletes a link to a file. If the file is not used and it was the last
link, the file is also deleted.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the directory has the stiky bit on but the calling
taks uid does not match the file uid or the directory uid.
<LI><CODE>EFAULT</CODE>, <CODE>EACCESS</CODE>, <CODE>ENAMETOOLONG</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOTDIR</CODE>, <CODE>EISDIR</CODE>, <CODE>ENOMEM</CODE>, <CODE>EROFS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_32.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_32.html">previous</A>, <A HREF="syscalls_34.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_34.html">next</A> section.<P>

View File

@@ -0,0 +1,42 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - utime</TITLE>
<P>Go to the <A HREF="syscalls_33.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_33.html">previous</A>, <A HREF="syscalls_35.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_35.html">next</A> section.<P>
<H2><A NAME="SEC34" HREF="syscalls_toc.html#SEC34" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC34">utime</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int utime(const char *<VAR>filename</VAR>, struct utimbuf *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>filename</VAR>: [in] points to the path of the file to change.
<P>
<VAR>buf</VAR>: [in] points to the new times.
<P>
<H3>DESCRIPTION</H3>
<P>
Changes the access and modification times of a inode. The <CODE>utimbuf</CODE>
structure has the following layout:
<P>
<PRE>
struct utimbuf {
time_t actime; /* access time */
time_t modtime; /* modification time */
};
</PRE>
<P>
If <VAR>buf</VAR> is <CODE>NULL</CODE> the times are set to the current time.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns zero. On error, returns -1 and sets <CODE>errno</CODE> to
one of the following value:
<P>
<UL>
<LI><CODE>EROFS</CODE>, <CODE>ENOTDIR</CODE>, <CODE>ENOENT</CODE>, <CODE>EFAULT</CODE>,
<CODE>ENAMETOOLONG</CODE>, <CODE>ELOOP</CODE>, <CODE>EACCESS</CODE>, <CODE>EPERM</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_33.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_33.html">previous</A>, <A HREF="syscalls_35.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_35.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - write</TITLE>
<P>Go to the <A HREF="syscalls_34.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_34.html">previous</A>, <A HREF="syscalls_36.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_36.html">next</A> section.<P>
<H2><A NAME="SEC35" HREF="syscalls_toc.html#SEC35" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC35">write</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>size_t write(int <VAR>fd</VAR>, const char *<VAR>buf</VAR>, size_t <VAR>count</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>fd</VAR>: [in] the file descriptor to read from.
<P>
<VAR>buf</VAR>: [out] the buffer where to store the data read.
<P>
<VAR>count</VAR>: [in] the maximum count of bytes to read.
<P>
<H3>DESCRIPTION</H3>
<P>
Read up to <VAR>count</VAR> bytes form <VAR>fd</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the number of bytes read. On error, returns -1 and sets
<CODE>errno</CODE> to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the kind of object attached to <VAR>fd</VAR> cannot be
written to.
<LI><CODE>EBADF</CODE>, <VAR>EFAULT</VAR>, <VAR>EPIPE</VAR>, <CODE>EINTR</CODE>,
<CODE>EAGAIN</CODE>, <CODE>ENOSPC</CODE>.
</UL>
<P>Go to the <A HREF="syscalls_34.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_34.html">previous</A>, <A HREF="syscalls_36.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_36.html">next</A> section.<P>

View File

@@ -0,0 +1,10 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - vm</TITLE>
<P>Go to the <A HREF="syscalls_35.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_35.html">previous</A>, <A HREF="syscalls_37.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_37.html">next</A> section.<P>
<H1><A NAME="SEC36" HREF="syscalls_toc.html#SEC36" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC36">Virtual memory subsystem</A></H1>
<P>
The virtual memory sybsystem calls are described here.
<P>
<P>Go to the <A HREF="syscalls_35.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_35.html">previous</A>, <A HREF="syscalls_37.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_37.html">next</A> section.<P>

View File

@@ -0,0 +1,32 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - brk</TITLE>
<P>Go to the <A HREF="syscalls_36.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_36.html">previous</A>, <A HREF="syscalls_38.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_38.html">next</A> section.<P>
<H2><A NAME="SEC37" HREF="syscalls_toc.html#SEC37" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC37">brk</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int brk(void *<VAR>end_data_segment</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>end_data_segment</VAR>: [in] the new end of the data segment.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>brk</CODE> sets the end of the data segment to the value specified by
<VAR>end_data_segment</VAR>. This value must be greater than the end
of the text segment and lower than 16KB before the end of the stack.
<P>
Note: the brk syscall is in never called directly. It is wrapped by a
libc function that changes the return value. The sbrk fucntion is also
implemented as a wrapper.
<P>
<H3>RETURN VALUE</H3>
<P>
Returns the new end of the data segment. (If it is not equal the the
requested end, then there has been an error and the memory couldn't be
allocated.)
<P>
<P>Go to the <A HREF="syscalls_36.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_36.html">previous</A>, <A HREF="syscalls_38.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_38.html">next</A> section.<P>

View File

@@ -0,0 +1,21 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpagesize</TITLE>
<P>Go to the <A HREF="syscalls_37.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_37.html">previous</A>, <A HREF="syscalls_39.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_39.html">next</A> section.<P>
<H2><A NAME="SEC38" HREF="syscalls_toc.html#SEC38" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC38">getpagesize</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>size_t getpagesize(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
Gets the virtual subsystem page size, in bytes. This is not necessarily
equal to the hardware page size.
<P>
<H3>RETURN VALUE</H3>
<P>
The page size, in bytes.
<P>
<P>Go to the <A HREF="syscalls_37.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_37.html">previous</A>, <A HREF="syscalls_39.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_39.html">next</A> section.<P>

View File

@@ -0,0 +1,103 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - mmap</TITLE>
<P>Go to the <A HREF="syscalls_38.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_38.html">previous</A>, <A HREF="syscalls_40.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_40.html">next</A> section.<P>
<H2><A NAME="SEC39" HREF="syscalls_toc.html#SEC39" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC39">mmap and munmap</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>caddr_t mmap(caddr_t <VAR>addr</VAR>, size_t <VAR>len</VAR>, int <VAR>prot</VAR>, int
<VAR>flags</VAR>, int <VAR>fd</VAR>, off_t <VAR>offset</VAR>);</CODE>
<P>
<CODE>int munmap(caddr_t <VAR>addr</VAR>, size_t <VAR>len</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>addr</VAR>: for <CODE>mmap</CODE>, [in] where to map the object. For
<CODE>munmap</CODE>, [in] the region to unmap.
<P>
<VAR>len</VAR>: [in] length of the mapped region.
<P>
<VAR>prot</VAR>: [in] protection for the mapping space.
<P>
<VAR>flags</VAR>: [in] see description.
<P>
<VAR>fd</VAR>: [in] the object to map.
<P>
<VAR>offset</VAR>: [in] begining of the part of the object to map.
<P>
<H3>DESCRIPTION</H3>
<P>
Maps an file object in the virtual address space of the task. In the
case where <VAR>offset</VAR> or <VAR>len</VAR> are not multiple of a page size,
the mapping space may extend beyond the specified range. <VAR>addr</VAR> is
only a clue to the system as where to place the mapping region. The
system may choose to map the object elsewhere. A value of zero for
<VAR>addr</VAR> tells the system to map the object where it sees fit. A
sucessfull <CODE>mmap</CODE> on a previously mapped region cancel the previous
mapping on that region. The <CODE>prot</CODE> parameter may be one or more
or'ed values among the following:
<P>
<DL COMPACT>
<DT><CODE>PROT_EXEC</CODE>
<DD>the mapped range is executable.
<P>
<DT><CODE>PROT_READ</CODE>
<DD>the mapped range is readable.
<P>
<DT><CODE>PROT_WRITE</CODE>
<DD>the mapped range is writable.
</DL>
<P>
The <CODE>flags</CODE> parameter my be one or more or'ed values among the
following:
<P>
<DL COMPACT>
<DT><CODE>MAP_ANON</CODE>
<DD>the new region is not associated with any physical file. In this case,
the <VAR>fd</VAR> parameter is used to name the region. If no name is
needed, <VAR>fd</VAR> may be set to -1.
<P>
<DT><CODE>MAP_FILE</CODE>
<DD>the new region is a mapping of a regular file or a character device.
<P>
<DT><CODE>MAP_FIXED</CODE>
<DD>the system may not choose another memory region than <VAR>addr</VAR> for
mapping. If this region cannot be used, the call fails.
<P>
<DT><CODE>MAP_HASSEMAPHORE</CODE>
<DD>notifies the system that the mapped region may contain semaphores.
<P>
<DT><CODE>MAP_INHERIT</CODE>
<DD>allow for mapped regions to be inherited through the <CODE>exec</CODE> system
call.
<P>
<DT><CODE>MAP_PRIVATE</CODE>
<DD>modifications to the mapped region are private.
<P>
<DT><CODE>MAP_SHARED</CODE>
<DD>modifications to the mapped region are public.
</DL>
<P>
<CODE>munmap</CODE> unmaps the region.
<P>
<H3>RETURN VALUE</H3>
<P>
On success <CODE>mmap</CODE> returns the address of the newly mapped region,
<VAR>munmap</VAR> returns zero. On error, those calls return -1 and sets
<CODE>errno</CODE> to one of the following:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the protection requested for the mapped region is
not consistent with the mode of <VAR>fd</VAR>.
<LI><CODE>EINVAL</CODE>: the <CODE>flags</CODE> value is incorrect or
<CODE>MAP_FIXED</CODE> was requested but the address range is not a multiple
of a page size.
<LI><CODE>ENOMEM</CODE>: <CODE>MAP_FIXED</CODE> was requested but the memory range
can not be used for mapping or there is insufficient memory to complete
the call.
<LI><CODE>ENODEV</CODE>: the file descriptor cannot be mapped.
<LI><CODE>EBADF</CODE>, <CODE>EFAULT</CODE>.
</UL>
<P>Go to the <A HREF="syscalls_38.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_38.html">previous</A>, <A HREF="syscalls_40.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_40.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - access</TITLE>
<P>Go to the <A HREF="syscalls_3.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_3.html">previous</A>, <A HREF="syscalls_5.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_5.html">next</A> section.<P>
<H2><A NAME="SEC4" HREF="syscalls_toc.html#SEC4" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC4">access</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int access(const char *<VAR>pathname</VAR>, int <VAR>mode</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>pathname</VAR>: [in] the path of the file to test.
<P>
<VAR>mode</VAR>: [in] indicates what the task wants to test.
<P>
<H3>DESCRIPTION</H3>
<P>
Checks whether the calling task has the necessary access rights to
perform operations specified by <VAR>mode</VAR> on the file <VAR>pathname</VAR>.
<VAR>mode</VAR> is a mask consisting of one or more of the values
<CODE>R_OK</CODE>, <CODE>W_OK</CODE>, <CODE>X_OK</CODE> and <CODE>F_OK</CODE> which respectively
test if the taks can read, write, execute or test if the file exists.
The test is performed using the <STRONG>real uid and gid</STRONG> of the calling
task. Only the access bits of the file are tested.
<P>
<STRONG>Note</STRONG>: only the final component of the path is checked using the
real uid and gid. All the other components of the path are checked using
the <STRONG>effective</STRONG> uid and gid.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, zero is returned. On error, -1 is returned and <CODE>errno</CODE> is set
to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>mode</VAR> is not a valid value.
<LI><CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>, <CODE>ENOTDIR</CODE>,
<CODE>ENOMEM</CODE>, <CODE>ENAMETOOLONG</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_3.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_3.html">previous</A>, <A HREF="syscalls_5.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_5.html">next</A> section.<P>

View File

@@ -0,0 +1,10 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - net</TITLE>
<P>Go to the <A HREF="syscalls_39.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_39.html">previous</A>, <A HREF="syscalls_41.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_41.html">next</A> section.<P>
<H1><A NAME="SEC40" HREF="syscalls_toc.html#SEC40" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC40">Network subsystem</A></H1>
<P>
The calls of the network sybsystem are described here.
<P>
<P>Go to the <A HREF="syscalls_39.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_39.html">previous</A>, <A HREF="syscalls_41.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_41.html">next</A> section.<P>

View File

@@ -0,0 +1,49 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - accept</TITLE>
<P>Go to the <A HREF="syscalls_40.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_40.html">previous</A>, <A HREF="syscalls_42.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_42.html">next</A> section.<P>
<H2><A NAME="SEC41" HREF="syscalls_toc.html#SEC41" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC41">accept</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int accept(int <VAR>s</VAR>, struct sockaddr *<VAR>addr</VAR>, int
*<VAR>addrlen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket connections are accepted from.
<P>
<VAR>addr</VAR>: [out] contains the address of the the buffer that will be
filled with the address of connecting entity.
<P>
<VAR>addrlen</VAR>: [out] on input contains the maximum length of addr in
bytes, on output contains the length of addr in bytes.
<P>
<H3>DESCRIPTION</H3>
<P>
If connections are pending on the socket <VAR>s</VAR>, the first connection
in the queue is dequeued and opened and a new socket with the same
properties of <VAR>s</VAR> is returned. If no connection is pending and the
socket is blocking, then the call blocks until a connection is requested
on <VAR>s</VAR>. Otherwise the call returns an error code. The socket <VAR>s</VAR>
remains open for future connections. The address of the connecting
entity is returned in <VAR>addr</VAR>. The format of the address depends on
the type of network on through which the socket communicates.
<CODE>accept</CODE> does not send a confirmation at the connecting entity.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns a positive value that is the file
descriptor of the new socket. On errror, the call returns -1 and sets
<CODE>errno</CODE> to one of the following error values:
<P>
<UL>
<LI><CODE>EOPNOTSUPP</CODE>: The referenced socket is not of type
<CODE>SOCK_STREAM</CODE>.
<LI><CODE>EWOULDBLOCK</CODE>: The socket is marked non-blocking and no
connection is pending.
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE> or <CODE>EFAULT</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_40.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_40.html">previous</A>, <A HREF="syscalls_42.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_42.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - bind</TITLE>
<P>Go to the <A HREF="syscalls_41.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_41.html">previous</A>, <A HREF="syscalls_43.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_43.html">next</A> section.<P>
<H2><A NAME="SEC42" HREF="syscalls_toc.html#SEC42" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC42">bind</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int bind(int <VAR>sockfd</VAR>, struct sockaddr *<VAR>my_addr</VAR>, int
<VAR>addrlen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>sockfd</VAR>: [in] the socket to bind.
<P>
<VAR>my_addr</VAR>: [in] the address to bind the socket to.
<P>
<VAR>addrlen</VAR>: [in] the length of addr (in bytes).
<P>
<H3>DESCRIPTION</H3>
<P>
Binds the socket <VAR>sockfd</VAR> to the local address <VAR>my_addr</VAR>. The
format of the address is network dependent.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the socket is already bound to an address, or
<VAR>addrlen</VAR> is invalid or the socket is not in the <CODE>AF_UNIX</CODE>
family.
<LI><CODE>EACCESS</CODE>: the address is reserved for super-user usage and
the calling task has not super-user privileges or the taks does not have
enough access rights on the path.
<LI><CODE>ENAMETOOLONG</CODE>: <VAR>my_addr</VAR> is too long.
<LI><CODE>EBADF</CODE>, <CODE>EROFS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>, <CODE>ENOMEM</CODE>,
<CODE>ENOTDIR</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_41.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_41.html">previous</A>, <A HREF="syscalls_43.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_43.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - connect</TITLE>
<P>Go to the <A HREF="syscalls_42.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_42.html">previous</A>, <A HREF="syscalls_44.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_44.html">next</A> section.<P>
<H2><A NAME="SEC43" HREF="syscalls_toc.html#SEC43" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC43">connect</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int connect(int <VAR>sockfd</VAR>, struct sockaddr *<VAR>serv_addr</VAR>, int
<VAR>addrlen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>sockfd</VAR>: [in] the socket to connect.
<P>
<VAR>serv_addr</VAR>: [in] the remote address to connect to.
<P>
<VAR>addrlen</VAR>: [in] the lenght (in bytes) of <VAR>serv_addr</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
If the socket is of type <CODE>SOCK_DGRAM</CODE>, it connects the socket
<VAR>sockfd</VAR> to a remote address specified by <VAR>serv_addr</VAR>. A
datagram socket can call <CODE>connect</CODE> multiple times to change the
remote address. If the socket is of type <CODE>SOCK_STREAM</CODE>, it connects
the socket to another socket. In that case, the format of
<VAR>serv_addr</VAR> depends on the communication space of the socket. A
stream socket may only call <CODE>connect</CODE> once.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: the socket is in some kind of limbo state: neither
connected nor unconnected!!!
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE>, <CODE>EISCONN</CODE>, <CODE>EALREADY</CODE>,
<CODE>EAGAIN</CODE>, <CODE>EOPNOTSUPP</CODE>, <CODE>EINPROGRESS</CODE>, <CODE>ERESTARTSYS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_42.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_42.html">previous</A>, <A HREF="syscalls_44.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_44.html">next</A> section.<P>

View File

@@ -0,0 +1,41 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getdomainname</TITLE>
<P>Go to the <A HREF="syscalls_43.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_43.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_45.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_45.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_45.html">next</A> section.<P>
<H2><A NAME="SEC44" HREF="syscalls_toc.html#SEC44" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC44">getdomainname and setdomainname</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getdomainname(char *<VAR>name</VAR>, size_t <VAR>len</VAR>);</CODE>
<P>
<CODE>int setdomainname(const char *<VAR>name</VAR>, size_t <VAR>len</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>name</VAR>: (For <CODE>getdomainname</CODE>) [out] points to a buffer where to
save the domain name. (For <CODE>setdomainname</CODE>) [in] points to a buffer
containing the new domain name.
<P>
<VAR>len</VAR>: [in] the maximum length of <VAR>name</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Those calls get or set the machine's domainname.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
In the case of <CODE>getdomainname</CODE>: <CODE>EINVAL</CODE>: <VAR>name</VAR> is
<CODE>NULL</CODE> or the domain name is longer than <VAR>len</VAR>.
<P>
In the case of <CODE>setdomainname</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the caller is not superuser.
<LI><CODE>EINVAL</CODE>: <VAR>len</VAR> is too long.
</UL>
<P>
<P>Go to the <A HREF="syscalls_43.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_43.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_45.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_45.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_45.html">next</A> section.<P>

View File

@@ -0,0 +1,23 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - gethostid</TITLE>
<P>Go to the <A HREF="syscalls_44.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_44.html">previous</A>, <A HREF="syscalls_46.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_46.html">next</A> section.<P>
<H2><A NAME="SEC45" HREF="syscalls_toc.html#SEC45" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC45">gethostid and sethostid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>long int gethostid(void);</CODE>
<P>
<CODE>int sethostid(long int hostid);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>gethostid</CODE> returns the host id and <CODE>sethostid</CODE> sets it. The
host id is usually the network address of the host.
<P>
<H3>RETURN VALUE</H3>
<P>
<CODE>gethostid</CODE> returns the 32 bits host id.
<P>
<P>Go to the <A HREF="syscalls_44.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_44.html">previous</A>, <A HREF="syscalls_46.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_46.html">next</A> section.<P>

View File

@@ -0,0 +1,42 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - gethostname</TITLE>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_45.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_45.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_45.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_47.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_47.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_47.html">next</A> section.<P>
<H2><A NAME="SEC46" HREF="syscalls_toc.html#SEC46" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC46">gethostname and sethostname</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int gethostname(char *<VAR>name</VAR>, size_t <VAR>len</VAR>);</CODE>
<P>
<CODE>int sethostname(const char *<VAR>name</VAR>, size_t <VAR>len</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>name</VAR>: (For <CODE>gethostname</CODE>) [out] points to a buffer where to
put the host name. (For <CODE>sethostname</CODE>) [in] points to the new host
name.
<P>
<VAR>len</VAR>: [in] the maximum length of <VAR>name</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>gethostname</CODE> returns the host name of the current host and
<CODE>sethostname</CODE> sets it. Only the superuser may call <CODE>sethostname</CODE>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
In the case of <CODE>gethostname</CODE>: <CODE>EINVAL</CODE>: <VAR>name</VAR> is
<CODE>NULL</CODE> or the host name is longer than <VAR>len</VAR>.
<P>
In the case of <CODE>sethostname</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the caller is not superuser.
<LI><CODE>EINVAL</CODE>: <VAR>len</VAR> is too long.
</UL>
<P>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_45.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_45.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_45.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_47.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_47.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_47.html">next</A> section.<P>

View File

@@ -0,0 +1,36 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpeername</TITLE>
<P>Go to the <A HREF="syscalls_46.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">next</A> section.<P>
<H2><A NAME="SEC47" HREF="syscalls_toc.html#SEC47" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC47">getpeername</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getpeername(int <VAR>s</VAR>, struct sockaddr *<VAR>name</VAR>, int
*<VAR>namelen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket.
<P>
<VAR>name</VAR>: [out] points to the buffer where to store the name.
<P>
<VAR>namelen</VAR>: [in out] the maximum length (in bytes) of <VAR>name</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Returns the name of the peer machine connected to the remote end of a
socket. If the buffer is too small, the name is truncated.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>ENOSOCK</CODE>, <CODE>ENOTCONN</CODE>, <CODE>ENOBUFS</CODE> and
<CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_46.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_46.html">previous</A>, <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getsockname</TITLE>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_47.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_47.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_47.html">previous</A>, <A HREF="syscalls_49.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_49.html">next</A> section.<P>
<H2><A NAME="SEC48" HREF="syscalls_toc.html#SEC48" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC48">getsockname</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getsockname(int <VAR>s</VAR>, struct sockaddr *<VAR>name</VAR>, int *
<VAR>namelen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket accessed.
<P>
<VAR>name</VAR>: [out] the buffer where to put the name in.
<P>
<VAR>namelen</VAR>: [in out] on entry, the maximum length of <VAR>name</VAR>. On
return, it contains the actual length of the name.
<P>
<H3>DESCRIPTION</H3>
<P>
Gets the local socket name.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE>, <CODE>ENOBUFS</CODE> and <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_47.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_47.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_47.html">previous</A>, <A HREF="syscalls_49.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_49.html">next</A> section.<P>

View File

@@ -0,0 +1,117 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getsockopt</TITLE>
<P>Go to the <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">previous</A>, <A HREF="syscalls_50.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_50.html">next</A> section.<P>
<H2><A NAME="SEC49" HREF="syscalls_toc.html#SEC49" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC49">getsockopt</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getsockopt(int <VAR>s</VAR>, int <VAR>level</VAR>, int <VAR>optname</VAR>,
void *<VAR>optval</VAR>, int *<VAR>optlen</VAR>);</CODE>
<P>
<CODE>int setsockopt(int <VAR>s</VAR>, int <VAR>level</VAR>, int <VAR>optname</VAR>,
const void *<VAR>optval</VAR>, int <VAR>optlen</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket we want to work on.
<P>
<VAR>level</VAR>: [in] the protocol level to access.
<P>
<VAR>optname</VAR>: [in] the option to access.
<P>
<VAR>optval</VAR>: for <CODE>getsockopt</CODE>, [out] points to the buffer where to
save the option value. For <CODE>setsockopt</CODE>, [in] points to the buffer
containing the new option value.
<P>
<VAR>optlen</VAR>: for <CODE>getsockopt</CODE>, [in out] on entry, the maximum
length of <VAR>optval</VAR>, on return, the actual length of the option. For
<CODE>setsockopt</CODE>, the length of the new option.
<P>
<H3>DESCRIPTION</H3>
<P>
The possible values of <VAR>level</VAR> are <VAR>SOL_SOCKET</VAR> and any valid
protocol number. At socket level, a value of zero for the options is
boolean flase and a non-zero value is boolean true. The following
options are recognized at socket level:
<P>
<DL COMPACT>
<DT><CODE>SO_DEBUG</CODE>
<DD>Enable/disable the recording of the debug information by the underliying
protocol modules. <VAR>optval</VAR> is an boolean value (int).
<P>
<DT><CODE>SO_REUSEADDR</CODE>
<DD>Enable/disable local address reuse so that a <CODE>bind</CODE> call can reuse
old addresses. <VAR>optval</VAR> is a boolean value (int).
<P>
<DT><CODE>SO_KEEPALIVE</CODE>
<DD>Enable/disable the "keep connections alive" feature. Using this feature,
periodic messages are sent to the remote connection. If the peer machine
does not respond to those messages, the connection is broken and the
processes using the socket receive a <CODE>SIGPIPE</CODE> signal. <VAR>optval</VAR>
is a boolean value (int).
<P>
<DT><CODE>SO_DONTROUTE</CODE>
<DD>Enable/disable the routing bypass for outgoing message. If enabled, the
socket completely bypass the routing facilities of the operating
system. <VAR>optval</VAR> is a boolean value (int).
<P>
<DT><CODE>SO_LINGER</CODE>
<DD>Linger on close if data present. Without this feature, a <CODE>close</CODE> on
a socket is always performed in a quick non-blocking fashion. However,
when this feature is enabled, the <CODE>close</CODE> call will block for a
while if the socket still has data enqueued on the send queue. The call
will block until it is able to send the data or if a specified timeout
value expire. <VAR>optval</VAR> is a <CODE>struct linger</CODE> structure.
<P>
<DT><CODE>SO_BROADCAST</CODE>
<DD>Enable/disable the permission of broadcasting packets. <VAR>optval</VAR> is a
boolean value (int).
<P>
<DT><CODE>SO_OOBINLINE</CODE>
<DD>Enable/disable the reception of out-of-band data as in band data.
<VAR>optval</VAR> is a boolean value (int).
<P>
<DT><CODE>SO_SNDBUF</CODE>
<DD>Set the buffer size for output. <VAR>optval</VAR> is an int.
<P>
<DT><CODE>SO_RCVBUF</CODE>
<DD>Set the buffer size for input. <VAR>optval</VAR> is an int.
<P>
<DT><CODE>SO_SNDLOWAT</CODE>
<DD>Set minimum count for output. This count is the mininum number of bytes
that must be stored in the send buffer before actually sending them on
the network. <VAR>optval</VAR> is an int.
<P>
<DT><CODE>SO_RCVLOWAT</CODE>
<DD>Set minimum count for input. This count is the mininum number of bytes
that must be received in the receive buffer before returning from a call
reading from the socket. <VAR>optval</VAR> is an int.
<P>
<DT><CODE>SO_SNDTIMEO</CODE>
<DD>Set timeout for output calls. <VAR>optval</VAR> is an <CODE>struct timeval</CODE>.
<P>
<DT><CODE>SO_RCVTIMEO</CODE>
<DD>Set timeout for input calls. <VAR>optval</VAR> is an <CODE>struct timeval</CODE>.
<P>
<DT><CODE>SO_TYPE</CODE>
<DD>For <CODE>getsockopt</CODE> only: get the type of socket. <VAR>optval</VAR> is an int.
<P>
<DT><CODE>SO_TYPE</CODE>
<DD>For <CODE>getsockopt</CODE> only: get the last error on the socket.
<VAR>optval</VAR> is an int.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>ENOPROTOOPT</CODE>: the option is not valid for the protocol specified.
<P>
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE> and <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_48.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_48.html">previous</A>, <A HREF="syscalls_50.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_50.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - chdir</TITLE>
<P>Go to the <A HREF="syscalls_4.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_4.html">previous</A>, <A HREF="syscalls_6.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_6.html">next</A> section.<P>
<H2><A NAME="SEC5" HREF="syscalls_toc.html#SEC5" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC5">chdir and fchdir</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int chdir(const char *<VAR>path</VAR>);</CODE>
<P>
<CODE>int fchdir(int <VAR>fd</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] a pointer to the new current directory.
<P>
<VAR>fd</VAR>: [in] the file descriptor of the new directory.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>chdir</CODE> changes the current directory to <VAR>path</VAR> and
<CODE>fchdir</CODE> to <VAR>fd</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
for <CODE>chdir</CODE>:
<P>
<UL>
<LI><CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOMEM</CODE> <CODE>ENAMETOOLONG</CODE>, <CODE>EROFS</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
for <CODE>fchdir</CODE>:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>ENOENT</CODE>, <CODE>ENOTDIR</CODE> or <CODE>EACCESS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_4.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_4.html">previous</A>, <A HREF="syscalls_6.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_6.html">next</A> section.<P>

View File

@@ -0,0 +1,35 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - listen</TITLE>
<P>Go to the <A HREF="syscalls_49.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_49.html">previous</A>, <A HREF="syscalls_51.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_51.html">next</A> section.<P>
<H2><A NAME="SEC50" HREF="syscalls_toc.html#SEC50" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC50">listen</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int listen(int <VAR>s</VAR>, int <VAR>backlog</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket that will accept connections.
<P>
<VAR>backlog</VAR>: [in] the maximum number of queued connections.
<P>
<H3>DESCRIPTION</H3>
<P>
Notifies to the operating system the the task is ready to accept
connections on a socket and specifies the maximum number of incomming
connections that can be queued for that socket.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EOPNOTSUPP</CODE>: the socket protocol does not support the
<CODE>listen</CODE> call.
<LI><CODE>EBADF</CODE> or <CODE>ENOTSOCK</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_49.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_49.html">previous</A>, <A HREF="syscalls_51.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_51.html">next</A> section.<P>

View File

@@ -0,0 +1,76 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - recv</TITLE>
<P>Go to the <A HREF="syscalls_50.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_50.html">previous</A>, <A HREF="syscalls_52.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_52.html">next</A> section.<P>
<H2><A NAME="SEC51" HREF="syscalls_toc.html#SEC51" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC51">recv, recvfrom and recvmsg</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int recv(int <VAR>s</VAR>, void *<VAR>buf</VAR>, int <VAR>len</VAR>, unsigned int
<VAR>flags</VAR>);</CODE>
<P>
<CODE>int recvfrom(int <VAR>s</VAR>, void *<VAR>buf</VAR>, int <VAR>len</VAR>, unsigned
int <VAR>flags</VAR> struct sockaddr *<VAR>from</VAR>, int *<VAR>fromlen</VAR>);</CODE>
<P>
<CODE>int recvmsg(int <VAR>s</VAR>, struct msghdr *<VAR>msg</VAR>, unsigned int
<VAR>flags</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket to read from.
<P>
<VAR>buf</VAR>: [out] points to a buffer where to put the information read.
<P>
<VAR>len</VAR>: [in] the capacity of the buffer.
<P>
<VAR>flags</VAR>: [in] several options (see description).
<P>
<VAR>from</VAR>: [out] points to an area where to store the peer address. If
<CODE>NULL</CODE>, the peer address is not stored.
<P>
<VAR>fromlen</VAR>: [in out] on entry, points to a number indicating the
capacity of <VAR>from</VAR>. On return, points to an area where to store the
actual length of <VAR>from</VAR>.
<P>
<VAR>msg</VAR>: [out] points to an area where to store the incomming message
header.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>recv</CODE> is usually used to receive messages form a
connection-oriented socket. It is equivalent to <VAR>recvfrom</VAR> with
<CODE>from</CODE> set to <CODE>NULL</CODE>.
<P>
<CODE>recvfrom</CODE> and <CODE>recvmsg</CODE> are used for connection-less or
connection-oriented sockets.
<P>
These calls block if there is no message to receive unless the socket is
non-blocking.
<P>
The <VAR>flags</VAR> parameter may have the following values:
<P>
<DL COMPACT>
<DT><CODE>MSG_OOB</CODE>
<DD>the call will receive out-of-band data instead of in band data.
<P>
<DT><CODE>MSG_PEEK</CODE>
<DD>return the data from the input queue without dequeuing it.
<P>
<DT><CODE>MSG_WAITALL</CODE>
<DD>wait until all data requested is received (<VAR>buf</VAR> is full).
</DL>
<P>
<CODE>recvmsg</CODE> is not yet implemented in Linux.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the number of bytes received. On error, the call returns -1
and sets <CODE>errno</CODE> to one of the following values:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>ENOTCONN</CODE>, <CODE>ENOTSOCK</CODE>,
<CODE>EWOULDBLOCK</CODE>, <CODE>EINTR</CODE> or <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_50.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_50.html">previous</A>, <A HREF="syscalls_52.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_52.html">next</A> section.<P>

View File

@@ -0,0 +1,67 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - send</TITLE>
<P>Go to the <A HREF="syscalls_51.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_51.html">previous</A>, <A HREF="syscalls_53.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_53.html">next</A> section.<P>
<H2><A NAME="SEC52" HREF="syscalls_toc.html#SEC52" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC52">send, sendmsg and sendto</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int send(int <VAR>s</VAR>, const void *<VAR>buf</VAR>, int <VAR>len</VAR>,
unsigned int <VAR>flags</VAR>);</CODE>
<P>
<CODE>int sendto(int s, const void *<VAR>buf</VAR>, int len, unsigned int
<VAR>flags</VAR>, const struct sockaddr *<VAR>to</VAR>, int <VAR>tolen</VAR>);</CODE>
<P>
<CODE>int sendmsg(int <VAR>s</VAR>, const struct msghdr *<VAR>msg</VAR> , unsigned
int <VAR>flags</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket on which to send.
<P>
<VAR>buf</VAR>: [in] points to the buffer that contains the data to send.
<P>
<VAR>len</VAR>: [in] the lenght of <VAR>buf</VAR>.
<P>
<VAR>flags</VAR>: [in] some flags (see description).
<P>
<VAR>to</VAR>: [in] points to the peer address where to send the data.
<P>
<VAR>tolen</VAR>: [in] the length of <VAR>to</VAR>.
<P>
<VAR>msg</VAR>: [in] the message to send.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>sendmsg</CODE> is not yet implemented.
<P>
<CODE>send</CODE> is used to send data on a connection-oriented socket.
<CODE>sendto</CODE> and <CODE>sendmsg</CODE> are used on connection-less or
connection-oriented sockets. Unless the socket is non-blocking the call
will block until the data is send.
<P>
The <VAR>flags</VAR> may be one or more or'ed values from the following:
<P>
<DL COMPACT>
<DT><CODE>MSG_OOB</CODE>
<DD>send the data out-of-band.
<P>
<DT><CODE>MSG_DONTROUTE</CODE>
<DD>bypass the routing facilities of the system.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns the number of bytes sent. On error, the call returns
-1 and sets <CODE>errno</CODE> to one of the following values:
<P>
<UL>
<LI><CODE>EMSGSIZE</CODE>: the data is too big to be sent atomically.
<LI><CODE>ENOBUFS</CODE>: the system has not enought memory to allocate an
output buffer or the output queue for the network interface is full.
<LI><CODE>EBADF</CODE>, <CODE>ENOTCONN</CODE>, <CODE>ENOTSOCK</CODE>,
<CODE>EWOULDBLOCK</CODE>, <CODE>EINTR</CODE> or <CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_51.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_51.html">previous</A>, <A HREF="syscalls_53.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_53.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - shutdown</TITLE>
<P>Go to the <A HREF="syscalls_52.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_52.html">previous</A>, <A HREF="syscalls_54.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html">next</A> section.<P>
<H2><A NAME="SEC53" HREF="syscalls_toc.html#SEC53" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC53">shutdown</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int shutdown(int <VAR>s</VAR>, int <VAR>how</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>s</VAR>: [in] the socket to shutdown.
<P>
<VAR>how</VAR>: [in] how to do it.
<P>
<H3>DESCRIPTION</H3>
<P>
Terminates the communication on a socket. The possible values for
<VAR>how</VAR> are:
<P>
<DL COMPACT>
<DT><CODE>0</CODE>
<DD>the socket can no longer receive.
<P>
<DT><CODE>1</CODE>
<DD>the socket can no longer send.
<P>
<DT><CODE>2</CODE>
<DD>the socket can no longer receive or send.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EBADF</CODE>, <CODE>ENOTSOCK</CODE> or <CODE>ENOTCONN</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_52.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_52.html">previous</A>, <A HREF="syscalls_54.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html">next</A> section.<P>

View File

@@ -0,0 +1,81 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - socket</TITLE>
<P>Go to the <A HREF="syscalls_53.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_53.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_55.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_55.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_55.html">next</A> section.<P>
<H2><A NAME="SEC54" HREF="syscalls_toc.html#SEC54" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC54">socket</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int socket(int <VAR>domain</VAR>, int <VAR>type</VAR>, int <VAR>protocol</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>domain</VAR>: [in] the protocol family of the socket.
<P>
<VAR>type</VAR>: [in] its type.
<P>
<VAR>protocol</VAR>: [in] the protocol used for communications.
<P>
<H3>DESCRIPTION</H3>
<P>
Creates a communication endpoint. The <VAR>domain</VAR> parameter can take
the following values:
<P>
<DL COMPACT>
<DT><CODE>AF_UNIX</CODE>
<DD>Unix internal protocols.
<P>
<DT><CODE>AF_INET</CODE>
<DD>ARPA protocols (TCP/IP and so on).
<P>
<DT><CODE>AF_ISO</CODE>
<DD>ISO protocols.
<P>
<DT><CODE>AF_NS</CODE>
<DD>Xerox Network System protocols.
<P>
<DT><CODE>AF_IMPLINK</CODE>
<DD>IMP link layer.
</DL>
<P>
As of version 1.0 of Linux: <CODE>AF_ISO</CODE>, <CODE>AF_IMPLINK</CODE> and
<CODE>AF_NS</CODE> are not supported.
<P>
The <VAR>type</VAR> parameter may take the following values:
<P>
<DL COMPACT>
<DT><CODE>SOCK_STREAM</CODE>
<DD>full-duplex, reliable, sequenced, connection-oriented stream. Out-of-band data
may be supported.
<P>
<DT><CODE>SOCK_DGRAM</CODE>
<DD>connection-less, unreliable link for datagram transmission.
<P>
<DT><CODE>SOCK_RAW</CODE>
<DD>only a task with superuser privileges may use this options (see kernel).
<P>
<DT><CODE>SOCK_SEQPACKET</CODE>
<DD>full-duplex, reliable, sequenced, connection-oriented link for datagram
of a specified size. Usable only with the <CODE>AF_NS</CODE> domain.
<P>
<DT><CODE>SOCK_RDM</CODE>
<DD>not implemented yet.
</DL>
<P>
The <CODE>SOCK_STREAM</CODE> type provide reliable transmission. Even when the
connection is not transmitting usefull information, a packet is send at
a regular interval to ensure that the connection is still intact.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, a new file descriptor for the socket is returned. On error,
-1 is returned and <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the calling task does not have permission to
create a socket of the specified domain, type and protocol.
<LI><CODE>EPROTONOSUPPORT</CODE>, <CODE>EMFILE</CODE>, <CODE>ENFILE</CODE> or <CODE>ENOBUFFS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_53.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_53.html">previous</A>, <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_55.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_55.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_55.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - socketpair</TITLE>
<P>Go to the <A HREF="syscalls_54.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html">previous</A>, <A HREF="syscalls_56.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_56.html">next</A> section.<P>
<H2><A NAME="SEC55" HREF="syscalls_toc.html#SEC55" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC55">socketpair</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int socketpair(int <VAR>domain</VAR>, int <VAR>type</VAR>, int <VAR>protocol</VAR>,
int <VAR>sv[2]</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>domain</VAR>: [in] the socket protocol family.
<P>
<VAR>type</VAR>: [in] the socket type.
<P>
<VAR>protocol</VAR>: [in] the socket protocol.
<P>
<VAR>sv</VAR>: [out] the two file descriptors.
<P>
<H3>DESCRIPTION</H3>
<P>
Creates a pair of interconnected sockets. The two sockets are
indistinguishable. See <CODE>socket</CODE> for more information on domains,
types and protocols. See section <A HREF="syscalls_54.html#SEC54" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html#SEC54">socket</A>
<P>
Linux 1.0 supports only the <CODE>AF_UNIX</CODE> domain for this call.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, zero is returned. On error, -1 is returned and <CODE>errno</CODE>
is set to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the calling task does not have permission to
create a socket of the specified domain, type and protocol.
<LI><CODE>EPROTONOSUPPORT</CODE>, <CODE>EAFNOSUPPORT</CODE>, <CODE>EOPNOSUPPORT</CODE>,
<CODE>EMFILE</CODE>, <CODE>ENFILE</CODE>, <CODE>EFAULT</CODE> or <CODE>ENOBUFFS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_54.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_54.html">previous</A>, <A HREF="syscalls_56.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_56.html">next</A> section.<P>

View File

@@ -0,0 +1,10 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - exec</TITLE>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_55.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_55.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_55.html">previous</A>, <A HREF="syscalls_57.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_57.html">next</A> section.<P>
<H1><A NAME="SEC56" HREF="syscalls_toc.html#SEC56" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC56">Processus control subsystem</A></H1>
<P>
The processus contrel subsystem calls are described here.
<P>
<P>Go to the <A HREF="javascript:if(confirm('http://www.infran.ru/TechInfo/syscalls/syscalls_55.html \n\nThis file was not retrieved by Teleport Pro, because the server reports that an error occurred that prevented retrieval. \n\nDo you want to open it from the server?'))window.location='http://www.infran.ru/TechInfo/syscalls/syscalls_55.html'" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_55.html">previous</A>, <A HREF="syscalls_57.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_57.html">next</A> section.<P>

View File

@@ -0,0 +1,24 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - _exit</TITLE>
<P>Go to the <A HREF="syscalls_56.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_56.html">previous</A>, <A HREF="syscalls_58.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_58.html">next</A> section.<P>
<H2><A NAME="SEC57" HREF="syscalls_toc.html#SEC57" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC57">_exit</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>void _exit(int <VAR>status</VAR>)</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>status</VAR>: [in] the exit code of the dying task.
<P>
<H3>DESCRIPTION</H3>
<P>
This system call terminates the calling task <STRONG>immediately</STRONG>.
<P>
<H3>RETURN VALUE</H3>
<P>
Never returns.
<P>
<P>Go to the <A HREF="syscalls_56.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_56.html">previous</A>, <A HREF="syscalls_58.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_58.html">next</A> section.<P>

View File

@@ -0,0 +1,43 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - execve</TITLE>
<P>Go to the <A HREF="syscalls_57.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_57.html">previous</A>, <A HREF="syscalls_59.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_59.html">next</A> section.<P>
<H2><A NAME="SEC58" HREF="syscalls_toc.html#SEC58" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC58">execve</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int execve (const char *<VAR>filename</VAR>, const char *<VAR>argv</VAR>[],
const char *<VAR>envp</VAR>[]);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>filename</VAR>: [in] the path of the executable file.
<P>
<VAR>argv</VAR>: [in] the parameter vector for this invocation.
<P>
<VAR>envp</VAR>: [in] the environment in which to start the new text.
<P>
<H3>DESCRIPTION</H3>
<P>
Overwrites the current task with a new executable file on disk using the
parameter vector environement specified by the call. The opened files
not maked close on exec remain opened after the call.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, does not return. On error, returns -1 and <CODE>errno</CODE> is set
to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the file is not a regular file or is not
executable.
<LI><CODE>EPERM</CODE>: the file system does not permit execution at all or
the file has the SUID or SGID bit set but the file system does not
permit SUID or SGID execution.
<LI><CODE>E2BIG</CODE>, <CODE>ENOEXEC</CODE>, <CODE>EFAULT</CODE>, <CODE>ENAMETOOLONG</CODE>,
<CODE>ENOENT</CODE>, <CODE>ENOMEM</CODE>, <CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE> and
<CODE>ELOOP</CODE> all have their standard meanings.
</UL>
<P>
<P>Go to the <A HREF="syscalls_57.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_57.html">previous</A>, <A HREF="syscalls_59.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_59.html">next</A> section.<P>

View File

@@ -0,0 +1,27 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - fork</TITLE>
<P>Go to the <A HREF="syscalls_58.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_58.html">previous</A>, <A HREF="syscalls_60.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_60.html">next</A> section.<P>
<H2><A NAME="SEC59" HREF="syscalls_toc.html#SEC59" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC59">template</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>pid_t fork(void);</CODE>
<P>
<CODE>pid_t vfork(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
Create a child task from the current task. The new task is an exact copy
of the parent appart from the PID. <CODE>vfork</CODE> is simply an alias for
<CODE>fork</CODE>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns the PID of the new task in the parent and
returns 1 in the child. On error, returns -1 and sets <CODE>errno</CODE> to the
following value: <CODE>EAGAIN</CODE> meaning that there is not enough memory
to complete the call.
<P>
<P>Go to the <A HREF="syscalls_58.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_58.html">previous</A>, <A HREF="syscalls_60.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_60.html">next</A> section.<P>

View File

@@ -0,0 +1,66 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - chmod</TITLE>
<P>Go to the <A HREF="syscalls_5.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_5.html">previous</A>, <A HREF="syscalls_7.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_7.html">next</A> section.<P>
<H2><A NAME="SEC6" HREF="syscalls_toc.html#SEC6" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC6">chmod and fchmod</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int chmod(const char *<VAR>path</VAR>, mode_t <VAR>mode</VAR>);</CODE>
<P>
<CODE>int fchmod(int <VAR>fd</VAR>, mode_t <VAR>mode</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path of the file to modify.
<P>
<VAR>fd</VAR>: [in] the file descriptor to modify.
<P>
<VAR>mode</VAR>: [in] the new mode.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>chmod</CODE> changes the mode of the file specified by <VAR>path</VAR> to
<VAR>mode</VAR>. <CODE>fchmod</CODE> changes the mode of the file descriptor
specified by <VAR>fd</VAR> to <VAR>mode</VAR>.The possible values of <VAR>mode</VAR>
are obtained by or'ing the following constants:
<P>
<UL>
<LI><CODE>S_ISUID</CODE>: set uid on execution.
<LI><CODE>S_ISGID</CODE>: set gid on execution.
<LI><CODE>S_ISVTX</CODE>: sticky bit.
<LI><CODE>S_IRUSR</CODE>: readable by owner.
<LI><CODE>S_IWUSR</CODE>: writable by owner.
<LI><CODE>S_IXUSR</CODE>: executable by owner.
<LI><CODE>S_IRGRP</CODE>: readable by group.
<LI><CODE>S_IWGRP</CODE>: writable by group.
<LI><CODE>S_IXGRP</CODE>: executable by group.
<LI><CODE>S_IROTH</CODE>: readable by the world.
<LI><CODE>S_IWOTH</CODE>: writable by the world.
<LI><CODE>S_IXOTH</CODE>: executable by the world.
</UL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
for <CODE>chmod</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
<LI><CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOMEM</CODE> <CODE>ENAMETOOLONG</CODE>, <CODE>EROFS</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
for <CODE>fchmod</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
<LI><CODE>ENOENT</CODE>, <CODE>EROFS</CODE> or <CODE>EBADF</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_5.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_5.html">previous</A>, <A HREF="syscalls_7.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_7.html">next</A> section.<P>

View File

@@ -0,0 +1,27 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getegid</TITLE>
<P>Go to the <A HREF="syscalls_59.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_59.html">previous</A>, <A HREF="syscalls_61.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_61.html">next</A> section.<P>
<H2><A NAME="SEC60" HREF="syscalls_toc.html#SEC60" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC60">getegid and getgid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>gid_t getgid(void);</CODE>
<P>
<CODE>gid_t getegid(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getgid</CODE> returns the real gid of the current task. <CODE>getegid</CODE>
returns the effective gid of the current task. The real gid is the gid
of the user that started the task, the effective gid, on the other hand,
is the gid of the executable file if the sgid bit is set.
<P>
<H3>RETURN VALUE</H3>
<P>
<CODE>getgid</CODE>: the real gid.
<P>
<CODE>getegid</CODE>: the effective gid.
<P>
<P>Go to the <A HREF="syscalls_59.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_59.html">previous</A>, <A HREF="syscalls_61.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_61.html">next</A> section.<P>

View File

@@ -0,0 +1,28 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - geteuid</TITLE>
<P>Go to the <A HREF="syscalls_60.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_60.html">previous</A>, <A HREF="syscalls_62.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_62.html">next</A> section.<P>
<H2><A NAME="SEC61" HREF="syscalls_toc.html#SEC61" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC61">geteuid and getuid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>uid_t getuid(void);</CODE>
<P>
<CODE>uid_t geteuid(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getuid</CODE> retreives the real uid of the current task. The real uid is
the one of the user who started the task. <CODE>geteuid</CODE> retreives the
effective uid of the current task. The effective uid is the uid of the
executable file if the SUID bit of the file is set (otherwise, it is
equal to the real uid).
<P>
<H3>RETURN VALUE</H3>
<P>
<CODE>getuid</CODE>: the real uid.
<P>
<CODE>geteuid</CODE>: the effective uid.
<P>
<P>Go to the <A HREF="syscalls_60.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_60.html">previous</A>, <A HREF="syscalls_62.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_62.html">next</A> section.<P>

View File

@@ -0,0 +1,47 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpgrp</TITLE>
<P>Go to the <A HREF="syscalls_61.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_61.html">previous</A>, <A HREF="syscalls_63.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_63.html">next</A> section.<P>
<H2><A NAME="SEC62" HREF="syscalls_toc.html#SEC62" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC62">getpgrp, setpgid and setpgrp</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>pid_t getpgrp(void);</CODE>
<P>
<CODE>int setpgid(pid_t <VAR>pid</VAR>, pid_t <VAR>pgid</VAR>);</CODE>
<P>
<CODE>int setpgrp(void);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>pid</VAR>: [in] the task to modify (0 for the current task).
<P>
<VAR>pgid</VAR>: [in] the new process group id. If zero is specified, the
value of <VAR>pid</VAR> is taken.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getpgrp</CODE> returns the current process group. <CODE>setpgid</CODE> sets
the process group id of the task specified by <VAR>pid</VAR> to <VAR>pgid</VAR>.
<CODE>setpgrp</CODE> sets the group id of the current task to its process id.
<P>
Note: <CODE>setpgrp</CODE> is implemented as <CODE>setpgid(0,0)</CODE>.
<P>
<H3>RETURN VALUE</H3>
<P>
<VAR>getpgrp</VAR> allways succeed and returns the current process group id.
<P>
On success, <CODE>setpgrp</CODE> and <CODE>setgpid</CODE> return zero. On error,
they return -1 and <CODE>errno</CODE> is set to one of the following values:
<P>
For <VAR>setpgid</VAR>:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: pgid is less than 0.
<LI><CODE>ESRCH</CODE>.
</UL>
<P>
For both calls: <CODE>EPERM</CODE>.
<P>
<P>Go to the <A HREF="syscalls_61.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_61.html">previous</A>, <A HREF="syscalls_63.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_63.html">next</A> section.<P>

View File

@@ -0,0 +1,24 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpid</TITLE>
<P>Go to the <A HREF="syscalls_62.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_62.html">previous</A>, <A HREF="syscalls_64.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_64.html">next</A> section.<P>
<H2><A NAME="SEC63" HREF="syscalls_toc.html#SEC63" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC63">getppid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>pid_t getpid(void);</CODE>
<P>
<CODE>pid_t getppid(void);</CODE>
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getpid</CODE> returns the process id of the current task and
<CODE>getppid</CODE> returns the process id of the parent task.
<P>
<H3>RETURN VALUE</H3>
<P>
<CODE>getpid</CODE>: the pid of the current task.
<CODE>getppid</CODE>: the pid of the parent task.
<P>
<P>Go to the <A HREF="syscalls_62.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_62.html">previous</A>, <A HREF="syscalls_64.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_64.html">next</A> section.<P>

View File

@@ -0,0 +1,60 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - getpriority</TITLE>
<P>Go to the <A HREF="syscalls_63.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_63.html">previous</A>, <A HREF="syscalls_65.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_65.html">next</A> section.<P>
<H2><A NAME="SEC64" HREF="syscalls_toc.html#SEC64" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC64">getpriority and setpriority</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int getpriority(int <VAR>which</VAR>, int <VAR>who</VAR>);</CODE>
<P>
<CODE>int setpriority(int <VAR>which</VAR>, int <VAR>who</VAR>, int <VAR>prio</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>which</VAR>: [in] which kind of taks to work on.
<P>
<VAR>who</VAR>: [in] who exactly we want to work on.
<P>
<VAR>prio</VAR>: [in] the new priority.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getpriority</CODE> retreives the highest priority of a task, a process
group or a user and <CODE>setpriority</CODE> sets the priority of a task, all
process in a process group or a user. <VAR>which</VAR> and have the
following values:
<P>
<DL COMPACT>
<DT><CODE>PRIO_PROCESS</CODE>
<DD>to get the priority of a process. In this case <VAR>who</VAR> is a process id.
<P>
<DT><CODE>PRIO_PGRP</CODE>
<DD>to get the priority of a process group. In this case <VAR>who</VAR> is a
process group id.
<P>
<DT><CODE>PRIO_USER</CODE>
<DD>to get the priority of a user. In this case <VAR>who</VAR> is a user id.
</DL>
<P>
In any case, a value of zero for <VAR>who</VAR> means the current process,
process group or user. <VAR>prio</VAR> is in the range [-20,20] with lower
values giving a higher scheduling priority.
<P>
<H3>RETURN VALUE</H3>
<P>
<VAR>getpriority</VAR> returns something between -20 and 20.
<VAR>setpriority</VAR> returns 0 on success and -1 on error. In case of
errorm, <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>which</VAR> has an invalid value.
<LI><CODE>EPERM</CODE>: the effective uid and gid of the calling task do not
match those of the target task.
<LI><CODE>EACCESS</CODE>: the caller tried to lower a priority but is not a
superuser task.
<LI><CODE>ESRCH</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_63.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_63.html">previous</A>, <A HREF="syscalls_65.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_65.html">next</A> section.<P>

View File

@@ -0,0 +1,27 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - nice</TITLE>
<P>Go to the <A HREF="syscalls_64.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_64.html">previous</A>, <A HREF="syscalls_66.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_66.html">next</A> section.<P>
<H2><A NAME="SEC65" HREF="syscalls_toc.html#SEC65" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC65">nice</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int nice(int <VAR>inc</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>inc</VAR>: [in] the increment.
<P>
<H3>DESCRIPTION</H3>
<P>
Adds <VAR>inc</VAR> to the priority of the calling task. Only a task with
superuser privileges may specify a negative <VAR>inc</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set
to one of the following values: <CODE>EPERM</CODE>: the task tried to decrease
the priority value but does not have superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_64.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_64.html">previous</A>, <A HREF="syscalls_66.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_66.html">next</A> section.<P>

View File

@@ -0,0 +1,30 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - setgid</TITLE>
<P>Go to the <A HREF="syscalls_65.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_65.html">previous</A>, <A HREF="syscalls_67.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_67.html">next</A> section.<P>
<H2><A NAME="SEC66" HREF="syscalls_toc.html#SEC66" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC66">setgid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setgid(gid_t <VAR>gid</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>gid</VAR>: [in] the new gid.
<P>
<H3>DESCRIPTION</H3>
<P>
If the calling task does not have superuser privileges, it may use
<CODE>setgid</CODE> to sets its effective gid to its saved gid or its real gid
(other values are illegal). If the calling task has superuser
privileges, the real, effective and saved gids are set to <VAR>gid</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set
to one of the following values: <CODE>EPERM</CODE>: the <VAR>gid</VAR> is not the
real gid or the saved gid of the task and the task does not have
superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_65.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_65.html">previous</A>, <A HREF="syscalls_67.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_67.html">next</A> section.<P>

View File

@@ -0,0 +1,34 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - setregid</TITLE>
<P>Go to the <A HREF="syscalls_66.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_66.html">previous</A>, <A HREF="syscalls_68.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_68.html">next</A> section.<P>
<H2><A NAME="SEC67" HREF="syscalls_toc.html#SEC67" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC67">setregid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setregid(gid_t <VAR>rgid</VAR>, gid_t <VAR>egid</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>rgid</VAR>: [in] the new real gid, -1 for no change.
<P>
<VAR>egid</VAR>: [in] the new effective gid, -1 for no change.
<P>
<H3>DESCRIPTION</H3>
<P>
Sets both the real and effective gid of the task. If the calling task
does not have superuser privileges, it can only swap its real and
effective gids. If the calling task has superuser privileges, it can set
the effective and real gids to whatever it wants. The saved gid is set
to the same value of the effective gid. This is done so that a programm
using this call will be considered 100% BSD compatible.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set to
one of the following values: <CODE>EPERM</CODE>: the task tried something else
than just changing the effective gid to the real gid and the real gid to
the effective gid and the task does not have superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_66.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_66.html">previous</A>, <A HREF="syscalls_68.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_68.html">next</A> section.<P>

View File

@@ -0,0 +1,34 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - setreuid</TITLE>
<P>Go to the <A HREF="syscalls_67.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_67.html">previous</A>, <A HREF="syscalls_69.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_69.html">next</A> section.<P>
<H2><A NAME="SEC68" HREF="syscalls_toc.html#SEC68" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC68">setreuid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setrugid(gid_t <VAR>ruid</VAR>, gid_t <VAR>euid</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>rgid</VAR>: [in] the new real uid, -1 for no change.
<P>
<VAR>egid</VAR>: [in] the new effective uid, -1 for no change.
<P>
<H3>DESCRIPTION</H3>
<P>
Sets both the real and effective uid of the task. If the calling task
does not have superuser privileges, it can only swap its real and
effective uids. If the calling task has superuser privileges, it can set
the effective and real uids to whatever it wants. The saved uid is set
to the same value of the effective uid. This is done so that a programm
using this call will be considered 100% BSD compatible.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set to
one of the following values: <CODE>EPERM</CODE>: the task tried something else
than just changing the effective uid to the real uid and the real uid to
the effective uid and the task does not have superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_67.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_67.html">previous</A>, <A HREF="syscalls_69.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_69.html">next</A> section.<P>

View File

@@ -0,0 +1,30 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - setuid</TITLE>
<P>Go to the <A HREF="syscalls_68.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_68.html">previous</A>, <A HREF="syscalls_70.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_70.html">next</A> section.<P>
<H2><A NAME="SEC69" HREF="syscalls_toc.html#SEC69" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC69">setuid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setuid(gid_t <VAR>uid</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>uid</VAR>: [in] the new uid.
<P>
<H3>DESCRIPTION</H3>
<P>
If the calling task does not have superuser privileges, it may use
<CODE>setuid</CODE> to sets its effective uid to its saved uid or its real uid
(other values are illegal). If the calling task has superuser
privileges, the real, effective and saved uids are set to <VAR>uid</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set
to one of the following values: <CODE>EPERM</CODE>: the <VAR>uid</VAR> is not the
real uid or the saved uid of the task and the task does not have
superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_68.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_68.html">previous</A>, <A HREF="syscalls_70.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_70.html">next</A> section.<P>

View File

@@ -0,0 +1,54 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - chown</TITLE>
<P>Go to the <A HREF="syscalls_6.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_6.html">previous</A>, <A HREF="syscalls_8.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_8.html">next</A> section.<P>
<H2><A NAME="SEC7" HREF="syscalls_toc.html#SEC7" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC7">chown and fchown</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int chown(const char *<VAR>path</VAR>, uid_t <VAR>owner</VAR>, gid_t <VAR>group</VAR>);</CODE>
<P>
<CODE>int fchown(int <VAR>fd</VAR>, uid_t <VAR>owner</VAR>, gid_t <VAR>group</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the path of the file to modify.
<P>
<VAR>fd</VAR>: [in] the file descriptor to modify.
<P>
<VAR>owner</VAR>: [in] the new uid. -1 for no change.
<P>
<VAR>group</VAR>: [in] the new gid. -1 for no change.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>chown</CODE> changes the uid and gid of file specified by <VAR>path</VAR> to
<VAR>owner</VAR> and <VAR>group</VAR>. <CODE>fchown</CODE> changes the uid and gid of
file descriptor <VAR>fd</VAR> to <VAR>owner</VAR> and <VAR>group</VAR>. The superuser
may do whatever he wishes with the uid and gid of a file. The owner of a
file may only change the gid of the file to any group he belongs to.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
for <CODE>chown</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
<LI><CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOMEM</CODE> <CODE>ENAMETOOLONG</CODE>, <CODE>EROFS</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
for <CODE>fchown</CODE>:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
<LI><CODE>ENOENT</CODE>, <CODE>EROFS</CODE> or <CODE>EBADF</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_6.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_6.html">previous</A>, <A HREF="syscalls_8.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_8.html">next</A> section.<P>

View File

@@ -0,0 +1,28 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - vm86</TITLE>
<P>Go to the <A HREF="syscalls_69.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_69.html">previous</A>, <A HREF="syscalls_71.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_71.html">next</A> section.<P>
<H2><A NAME="SEC70" HREF="syscalls_toc.html#SEC70" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC70">vm86</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int vm86(struct vm86_struct *<VAR>info</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>info</VAR>: [in] setup information.
<P>
<H3>DESCRIPTION</H3>
<P>
Enters VM86 mode using the information in <VAR>info</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, zero is returned. On error, -1 is returned and <CODE>errno</CODE>
is set to <CODE>EPERM</CODE>: the kernel stack is already used. This call is
architecture dependent. (ie. It has meaning only on a 80386 and up.)
<P>
<H3>RETURN VALUE</H3>
<P>
<P>Go to the <A HREF="syscalls_69.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_69.html">previous</A>, <A HREF="syscalls_71.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_71.html">next</A> section.<P>

View File

@@ -0,0 +1,75 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - wait4</TITLE>
<P>Go to the <A HREF="syscalls_70.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_70.html">previous</A>, <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">next</A> section.<P>
<H2><A NAME="SEC71" HREF="syscalls_toc.html#SEC71" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC71">wait4</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>pid_t wait4(pid_t <VAR>pid</VAR>, int *<VAR>status</VAR>, int <VAR>options</VAR>,
struct rusage *<VAR>rusage</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>pid</VAR>: [in] the pid of the child.
<P>
<VAR>status</VAR>: [out] the return status of the child.
<P>
<VAR>options</VAR>: [in] options for the wait.
<P>
<VAR>rusage</VAR>: [out] the ressource usage of the dead child.
<P>
<H3>DESCRIPTION</H3>
<P>
This call puts the calling task to sleep until the child specified by
<VAR>pid</VAR> exits or a signal is caught. If a child that fits the request
is already in a zombie state at the time of the call, the zombie is
exorcised and the call retrurns immediately.
<P>
<VAR>pid</VAR> has different meanings according to the ranges of values it
may take:
<P>
<DL COMPACT>
<DT><CODE>&#60;-1</CODE>
<DD>waits for the exit of any child with a process group id of -<VAR>pid</VAR>.
<P>
<DT><CODE>-1</CODE>
<DD>wait for any child to exit.
<P>
<DT><CODE>0</CODE>
<DD>wait for the exit of any child with a process group id equal to the one
of the current task.
<P>
<DT><CODE>&#62;0</CODE>
<DD>wait for the child with pid equals to <VAR>pid</VAR> to exit.
</DL>
<P>
If <VAR>status</VAR> is not <CODE>NULL</CODE>, then the return status of the child
is stored to the area pointed to by <VAR>status</VAR>.
<P>
<VAR>options</VAR> is one or more of the following values or'ed together:
<P>
<DL COMPACT>
<DT><CODE>WNOHANG</CODE>
<DD>do not wait for a process to exit.
<P>
<DT><CODE>WUNTRACED</CODE>
<DD>also return for children who are stopped.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
The pid of the child who exited. If <CODE>WNOHANG</CODE> has been specified,
then the call may return zero. In case of error, the call returns zero
and <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>ECHILD</CODE>: the child does not exist.
<LI><CODE>EPERM</CODE>: the effective uid of the calling task is not equal
to the one of the child the task is waiting for and the calling task
does not have superuser privileges.
<LI><CODE>ERESTARTSYS</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_70.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_70.html">previous</A>, <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">next</A> section.<P>

View File

@@ -0,0 +1,9 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - ipcs</TITLE>
<P>Go to the <A HREF="syscalls_71.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_71.html">previous</A>, <A HREF="syscalls_73.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_73.html">next</A> section.<P>
<H1><A NAME="SEC72" HREF="syscalls_toc.html#SEC72" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC72">Inter Process Communication Subsystem</A></H1>
<P>
<P>Go to the <A HREF="syscalls_71.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_71.html">previous</A>, <A HREF="syscalls_73.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_73.html">next</A> section.<P>

View File

@@ -0,0 +1,70 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - ipc</TITLE>
<P>Go to the <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">previous</A>, <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">next</A> section.<P>
<H2><A NAME="SEC73" HREF="syscalls_toc.html#SEC73" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC73">ipc</A></H2>
<P>
<H3>SYSNOPSIS</H3>
<P>
<CODE>int sys_ipc (uint <VAR>call</VAR>, int <VAR>first</VAR>, int <VAR>second</VAR>,
int <VAR>third</VAR>, void *<VAR>ptr</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>call</VAR>: [in] the ipc call to perform.
<P>
<VAR>first</VAR>, <VAR>second</VAR>, <VAR>third</VAR>: parameters. Depend on
<VAR>call</VAR>.
<P>
<VAR>ptr</VAR>: [in] pointer to a buffer.
<P>
<H3>DESCRIPTION</H3>
<P>
This is an in kernel wrapper for other ipc calls. <VAR>call</VAR> can take
the following values:
<P>
<DL COMPACT>
<DT><CODE>SEMOP</CODE>
<DD><CODE>sys_semop(first, (struct sembuf *)ptr, second);</CODE>
<P>
<DT><CODE>SEMGET</CODE>
<DD><CODE>sys_semget (first, second, third);</CODE>
<P>
<DT><CODE>SEMCTL</CODE>
<DD><CODE>sys_semctl (first, second, third, ptr);</CODE>
<P>
<DT><CODE>MSGSND</CODE>
<DD><CODE>sys_msgsnd (first, (struct msgbuf *) ptr, second, third);</CODE>
<P>
<DT><CODE>MSGRCV</CODE>
<DD>This one is a little tricky...
<P>
<CODE>struct ipc_kludge tmp;</CODE>
<CODE>if (!ptr) return -EINVAL;</CODE>
<P>
<CODE>memcpy_fromfs (&#38;tmp,(struct ipc_kludge *) ptr, sizeof (tmp));</CODE>
<P>
<CODE>return sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third);</CODE>
<P>
<DT><CODE>MSGGET</CODE>
<DD><CODE>sys_msgget ((key_t) first, second);</CODE>
<P>
<DT><CODE>MSGCTL</CODE>
<DD><CODE>sys_msgctl (first, second, (struct msqid_ds *) ptr);</CODE>
<P>
<DT><CODE>SHMAT</CODE>
<DD><CODE>sys_shmat (first, (char *) ptr, second, (ulong *) third);</CODE>
<P>
<DT><CODE>SHMDT</CODE>
<DD><CODE>sys_shmdt ((char *)ptr);</CODE>
<P>
<DT><CODE>SHMGET</CODE>
<DD><CODE>sys_shmget (first, second, third);</CODE>
<P>
<DT><CODE>SHMCTL</CODE>
<DD><CODE>sys_shmctl (first, second, (struct shmid_ds *) ptr);</CODE>
</DL>
<P>
<P>Go to the <A HREF="syscalls_72.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_72.html">previous</A>, <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">next</A> section.<P>

View File

@@ -0,0 +1,57 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - msgctl</TITLE>
<P>Go to the <A HREF="syscalls_73.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_73.html">previous</A>, <A HREF="syscalls_75.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_75.html">next</A> section.<P>
<H2><A NAME="SEC74" HREF="syscalls_toc.html#SEC74" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC74">msgctl</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int msgctl(int <VAR>msqid</VAR>,int <VAR>cmd</VAR>,struct msqid_ds *<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>msqid</VAR>: [in] the message queue to manipulate.
<P>
<VAR>cmd</VAR>: [in] the operation to perform on the message queue.
<P>
<VAR>buf</VAR>: the interpretation of this parameter depends on <VAR>cmd</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Manipulates a message queue. <VAR>cmd</VAR> may be one of:
<P>
<DL COMPACT>
<DT><CODE>IPC_STAT</CODE>
<DD>retreives some information on the queue.
<P>
<DT><CODE>IPC_SET</CODE>
<DD>modify some operating parameters of the queue. <VAR>buf</VAR> points to a
<CODE>msqid_ds</CODE> structure. The only modifiable parameters are:
<CODE>msg_perm.uid</CODE>, <CODE>msg_perm.gid</CODE>, <CODE>msg_perm.mode</CODE> (only
lowest 9 bits) and <CODE>msg_qbytes</CODE>. The calling task uid must be one
of the creator uid or the owner uid of the queue or the superuser uid.
Only the superuser may rise <CODE>msg_qbytes</CODE> beyond the system limit of
<CODE>MSGMNB</CODE>.
<P>
<DT><CODE>IPC_RMID</CODE>
<DD>immediately destroys the message queue and awake all sleaping reader and
writer processes.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the caller tried <CODE>IPC_STAT</CODE> but does not have
read permission on the queue.
<LI><CODE>EIDRM</CODE>: the queue is already removed.
<LI><CODE>EINVAL</CODE>: invalid value for <VAR>cmd</VAR> or <VAR>msqid</VAR>.
<LI><CODE>EPERM</CODE>: the taks tried an operation for which it does not
have the necessary privileges.
<LI><CODE>EFAULT</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_73.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_73.html">previous</A>, <A HREF="syscalls_75.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_75.html">next</A> section.<P>

View File

@@ -0,0 +1,58 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - msgget</TITLE>
<P>Go to the <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">previous</A>, <A HREF="syscalls_76.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_76.html">next</A> section.<P>
<H2><A NAME="SEC75" HREF="syscalls_toc.html#SEC75" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC75">msgget</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int msgget(key_t <VAR>key</VAR>, int <VAR>msgflg</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>key</VAR>: [in] the message queue identifier to get.
<P>
<VAR>msgflg</VAR>: [in] some flags (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
Gets a message queue identifier. If <VAR>key</VAR> is <CODE>IPC_PRIVATE</CODE>, a
new queue is created, otherwise the result depends on <VAR>msgflg</VAR>. The
possible values for <VAR>msgflg</VAR> are:
<P>
<DL COMPACT>
<DT><CODE>IPC_CREAT</CODE>
<DD>creates a new queue for the key if it does not already exist.
<P>
<DT><CODE>IPC_EXCL</CODE>
<DD>if there is already a existing queue associated with <VAR>key</VAR>, the call
fails.
</DL>
<P>
The 9 lower bits of <VAR>msgflg</VAR> specify the permission bits of the new
queue. They have the same layout and meaning as those for files.
However, the execute permissions are meaningless for queues.
<P>
When creating a queue the system sets the appropriate parameters in the
<CODE>msqid_ds</CODE> structure associated with the new queue. When accessing
an already existing queue, the system simply check if the queue can be
accessed.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns the new queue identificator. On error -1 is
returned and <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the task has no access permission to the queue.
<LI><CODE>EEXIST</CODE>: <CODE>IPC_CREAT</CODE> and <CODE>IPC_EXCL</CODE> were specified
and the queue already exists.
<LI><CODE>EIDRM</CODE>: the message queue no longer exists in the system.
<LI><CODE>ENOENT</CODE>: the message queue never existed.
<LI><CODE>ENOSPC</CODE>: the maximum number of message queues for the system
has been reached.
<LI><CODE>ENOMEM</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_74.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_74.html">previous</A>, <A HREF="syscalls_76.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_76.html">next</A> section.<P>

View File

@@ -0,0 +1,118 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - msgrcv</TITLE>
<P>Go to the <A HREF="syscalls_75.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_75.html">previous</A>, <A HREF="syscalls_77.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_77.html">next</A> section.<P>
<H2><A NAME="SEC76" HREF="syscalls_toc.html#SEC76" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC76">msgrcv and msgsnd</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int msgsnd(int <VAR>msqid</VAR>, struct msgbuf *<VAR>msgp</VAR>, int <VAR>msgsz</VAR>,
int <VAR>msgflg</VAR>);</CODE>
<P>
<CODE>int msgrcv(int <VAR>msqid</VAR>, struct msgbuf *<VAR>msgp</VAR>, int <VAR>msgsz</VAR>,
long <VAR>msgtyp</VAR>, int <VAR>msgflg</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>msqid</VAR>: [in] the message queue.
<P>
<VAR>msgp</VAR>: for <VAR>msgsnd</VAR>, [in] points to the message to send. For
<VAR>msgrcv</VAR>, [out] points to the buffer where to put the message.
<P>
<VAR>msgsz</VAR>: [in] size of the <VAR>mtext</VAR> part of the buffer. The
maximum possible size is <CODE>MSGMAX</CODE> and is currently 4080 bytes.
<P>
<VAR>msgflg</VAR>: [in] flags (see description).
<P>
<VAR>msgtyp</VAR>: [in] the type of message to receive.
<P>
<H3>DESCRIPTION</H3>
<P>
<VAR>msgp</VAR> must point to a buffer having the following structure:
<P>
<PRE>
struct msgbuf {
long mtype; /* message type, must &#62; 0 */
char mtext[1]; /* message data */
}
</PRE>
<P>
The calling process must have read permission on the queue to call
<CODE>msgrcv</CODE> and write permission on the queue to call <CODE>msgsnd</CODE>.
<P>
<CODE>msgsnd</CODE> tries to enqueue the message. If <VAR>msglfg</VAR> is set to
<CODE>IPC_NOWAIT</CODE> and the queue is full, the call fails. Otherwise the
call blocks. If the send succeed, the message queue structure is updated
as follow:
<P>
<UL>
<LI><CODE>msg_lspid</CODE> is set to the pid of the calling process.
<LI><CODE>msg_qnum</CODE> is incremented by 1.
<LI><CODE>msg_stime</CODE> is set to the current time.
</UL>
<P>
<CODE>msgrcv</CODE> dequeues a message from the message queue. If the message
to be dequeued has a length greater than <VAR>msgsz</VAR>, then the call
fails. If the length is greater but the <CODE>MSG_NOERROR</CODE> flag is
specified, the message gets truncated (and the truncated information is
lost forever). The message to be dequeued can be choosed by the
following values of <VAR>msgtyp</VAR>:
<P>
<UL>
<LI><VAR>msgtyp</VAR> equals 0: in this case the 1st message on the queue
is dequeued.
<P>
<LI><VAR>msgtyp</VAR> is greater than 0: if the flag <CODE>MSG_EXCEPT</CODE> is
not specified, the first message of type <VAR>msgtyp</VAR> on the queue will
be dequeued, otherwise the first message <EM>not</EM> of type <VAR>msgtyp</VAR>
on the queue will be dequeued.
<P>
<LI><VAR>msgtyp</VAR> is less than 0: the first message of type in the range
[1,-<VAR>msgtyp</VAR>] will be dequeued.
</UL>
<P>
If the flag <CODE>IPC_NOWAIT</CODE> is specified and there is no message of
the specified type on the message queue, the call will fail, otherwise
the call will block. On success, the queue data structure is updated as
follow:
<P>
<UL>
<LI><CODE>msg_lrpid</CODE> is set to the pid of the calling process.
<LI><CODE>msg_qnum</CODE> is decremented by 1.
<LI><CODE>msg_rtime</CODE> is set to the current time.
</UL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success <CODE>msgsnd</CODE> returns zero and <VAR>msgrcv</VAR> returns the
number of bytes copied in the <CODE>mtext</CODE> array. On error -1 is
returned and <CODE>errno</CODE> is set to one of the following values:
<P>
for <VAR>msgsnd</VAR>:
<P>
<UL>
<LI><CODE>EAGAIN</CODE>: <CODE>IPC_NOWAIT</CODE> was specified and the queue is
full.
<LI><CODE>EACCESS</CODE>: the calling task does not have write permission on
the queue.
<LI><CODE>EIDRM</CODE>: the queue has been removed.
<LI><CODE>EINVAL</CODE>: invalid <VAR>msqid</VAR>, <VAR>msgsz</VAR> or <VAR>mtype</VAR> value.
<LI><CODE>EFAULT</CODE>, <CODE>EINTR</CODE> and <CODE>ENOMEM</CODE>.
</UL>
<P>
for <VAR>msgrcv</VAR>:
<P>
<UL>
<LI><CODE>E2BIG</CODE>: <CODE>MSG_NOERROR</CODE> is not specified and the message
that should be dequeued is too bigger than <VAR>msgsz</VAR>.
<LI><CODE>EACCESS</CODE>: the calling task does not have read permission on
the queue.
<LI><CODE>EIDRM</CODE>: the queue has been removed.
<LI><CODE>EINVAL</CODE>: invalid <VAR>msqid</VAR> or <VAR>msgsz</VAR> value.
<LI><CODE>ENOMSG</CODE>: <CODE>IPC_NOWAIT</CODE> was specified no message of the
specified type is on the queue.
<LI><CODE>EFAULT</CODE>, <CODE>EINTR</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_75.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_75.html">previous</A>, <A HREF="syscalls_77.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_77.html">next</A> section.<P>

View File

@@ -0,0 +1,108 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - semctl</TITLE>
<P>Go to the <A HREF="syscalls_76.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_76.html">previous</A>, <A HREF="syscalls_78.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_78.html">next</A> section.<P>
<H2><A NAME="SEC77" HREF="syscalls_toc.html#SEC77" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC77">semctl</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int semctl(int <VAR>semid</VAR>, int <VAR>semnun</VAR>, int <VAR>cmd</VAR>, union
semun <VAR>arg</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>semid</VAR>: [in] the semaphore set to manipulate.
<P>
<VAR>semnum</VAR>: [in] the semaphore in the set to manipulate (0 is the first).
<P>
<VAR>cmd</VAR>: [in] the operation to perform.
<P>
<VAR>arg</VAR>: [in out] an argument to the operation (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
Manipulates a semaphore set or members of a semaphore set. The possible
values for <VAR>cmd</VAR> are:
<P>
<DL COMPACT>
<DT><CODE>IPC_STAT</CODE>
<DD>gets some information on the semaphore set. The calling task must have read
access to the semaphore set.
<P>
<DT><CODE>IPC_SET</CODE>
<DD>modify some members of the <CODE>semid_ds</CODE> structure of a semaphore in
the set. The members that can be modified are: <CODE>sem_perm.uid</CODE>,
<CODE>sem_perm.gid</CODE>, and the lower 9 bits of <CODE>sem_perm.mode</CODE>. The
calling task must be the owner or the creator of the semaphore set or the
superuser. The <CODE>sem_ctime</CODE> field of the set is updated to the
current time.
<P>
<DT><CODE>IPC_RMID</CODE>
<DD>removes the semaphore set and awakens the process blocked on operations
performed on that set. Only the creator or the owner of the set or the
superuser may use this option.
<P>
<DT><CODE>GETALL</CODE>
<DD>returns the <CODE>semval</CODE> value of all semaphore in an array.
<P>
<DT><CODE>GETNCNT</CODE>
<DD>returns the number of processes waiting for the value of a specific
semaphore in the semaphore set to increase. The calling task must have
read privileges on the semaphore set.
<P>
<DT><CODE>GETPPID</CODE>
<DD>returns the pid of the last process to have executed a semaphore
opreation a specific semaphore of the semaphore set. The calling task
must have read privileges on the semaphore set.
<P>
<DT><CODE>GETVAL</CODE>
<DD>returns the value of a specific semaphore in the semaphore set. The
calling task must have read privileges on the semaphore set.
<P>
<DT><CODE>GETZCNT</CODE>
<DD>returns the number of processes waiting for the value of a specific
semaphore in the semaphore set to be zero. The calling task must have
read privileges on the semaphore set.
<P>
<DT><CODE>SETALL</CODE>
<DD>sets the value of all semaphore in the semaphore set. The calling task
must have alter privileges on the semaphore set.
<P>
<DT><CODE>SETVAL</CODE>
<DD>sets the value of a specific semaphore in the semaphore set. The calling
task must have alter privileges on the semaphore set.
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success, with <VAR>cmd</VAR> equals to:
<P>
<DL COMPACT>
<DT><CODE>GETNCNT</CODE>
<DD>the number of waiting tasks (see description).
<P>
<DT><CODE>GETPID</CODE>
<DD>the task pid (see description).
<P>
<DT><CODE>GETVAL</CODE>
<DD>the value of the semaphore.
<P>
<DT><CODE>GETZCNT</CODE>
<DD>the number of waiting tasks (see description).
</DL>
<P>
For other values of <VAR>cmd</VAR>, it returns zero. On error, the call
returns -1 and <CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>EIDRM</CODE>
<LI><CODE>EINVAL</CODE>: invalid value for <VAR>cmd</VAR> or <VAR>semid</VAR>.
<LI><CODE>EPERM</CODE>: the calling task tried <CODE>IPC_SET</CODE> or
<CODE>IPC_RMID</CODE> but is not the creator or the owner of the semaphore set
or the superuser.
<LI><CODE>ERANGE</CODE>: the specified value for the semaphore is out of
range.
</UL>
<P>
<P>Go to the <A HREF="syscalls_76.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_76.html">previous</A>, <A HREF="syscalls_78.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_78.html">next</A> section.<P>

View File

@@ -0,0 +1,61 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - semget</TITLE>
<P>Go to the <A HREF="syscalls_77.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_77.html">previous</A>, <A HREF="syscalls_79.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_79.html">next</A> section.<P>
<H2><A NAME="SEC78" HREF="syscalls_toc.html#SEC78" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC78">semget</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int semget(key_t <VAR>key</VAR>, int <VAR>nsems</VAR>, int <VAR>semflg</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>key</VAR>: [in] the semaphore set identificator.
<P>
<VAR>nsems</VAR>: [in] the number of semaphore in the set.
<P>
<VAR>semflg</VAR>: [in] flags (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
Gets a semaphore set identifier. If <VAR>key</VAR> is <CODE>IPC_PRIVATE</CODE>, a
new set is created. Otherwise, the result depends on the value of
<VAR>semflg</VAR>:
<P>
<DL COMPACT>
<DT><CODE>IPC_CREAT</CODE>
<DD>creates a new queue for the key if it does not already exist.
<P>
<DT><CODE>IPC_EXCL</CODE>
<DD>if there is already a existing queue associated with <VAR>key</VAR>, the call
fails.
</DL>
<P>
The 9 lower bits of <VAR>semflg</VAR> specify the permission bits of the new
set. They have the same layout and meaning as those for files.
However, the execute permissions are meaningless for sets.
<P>
When creating a set the system sets the appropriate parameters in the
<CODE>semid_ds</CODE> structure associated with the new set. When accessing
an already existing set, the system simply check if the set can be
accessed.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns the new semaphore set identificator. On
error -1 is returned and <CODE>errno</CODE> is set to one of the following
values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the task has no access permission to the set.
<LI><CODE>EEXIST</CODE>: <CODE>IPC_CREAT</CODE> and <CODE>IPC_EXCL</CODE> were specified
and the set already exists.
<LI><CODE>EIDRM</CODE>: the set no longer exists in the system.
<LI><CODE>ENOENT</CODE>: the set never existed.
<LI><CODE>ENOSPC</CODE>: the maximum number of semaphore sets for the system
has been reached.
<LI><CODE>ENOMEM</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_77.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_77.html">previous</A>, <A HREF="syscalls_79.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_79.html">next</A> section.<P>

View File

@@ -0,0 +1,82 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - semop</TITLE>
<P>Go to the <A HREF="syscalls_78.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_78.html">previous</A>, <A HREF="syscalls_80.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_80.html">next</A> section.<P>
<H2><A NAME="SEC79" HREF="syscalls_toc.html#SEC79" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC79">semop</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int semop(int <VAR>semid</VAR>, struct sembuf *<VAR>sops</VAR>, unsigned
<VAR>nsops</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>semid</VAR>: [in] the semaphore set on which to perform the operations.
<P>
<VAR>sops</VAR>: [in] points to an array of operations to perfrom.
<P>
<VAR>nsops</VAR>: [in] the number of element in <VAR>sops</VAR>.
<P>
<H3>DESCRIPTION</H3>
<P>
Perform operations on a semaphore set. The <VAR>sops</VAR> parameter a
structure <CODE>sembuf</CODE> of the form:
<P>
<DL COMPACT>
<DT><CODE>short sem_num</CODE>
<DD>which semaphore to operate on (0 is the first).
<P>
<DT><CODE>short sem_op;</CODE>
<DD>the operation.
<P>
<DT><CODE>short sem_flg;</CODE>
<DD></DL>
<P>
<VAR>sem_flg</VAR> may be <CODE>IPC_NOWAIT</CODE> for non blocking calls and
<CODE>SEM_UNDO</CODE> to specify an operation that will be undone on task
termination. The individual operations are perfomed if and only if all
of them will succeed.
<P>
The possible values of <VAR>cmd</VAR> are:
<P>
<UL>
<LI><VAR>cmd</VAR> positive: the value of <VAR>cmd</VAR> is added to the value
of the semaphore. The calling task must have alter privileges on the
semaphore set.
<P>
<LI><VAR>cmd</VAR> equals to zero: if the value of the semaphore is zero,
the call returns. Otherwise, the call block until: the value of the
semaphore becomes zero, the semaphore set is removed, or a signal
occurs. The calling task must have read privileges on the semaphore set.
<P>
<LI><VAR>cmd</VAR> is lower than zero: if the value of the semaphore is
greater than the absolute value of <VAR>cmd</VAR>, the value of the semaphore
is decremented by the value of <VAR>cmd</VAR> and the call returns.
Otherwise, the call block until: the value of the semaphore becomes
greater than the absolute value of <VAR>cmd</VAR> at which time the value of
the semaphore is decremented by the value of <VAR>cmd</VAR> and then the call
returns, the semaphore set is removed, or a signal occurs. The calling
task must have alter privileges on the semaphore set.
</UL>
<P>
Whenever a call succeed, the <CODE>sempid</CODE> member of the semaphore set
structure is set to the pid of the current task and the <CODE>sem_ctime</CODE>
and <CODE>sem_otime</CODE> member are set to the current time.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns zero. On error -1 is returned and
<CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>E2BIG</CODE>: there is too many operations requested (the maximum
is <CODE>SEMOPM</CODE>.
<LI><CODE>EFBIG</CODE>: the semaphore number of some operation is out of range.
<LI><CODE>EINVAL</CODE>: invalid value for <VAR>semid</VAR> or <VAR>nsops</VAR>.
<LI><CODE>ERANGE</CODE>: semaphore value out of range.
<LI><CODE>EACCESS</CODE>, <CODE>EAGAIN</CODE>, <CODE>EFAULT</CODE>, <CODE>EIDRM</CODE>,
<CODE>EINTR</CODE> or <CODE>ENOMEM</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_78.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_78.html">previous</A>, <A HREF="syscalls_80.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_80.html">next</A> section.<P>

View File

@@ -0,0 +1,34 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - chroot</TITLE>
<P>Go to the <A HREF="syscalls_7.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_7.html">previous</A>, <A HREF="syscalls_9.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_9.html">next</A> section.<P>
<H2><A NAME="SEC8" HREF="syscalls_toc.html#SEC8" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC8">chroot</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int chroot(const char *<VAR>path</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>path</VAR>: [in] points to the new root.
<P>
<H3>DESCRIPTION</H3>
<P>
Changes the root directory for the current task and all its children to
the path specified by <VAR>path</VAR>. This operation is privilegied and only
the superuser can invoke it successfully.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error, -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EPERM</CODE>: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
<LI><CODE>ENOTDIR</CODE>, <CODE>EACCESS</CODE>, <CODE>EFAULT</CODE>, <CODE>ENOENT</CODE>,
<CODE>ENOMEM</CODE> <CODE>ENAMETOOLONG</CODE>, <CODE>EROFS</CODE> or <CODE>ELOOP</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_7.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_7.html">previous</A>, <A HREF="syscalls_9.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_9.html">next</A> section.<P>

View File

@@ -0,0 +1,90 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - shmat</TITLE>
<P>Go to the <A HREF="syscalls_79.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_79.html">previous</A>, <A HREF="syscalls_81.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_81.html">next</A> section.<P>
<H2><A NAME="SEC80" HREF="syscalls_toc.html#SEC80" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC80">shmat and shmdt</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>char *shmat(int <VAR>shmid</VAR>, char *<VAR>shmaddr</VAR>, int <VAR>shmflg</VAR>);</CODE>
<P>
<CODE>int shmdt(char *<VAR>shmaddr</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>shmid</VAR>: [in] the shared memory identificator.
<P>
<VAR>shmaddr</VAR>: [in] the start of the shared memory.
<P>
<VAR>shmflg</VAR>: [in] some flags (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>shmat</CODE> attaches a shared memory identificator to a memory range in
the task address space. If <VAR>shmaddr</VAR> is zero the range where to
attach the shared memory is choosen by the system. If <VAR>shmaddr</VAR> is
not zero and the flag <CODE>SHM_RND</CODE> is specified, the address is
rounded down at a multiple of <CODE>SHMBLA</CODE>. In any other cases, the
address must be page alligned.
<P>
If the flag <CODE>SHM_RDONLY</CODE> is specified the task must have read
privileges to the segment and it is attached for reading only.
Otherwise, the task must have read and write privileges on the segment
and it is attached for reading and writing. The same segment may be
attached more than once is the same address space with different flags.
<P>
On success, the following members of the <CODE>shmid_ds</CODE> structure of
the segment are modified:
<P>
<DL COMPACT>
<DT><CODE>shm_atime</CODE>
<DD>is set to the current time.
<P>
<DT><CODE>shm_lpid</CODE>
<DD>is set to the current pid.
<P>
<DT><CODE>shm_nattch</CODE>
<DD>is incremented by one.
</DL>
<P>
<CODE>shmdt</CODE> detaches shared memory segments attached by <CODE>shmat</CODE>.
The <VAR>shmaddr</VAR> parameter must be the same value returned by the
<CODE>shmat</CODE> that attached the segment.
<P>
On success, the following members of the <CODE>shmid_ds</CODE> structure of
the segment are modified:
<P>
<DL COMPACT>
<DT><CODE>shm_dtime</CODE>
<DD>is set to the current time.
<P>
<DT><CODE>shm_lpid</CODE>
<DD>is set to the current pid.
<P>
<DT><CODE>shm_nattch</CODE>
<DD>is decremented by one. If it becomes 0 and the segment is marked for
deletionm, the segment is deleted.
</DL>
<P>
Attached memory segments are inherited through the <CODE>fork</CODE> call.
They are detached after a <CODE>exec</CODE> or <CODE>exit</CODE> call.
<P>
<H3>RETURN VALUE</H3>
<P>
On success <CODE>shmat</CODE> returns the address of the new memory segment
and <CODE>shmdt</CODE> returns zero. On error, both calls return -1, and set
<CODE>errno</CODE>. The possibles values of <CODE>errno</CODE> are:
<P>
for <CODE>shmat</CODE>:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: not enough privileges on the segment.
<LI><CODE>EINVAL</CODE>: <VAR>shmid</VAR> or <VAR>shmaddr</VAR> invalid.
<LI><CODE>ENOMEM</CODE>.
</UL>
<P>
for <CODE>shmdt</CODE>: the only possible value is <CODE>EINVAL</CODE> for an
invalid value of <VAR>shmaddr</VAR>.
<P>
<P>Go to the <A HREF="syscalls_79.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_79.html">previous</A>, <A HREF="syscalls_81.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_81.html">next</A> section.<P>

View File

@@ -0,0 +1,83 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - shmctl</TITLE>
<P>Go to the <A HREF="syscalls_80.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_80.html">previous</A>, <A HREF="syscalls_82.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_82.html">next</A> section.<P>
<H2><A NAME="SEC81" HREF="syscalls_toc.html#SEC81" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC81">shmctl</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int shmctl(int <VAR>shmid</VAR>, int <VAR>cmd</VAR>, struct shmid_ds
*<VAR>buf</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>shmid</VAR>: [in] the memory segment to manipulate.
<P>
<VAR>cmd</VAR>: [in] the operation to perform.
<P>
<VAR>buf</VAR>: [in out] parameter for the operation (see description).
<H3>DESCRIPTION</H3>
<P>
This calls manipulates some operational parameters of shared memory
segments. The <CODE>shmid_ds</CODE> structure has the following layout:
<P>
<PRE>
struct shmid_ds {
struct ipc_perm shm_perm; /* operation perms */
int shm_segsz; /* size of segment (bytes) */
time_t shm_atime; /* last attach time */
time_t shm_dtime; /* last detach time */
time_t shm_ctime; /* last change time */
unsigned short shm_cpid; /* pid of creator */
unsigned short shm_lpid; /* pid of last operator */
short shm_nattch; /* no. of current attaches */
/* the following are private */
unsigned short shm_npages; /* size of segment (pages) */
unsigned long *shm_pages; /* array of ptrs to frames -&#62; SHMMAX */
struct shm_desc *attaches; /* descriptors for attaches */
};
</PRE>
<P>
<VAR>cmd</VAR> can take the following values:
<P>
<DL COMPACT>
<DT><CODE>IPC_STAT</CODE>
<DD>retreives the <CODE>shmid_ds</CODE> structure of the memory segment. The
calling taks must have read privileges on the segment.
<P>
<DT><CODE>IPC_SET</CODE>
<DD>sets the <CODE>shmid_ds</CODE> structure of the memory segment. The calling
task must have alter privileges on the segment. Only the members
<CODE>uid</CODE>, <CODE>gid</CODE> and the lower 9 bits of <CODE>mode</CODE> of
<CODE>shm_perm</CODE> can be modified.
<P>
<DT><CODE>IPC_RMID</CODE>
<DD>mark the shared memory segment as destroyed. The calling taks must have
the same uid of the creator or the owner of the memory segment or be the
superuser.
<P>
<DT><CODE>SHM_LOCK</CODE>
<DD>prevents the memory segment to be swaped out to disk. Only a task with
superuser privileges may use this command.
<P>
<DT><CODE>SHM_UNLOCK</CODE>
<DD>allows the memory segment to be swaped out to disk. Only a task with
superuser privileges may use this command.
<P>
</DL>
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns zero. On error -1 is returned and
<CODE>errno</CODE> is set to one of the following values:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: <VAR>shmid</VAR> or <VAR>cmd</VAR> are not valid.
<LI><CODE>EPERM</CODE>: the calling task does not have enough privileges on
the memory segment to perform the operation.
<LI><CODE>EFAULT</CODE> or <CODE>EIDRM</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_80.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_80.html">previous</A>, <A HREF="syscalls_82.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_82.html">next</A> section.<P>

View File

@@ -0,0 +1,65 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - shmget</TITLE>
<P>Go to the <A HREF="syscalls_81.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_81.html">previous</A>, <A HREF="syscalls_83.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_83.html">next</A> section.<P>
<H2><A NAME="SEC82" HREF="syscalls_toc.html#SEC82" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC82">shmget</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int shmget(key_t <VAR>key</VAR>, int <VAR>size</VAR>, int <VAR>shmflg</VAR>);</CODE>
<H3>PARAMETERS</H3>
<P>
<VAR>key</VAR>: [in] the shared memory segment identificator.
<P>
<VAR>size</VAR>: [in] size of the segment.
<P>
<VAR>shmflg</VAR>: [in] flags (see description).
<P>
<H3>DESCRIPTION</H3>
<P>
Gets a shared memory segment identifier. If <VAR>key</VAR> is
<CODE>IPC_PRIVATE</CODE>, a new segment is created. Otherwise, the result
depends on the value of <VAR>shmflg</VAR>:
<P>
<DL COMPACT>
<DT><CODE>IPC_CREAT</CODE>
<DD>creates a new segment for the key if it does not already exist.
<P>
<DT><CODE>IPC_EXCL</CODE>
<DD>if there is already a existing segment associated with <VAR>key</VAR>, the call
fails.
</DL>
<P>
The value of <CODE>size</CODE> is rounded up to a multiple of <CODE>PAGE_SIZE</CODE>.
<P>
The 9 lower bits of <VAR>shmflg</VAR> specify the permission bits of the new
segment. They have the same layout and meaning as those for files.
However, the execute permissions are meaningless for segments.
<P>
When creating a segment the system sets the appropriate parameters in
the <CODE>shmid_ds</CODE> structure associated with the new segment. When
accessing an already existing segment, the system simply check if the
segment can be accessed.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, the call returns the new shared memory segment
identificator. On error -1 is returned and <CODE>errno</CODE> is set to one of
the following values:
<P>
<UL>
<LI><CODE>EACCESS</CODE>: the task has no access permission to the segment.
<LI><CODE>EEXIST</CODE>: <CODE>IPC_CREAT</CODE> and <CODE>IPC_EXCL</CODE> were specified
and the segment already exists.
<LI><CODE>EIDRM</CODE>: the segment no longer exists in the system.
<LI><CODE>ENOENT</CODE>: the segment never existed.
<LI><CODE>ENOSPC</CODE>: the maximum number of shared memory segment for the
system has been reached.
<LI><CODE>EINVAL</CODE>: <VAR>size</VAR> is outside the range [SHMMIN,SHMMAX] or
is greater than the size of the segment (in the case where it already exists).
<LI><CODE>ENOMEM</CODE>
</UL>
<P>
<P>Go to the <A HREF="syscalls_81.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_81.html">previous</A>, <A HREF="syscalls_83.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_83.html">next</A> section.<P>

View File

@@ -0,0 +1,10 @@
<html><!-- This HTML file has been created by texi2html 1.29
from syscalls.texi on 4 June 1994 -->
<TITLE>Syscall specifications of Linux - misc</TITLE>
<P>Go to the <A HREF="syscalls_82.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_82.html">previous</A>, <A HREF="syscalls_84.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_84.html">next</A> section.<P>
<H1><A NAME="SEC83" HREF="syscalls_toc.html#SEC83" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_toc.html#SEC83">Other calls</A></H1>
<P>
The calls that have not been already described are described here.
<P>
<P>Go to the <A HREF="syscalls_82.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_82.html">previous</A>, <A HREF="syscalls_84.html" tppabs="http://www.infran.ru/TechInfo/syscalls/syscalls_84.html">next</A> section.<P>

Some files were not shown because too many files have changed in this diff Show More