📄 execve.2
字号:
1080(Each)S1313(process)S1646(has)S10 I1811(real)S10 R2005(user)S2205(and)S(group)234 2382 A2648(IDs)S2826(and)S3003(an)S10 I3130(effective)S10 R3499(user)S3699(and)S(group)234 3876 A4142(IDs.)S4370(The)S10 I4559(real)S10 R4753(ID)S4892(identi\256es)S4992 V1080(the)S1244(person)S1553(using)S1811(the)S1974(system;)S2321(the)S10 I2484(effective)S10 R2861(ID)S3008(determines)S3490(his)S(access)258 3647 A3945(privileges.)S10 B4432(Execve)S10 R4774(changes)S5138(the)S5112 V1080(effective)S1474(user)S1682(and)S(group)234 1867 A2141(ID)S2288(to)S2406(the)S2569(owner)S2861(of)S2985(the)S3149(executed)S3548(\256le)S3718(if)S3821(the)S3985(\256le)S4155(has)S4330(the)S(set-user-ID)455 4494 A4990(or)S5115(set-)S5232 V(group-ID)375 1080 A1480(modes.)S1817(The)S10 I1999(real)S10 R2186(user)S2379(ID)S2511(is)S2603(not)S2756(affected.)S5400 V1080(The)S1262(new)S1455(process)S1782(also)S1969(inherits)S2296(the)S2444(following)S2860(attributes)S3260(from)S3481(the)S(calling)274 3629 A3928(process:)S5568 V1330(process)S1657(ID)S2770(see)S10 B2924(getpid)S10 R3209(\(2\))S5688 V1330(parent)S1607(process)S1934(ID)S2770(see)S10 B2924(getppid)S10 R3265(\(2\))S5808 V1330(process)S(group)234 1657 A1916(ID)S2770(see)S10 B2924(getpgrp)S10 R3276(\(2\))S5928 V(access)258 1330 A(groups)273 1613 A2770(see)S10 B2924(getgroups)S10 R3365(\(2\))S6048 V1330(working)S1690(directory)S2770(see)S10 B2924(chdir)S10 R3170(\(2\))S6168 V1330(root)S1517(directory)S2770(see)S10 B2924(chroot)S10 R3220(\(2\))S6288 V1330(control)S1640(terminal)S2770(see)S10 B2924(tty)S10 R3058(\(4\))S6408 V1330(alarm)S1585(timer)S2770(see)S10 B2924(alarm)S10 R3197(\(2\))S6528 V1330(\256le)S1484(mode)S1732(mask)S2770(see)S10 B2924(umask)S10 R3225(\(2\))S6648 V1330(signal)S1595(mask)S2770(see)S10 B2924(sigaction)S10 R3320(\(2\),)S10 B3488(sigprocmask)S10 R4046(\(2\))S6816 V1080(When)S1345(the)S1493(executed)S1876(program)S2242(begins,)S2554(it)S2635(is)S2727(called)S2993(as)S3102(follows:)S6984 V10 B1440(int)S1583(main\(int)S10 I1978(argc)S10 B2162(,)S2212(char)S2433(*const)S10 I2732(argv)S10 B2916([],)S3034(char)S3255(*const)S10 I3554(envp)S10 B([]\);)136 3744 A7224 V1440(exit\(main\()S10 I1883(argc)S10 B2067(,)S10 I2117(argv)S10 B2301(,)S10 I2351(envp)S10 B(\)\);)102 2541 A7392 V10 R1080(where)S10 I1365(argc)S10 R1587(is)S1692(the)S1853(number)S2198(of)S2320(elements)S2716(in)S10 I2832(argv)S10 R3054(\(the)S3249(``arg)S(count''\))325 3484 A3847(and)S10 I4030(argv)S10 R4252(is)S4358(the)S4520(array)S4767(of)S4890(character)S7512 V1080(pointers)S1429(to)S1532(the)S1680(arguments)S2124(themselves.)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(22,)S(1986)200 3070 A3278(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Page: 2 2BP/slant 0 def/height 0 def480 V10 R720(EXECVE)S1127(\()S1169(2)S1227(\))S2696(Eighth)S(Edition)296 2989 A4720(EXECVE)S5127(\()S5169(2)S5227(\))S960 V10 I1080(Envp)S10 R1315(is)S1410(a)S1483(pointer)S1796(to)S1902(an)S2025(array)S2261(of)S2373(strings)S2669(that)S(constitute)391 2848 A3267(the)S10 I3418(environment)S10 R3949(of)S4061(the)S4212(process.)S4593(A)S4695(pointer)S5009(to)S5116(this)S1080 V1080(array)S1317(is)S1413(also)S1604(stored)S1879(in)S1986(the)S2138(global)S2418(variable)S2772(``environ''.)S3294(Each)S3525(string)S3783(consists)S4130(of)S4243(a)S4317(name,)S4589(an)S4713(=,)S4824(and)S4998(a)S5071(null-)S1200 V1080(terminated)S1552(value.)S1861(The)S2059(array)S2308(of)S2433(pointers)S2798(is)S2906(terminated)S3378(by)S3519(a)S3606(null)S3804(pointer.)S4181(The)S4380(shell)S10 B4612(sh)S10 R4707(\(1\))S4867(passes)S5166(an)S1320 V1080(environment)S1622(entry)S1863(for)S(each)185 2015 A2234(global)S2519(shell)S2742(variable)S3100(de\256ned)S3429(when)S3680(the)S3836(program)S4210(is)S4310(called.)S4634(See)S10 B4813(environ)S10 R5143(\(7\))S1440 V1080(for)S1223(some)S(conventionally)597 1460 A2082(used)S2291(names.)S1608 V9 R720(R)S722(RE)S784(ET)S842(TU)S900(UR)S968(RN)S1030(N)S1121(V)S1123(VA)S1191(AL)S1259(LU)S1317(UE)S1385(E)S1728 V10 R1080(If)S10 B1174(execve)S10 R1480(returns)S1786(to)S1890(the)S(calling)274 2040 A2341(process)S2670(an)S2792(error)S3016(has)S3177(occurred;)S3585(the)S3735(return)S4003(value)S(will)157 4248 A4432(be)S10 R-14554(-)S10 R4611(1)S4688(and)S4860(the)S5010(global)S1848 V1080(variable)S10 B(errno)241 1430 A10 R(will)157 1696 A1878(contain)S2199(an)S2319(error)S2541(code.)S2016 V9 R720(E)S722(ER)S780(RR)S842(RO)S904(OR)S972(RS)S1034(S)S2136 V10 B1080(Execve)S10 R(will)157 1407 A1589(fail)S1749(and)S1919(return)S2185(to)S2288(the)S(calling)274 2436 A2735(process)S3062(if)S3149(one)S3319(or)S3428(more)S3660(of)S3769(the)S3917(following)S4333(are)S4482(true:)S2304 V1080([ENOTDIR])S1830(A)S(component)446 1928 A2399(of)S2508(the)S2656(path)S2854(pre\256x)S3114(is)S3206(not)S3359(a)S3429(directory.)S2472 V([ENAMETOOLONG])916 1080 A2592 V1830(The)S2012(path)S2210(name)S(exceeds)319 2453 A2797(PATH_MAX)S3371(characters.)S2760 V1080([ENOENT])S1830(The)S2012(new)S2205(process)S2532(\256le)S2686(does)S2895(not)S3048(exist.)S2928 V1080([ELOOP])S1830(Too)S2033(many)S2297(symbolic)S2706(links)S2942(were)S(encountered)492 3180 A3713(in)S3833(translating)S4300(the)S4465(pathname.)S4948(\(Minix-)S3048 V1830(vmd\))S3216 V1080([EACCES])S1830(Search)S2130(permission)S2596(is)S2688(denied)S2981(for)S3124(a)S(component)446 3194 A3665(of)S3774(the)S3922(path)S4120(pre\256x.)S3384 V1080([EACCES])S1830(The)S2012(new)S2205(process)S2532(\256le)S2686(is)S2778(not)S2931(an)S3051(ordinary)S3417(\256le.)S3552 V1080([EACCES])S1830(The)S2012(new)S2205(process)S2532(\256le)S2686(mode)S2934(denies)S3216(execute)S3549(permission.)S3720 V1080([ENOEXEC])S1830(The)S2014(new)S2209(process)S2538(\256le)S2694(has)S2855(the)S3005(appropriate)S(access)258 3491 A3776(permission,)S4269(but)S4424(has)S4585(an)S4708(invalid)S5015(magic)S3840 V1830(number)S2162(in)S2265(its)S2385(header.)S4008 V1080([ENOMEM])S1830(The)S2012(new)S2205(process)S2532(requires)S2882(more)S3114(\(virtual\))S3470(memory)S3830(than)S4028(is)S4120(currently)S4509(available.)S4176 V1080([E2BIG])S1830(The)S2023(number)S2366(of)S2486(bytes)S2734(in)S2848(the)S3007(new)S3212(process's)S3624(argument)S4041(list)S4201(is)S4305(larger)S4578(than)S4788(the)S4948(system-)S4296 V1830(imposed)S2210(limit)S2440(ARG_MAX.)S3028(The)S3225(limit)S3455(in)S3573(the)S3736(system)S4054(as)S4177(released)S4547(is)S(4096)200 4653 A4892(bytes)S5143(for)S4416 V1830(16-bit)S2095(Minix,)S(16384)250 2390 A2665(bytes)S2902(for)S3045(32-bit)S3310(Minix,)S3605(and)S3775(unlimited)S4185(for)S4328(Minix-vmd.)S4584 V1080([EFAULT])S10 I1830(Path)S10 R2036(,)S10 I2086(argv)S10 R2286(,)S2336(or)S10 I2445(envp)S10 R2660(point)S2891(to)S2994(an)S(illegal)252 3114 A3391(address.)S4752 V1080([EIO])S1830(An)S1978(I/O)S2138(error)S2360(occurred)S2738(while)S2987(reading)S3314(from)S3535(the)S3683(\256le)S3837(system.)S4920 V9 R720(C)S722(CA)S784(AV)S852(VE)S920(EA)S978(AT)S1046(TS)S1104(S)S5040 V10 R1080(If)S1181(a)S1259(program)S1633(is)S10 I1733(setuid)S10 R2006(to)S2117(a)S(non-super-user,)629 2195 A2857(but)S3018(is)S3118(executed)S3509(when)S3760(the)S3916(real)S10 B4101(uid)S10 R4274(is)S(``root'',)323 4374 A4730(then)S4936(the)S5093(pro-)S5160 V1080(gram)S1312(has)S1471(some)S1708(of)S1817(the)S1965(powers)S2281(of)S2390(a)S2460(super-user)S2905(as)S3014(well.)S5328 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S5448 V10 B1080(exit)S10 R1237(\(2\),)S10 B1405(fork)S10 R1590(\(2\),)S10 B1758(execl)S10 R1971(\(3\),)S10 B2139(environ)S10 R2469(\(7\).)S7903 V720(September)S1176(13,)S(1996)200 1326 A2669(\()S2711(May)S2920(22,)S(1986)200 3070 A3278(\))S4990(Page)S5211(2)S8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -