📄 fcntl.2
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:05:40 1996%%Pages: (atend)%%DocumentFonts: (atend)/devps 180 dict def devps begin/res 10.000000 def/y_offset 843 def/X{exch}bind def/mm {transform round X round X itransform} bind def/r{rmoveto}bind def/m{moveto}bind def/l{lineto}bind def/rl{rlineto}bind def/st{stroke}bind def/gs{gsave}bind def/gr{grestore}bind def/cp{currentpoint}bind def/np{newpath}bind def/ct{curveto}bind defsystemdict /setpacking known { /savepacking currentpacking def true setpacking } if/m0{0 0 moveto}bind def/xc{//res div}bind def/yc{//res neg div //y_offset add}bind def/lc{yc X xc X l st}bind def/mc{yc X xc X m}bind def/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def/V{//res neg div //y_offset addcurrentpoint pop Xm}bind def/H{//res div0 transform X round X itransform popcurrentpoint X popmoveto}bind def/h{//res div 0 r}bind def/v{//res neg div 0 X r}bind def/S{X H show}bind def/A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def/psize 10 def/height 0 def/cheight { height 0 ne { height } { psize } ifelse } bind def/slant 0 def/FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def/shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fillgr}bind def1 setlinecap/resolution res 72 mul def/startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def}bind def/clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto}bind def/doclip { llx lly urx ury clipFig } def/endFig { end SavedState restore}bind def/globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def/globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def}bind def/fontnum 1 def systemdict /setpacking known { savepacking setpacking} ifend/BP{save mark devps begin m0/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecapcurrentlinejoin currentdash currentgray currentmiterlimit ] cvx def}bind def/EP{end cleartomark restore showpage}def/Encoding-1 256 array def0 1 255 {Encoding-1 exch /.notdef put} forEncoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-BEncoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-bEncoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accentsEncoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessiEncoding-1dup 8#41 /copyright putdup 8#42 /registered putdup 8#43 /trademark putdup 8#44 /logicalnot putdup 8#45 /Eth putdup 8#46 /eth putdup 8#47 /Thorn putdup 8#50 /thorn putdup 8#51 /brokenbar putdup 8#52 /degree putdup 8#53 /divide putdup 8#54 /multiply putdup 8#55 /minus putdup 8#56 /onehalf putdup 8#57 /onequarter putdup 8#60 /threequarters putdup 8#101 /Aacute putdup 8#102 /Acircumflex putdup 8#103 /Adieresis putdup 8#104 /Agrave putdup 8#105 /Aring putdup 8#106 /Atilde putdup 8#107 /Ccedilla putdup 8#110 /Eacute putdup 8#111 /Ecircumflex putdup 8#112 /Edieresis putdup 8#113 /Egrave putdup 8#114 /Iacute putdup 8#115 /Icircumflex putdup 8#116 /Idieresis putdup 8#117 /Igrave putdup 8#120 /Ntilde putdup 8#121 /Oacute putdup 8#122 /Ocircumflex putdup 8#123 /Odieresis putdup 8#124 /Ograve putdup 8#125 /Otilde putdup 8#126 /Scaron putdup 8#127 /Uacute putdup 8#130 /Ucircumflex putdup 8#131 /Udieresis putdup 8#132 /Ugrave putdup 8#133 /Ydieresis putdup 8#134 /Zcaron putdup 8#135 /aacute putdup 8#136 /acircumflex putdup 8#137 /adieresis putdup 8#140 /agrave putdup 8#141 /aring putdup 8#142 /atilde putdup 8#143 /ccedilla putdup 8#144 /eacute putdup 8#145 /ecircumflex putdup 8#146 /edieresis putdup 8#147 /egrave putdup 8#150 /iacute putdup 8#151 /icircumflex putdup 8#152 /idieresis putdup 8#153 /igrave putdup 8#154 /ntilde putdup 8#155 /oacute putdup 8#156 /ocircumflex putdup 8#157 /odieresis putdup 8#160 /ograve putdup 8#161 /otilde putdup 8#162 /scaron putdup 8#163 /uacute putdup 8#164 /ucircumflex putdup 8#165 /udieresis putdup 8#166 /ugrave putdup 8#167 /ydieresis putdup 8#170 /zcaron putpop/Enc-dict 30 dict defEnc-dict /tmpstr1 50 string putEnc-dict /tmpstr2 50 string putEnc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put/AEnc-def { % arguments: the original font's name, encoding nrEnc-dict begintmpstr2 cvs /Enc-no exch def % Remember the number in a stringdup /OrigName exch def % remember the namefindfont dup maxlength dict /newdict exch def % get dictionary for new font{ exch dup /FID ne { exch newdict 3 1 roll put } { pop pop } % Ignore FID ifelse} forallnewdict begin/Encoding tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval cvn load def % Replace encodingcurrentdict /UniqueID known{ /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueIDend % newdict/FNlength OrigName tmpstr1 cvs length def % convert name, remember lengthFNlength 1 add Enc-no length add stringdup 0 OrigName tmpstr1 cvs putintervaldup FNlength (-) putintervaldup FNlength 1 add Enc-no putintervaldup 0 tmpstr1 0 FNlength getinterval putinterval % Add old namecvn dup newdict /FontName 3 2 roll put newdict definefontend % Enc-dict} def/Times-Roman 1 AEnc-def pop/R-1{/Times-Roman-1 FF}def/R{/Times-Roman FF}def/B{/Times-Bold FF}def/I{/Times-Italic FF}def/Times-Bold 1 AEnc-def pop/B-1{/Times-Bold-1 FF}def%%EndProlog%%Page: 1 1BP/slant 0 def/height 0 def480 V10 R720(FCNTL)S1048(\()S1090(2)S1148(\))S2696(Eighth)S(Edition)296 2989 A4799(FCNTL)S5127(\()S5169(2)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(fcntl)S10 R-11290(-)S10 R1372(miscellaneous)S1967(\256le)S2121(descriptor)S2549(control)S2859(functions)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<fcntl.h>)S1608 V1080(int)S1236(fcntl\(int)S10 I1623(fd)S10 B1701(,)S1764(int)S1920(*)S10 I1970(cmd)S10 B2138(,)S10 R2201([)S10 I2235(data)S10 R2413(])S10 B2447(\))S1776 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S1896 V10 B1080(Fcntl\(\))S10 R1406(performs)S1803(several)S2122(\256le)S2284(descriptor)S2720(related)S3028(functions,)S3461(like)S(duplicating)452 3646 A4132(a)S4211(\256le)S4374(descriptor,)S(setting)268 4836 A5138(the)S2016 V1080("close)S1356(on)S1483(exec")S1736(attribute,)S2124(etc.)S2319(The)S10 I2503(fd)S10 R2608(argument)S3015(is)S3109(the)S3259(\256le)S3415(descriptor)S3845(to)S3950(operate)S4274(on,)S10 I4426(cmd)S10 R4621(is)S4715(the)S4865(command)S2136 V1080(code)S1299(of)S1412(the)S1564(operation)S1973(to)S2080(perform,)S2460(and)S10 I2635(data)S10 R2843(is)S2940(an)S3065(optional)S3424(argument)S3834(to)S3942(give)S4145(or)S(receive)292 4259 A4581(parameters.)S5104(The)S2256 V1080(command)S1501(codes)S1755(and)S1925(other)S2157(symbols)S2516(and)S2686(types)S2923(are)S3072(declared)S3439(in)S3542(<fcntl.h>.)S3991(The)S4173(commands)S4633(are:)S2424 V10 B1080(fcntl\()S10 I1311(fd)S10 B1397(,)S1447(F_DUPFD,)S1952(int)S10 I2095(fd2)S10 B2231(\))S2544 V10 R1440(Returns)S1788(a)S1868(new)S2071(\256le)S2235(descriptor)S2673(that)S2859(is)S2962(a)S(duplicate)369 3043 A3448(of)S3568(\256le)S3733(descriptor)S10 I4172(fd)S10 R4258(.)S4344(It)S4442(shares)S4730(the)S4889(same)S5132(\256le)S2664 V1440(pointer)S1753(and)S1926(the)S2077(same)S2312(\256le)S2469(status)S2726(\257ags,)S2969(but)S3125(has)S3287(separate)S3646(\256le)S3802(descriptor)S4232(\257ags)S4449(that)S4627(are)S(initially)313 4778 A5118(off.)S2784 V1440(The)S1624(value)S1869(of)S1980(the)S(duplicate)369 2130 A2526(\256le)S2682(descriptor)S3112(is)S3206(the)S3356(\256rst)S3541(free)S3727(\256le)S3884(descriptor)S4315(greater)S4624(than)S4825(or)S4937(equal)S5183(to)S2904 V10 I1440(fd2)S10 R1576(.)S3072 V10 B1080(fcntl\()S10 I1311(fd)S10 B1397(,)S1447(F_GETFD\))S3192 V10 R1440(Returns)S1783(the)S1936(\256le)S2095(descriptor)S2528(\257ags)S2748(associated)S3193(with)S3403(\256le)S3563(descriptor)S10 I3997(fd)S10 R4083(.)S4164(The)S4352(\257ags)S4573(are)S4728(the)S4882("close)S5161(on)S3312 V1440(exec")S1705(\257ag)S10 B1895(FD_CLOEXEC)S10 R2617(that,)S2832(when)S3089(set,)S3265(causes)S3567(the)S3729(\256le)S3897(descriptor)S4338(to)S4454(be)S4587(closed)S4882(when)S5138(the)S3432 V1440(process)S1780(executes)S2165(another)S2505(program.)S2935(The)S3131(Minix-vmd)S3627(speci\256c)S10 B(FD_ASYNCHIO)728 3974 A10 R4741(\257ag)S4931(marks)S5216(a)S3552 V1440(\256le)S1594(descriptor)S2022(for)S(asynchronous)552 2165 A2742(I/O)S2902(operation.)S3720 V10 B1080(fcntl\()S10 I1311(fd)S10 B1397(,)S1447(F_SETFD,)S1934(int)S10 I(\257ags)189 2077 A10 B2274(\))S3840 V10 R1440(Set)S1594(the)S1742(\256le)S1896(descriptor)S2324(\257ags)S2539(of)S10 I2648(fd)S10 R2751(to)S10 I(\257ags)189 2854 A10 R3051(.)S4008 V10 B1080(fcntl\()S10 I1311(fd)S10 B1397(,)S1447(F_GETFL\))S4128 V10 R1440(Return)S1748(the)S1905(\256le)S2068(status)S2331(\257ags)S2555(and)S2734(\256le)S(access)258 2897 A3189(modes)S3485(associated)S3933(with)S4147(the)S4305(\256le)S4469(associated)S4918(with)S5132(\256le)S4248 V1440(descriptor)S10 I1873(fd)S10 R1959(.)S2039(The)S2226(\256le)S2384(status)S2642(\257ags)S2861(are)S10 B3014(O_NONBLOCK)S10 R(\(non)184 3758 A3971(blocking)S4351(I/O\))S4549(and)S10 B4723(O_APPEND)S4368 V10 R1440(\(append)S1798(mode\).)S2139(The)S2331(\256le)S(access)258 2495 A2788(modes)S3085(are)S10 B3244(O_RDONLY)S10 R3844(\(read-only\),)S10 B4358(O_WRONLY)S10 R4985(\(write-)S4488 V1440(only\))S1702(and)S10 B1896(O_RDWR)S10 R2392(\(read-write\).)S2975(These)S3265(\257ags)S3504(are)S3677(also)S3888(used)S4121(in)S4248(the)S(second)279 4420 A4748(argument)S5177(of)S4608 V10 B1440(open)S10 R1647(\(2\).)S4776 V10 B1080(fcntl\()S10 I1311(fd)S10 B1397(,)S1447(F_SETFL,)S1928(int)S10 I(\257ags)189 2071 A10 B2268(\))S4896 V10 R1440(Set)S1615(the)S1784(\256le)S1959(status)S2234(\257ags)S2470(of)S2600(the)S2769(\256le)S2944(referenced)S3417(by)S10 I3563(fd)S10 R3687(to)S10 I(\257ags)189 3812 A10 R4009(.)S4106(Only)S10 B4354(O_NONBLOCK)S10 R5116(and)S5016 V10 B1440(O_APPEND)S10 R2003(may)S2201(be)S2321(changed.)S(Access)286 2731 A3042(mode)S3290(\257ags)S3505(are)S(ignored.)332 3654 A5184 V1080(The)S1262(next)S1460(four)S1653(commands)S2113(use)S2272(a)S2342(parameter)S2771(of)S2880(type)S10 B3078(struct)S3356(\257ock)S10 R3588(that)S3764(is)S3856(de\256ned)S4177(in)S4280(<fcntl.h>)S4679(as:)S5352 V1440(struct)S1689(\257ock)S1915({)S5472 V1640(short)S2040(l_type;)S2640(/*)S2743(F_RDLCK,)S3241(F_WRLCK,)S3761(or)S3870(F_UNLCK)S4349(*/)S5592 V1640(short)S2040(l_whence;)S2640(/*)S2743(SEEK_SET,)S3276(SEEK_CUR,)S3836(or)S3945(SEEK_END)S4481(*/)S5712 V1640(off_t)S2040(l_start;)S2640(/*)S2743(byte)S2941(offset)S3196(to)S3299(start)S3498(of)S3607(segment)S3967(*/)S5832 V1640(off_t)S2040(l_len;)S2640(/*)S2743(length)S3019(of)S3128(segment)S3488(*/)S5952 V1640(pid_t)S2040(l_pid;)S2640(/*)S2743(process)S3070(id)S3173(of)S3282(the)S3430(locks')S3701(owner)S3978(*/)S6072 V1440(};)S6240 V1080(This)S1294(structure)S1682(describes)S2092(a)S2172(segment)S2542(of)S2661(a)S2741(\256le.)S10 B2955(L_type)S10 R3292(is)S3394(the)S3552(lock)S3761(operation)S4177(performed)S4633(on)S4769(the)S4928(\256le)S5093(seg-)S6360 V1080(ment:)S
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -