home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / v22 / 096 < prev    next >
Mailbox/MIME Entity  |  1991-03-07  |  2.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From jsq@cs.utexas.edu Sat Feb 2 14:21:35 1991", ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried x-fmt/111 Plain Text File default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 6a 73 71 | 40 63 73 2e 75 74 65 78 |From jsq|@cs.utex|
|00000010| 61 73 2e 65 64 75 20 20 | 53 61 74 20 46 65 62 20 |as.edu |Sat Feb |
|00000020| 20 32 20 31 34 3a 32 31 | 3a 33 35 20 31 39 39 31 | 2 14:21|:35 1991|
|00000030| 0a 52 65 63 65 69 76 65 | 64 3a 20 66 72 6f 6d 20 |.Receive|d: from |
|00000040| 63 73 2e 75 74 65 78 61 | 73 2e 65 64 75 20 62 79 |cs.utexa|s.edu by|
|00000050| 20 75 75 6e 65 74 2e 75 | 75 2e 6e 65 74 20 28 35 | uunet.u|u.net (5|
|00000060| 2e 36 31 2f 31 2e 31 34 | 29 20 77 69 74 68 20 53 |.61/1.14|) with S|
|00000070| 4d 54 50 20 0a 09 69 64 | 20 41 41 32 35 37 37 38 |MTP ..id| AA25778|
|00000080| 3b 20 53 61 74 2c 20 32 | 20 46 65 62 20 39 31 20 |; Sat, 2| Feb 91 |
|00000090| 31 34 3a 32 31 3a 33 35 | 20 2d 30 35 30 30 0a 50 |14:21:35| -0500.P|
|000000a0| 6f 73 74 65 64 2d 44 61 | 74 65 3a 20 31 20 46 65 |osted-Da|te: 1 Fe|
|000000b0| 62 20 39 31 20 30 32 3a | 31 38 3a 32 35 20 47 4d |b 91 02:|18:25 GM|
|000000c0| 54 0a 52 65 63 65 69 76 | 65 64 3a 20 62 79 20 63 |T.Receiv|ed: by c|
|000000d0| 73 2e 75 74 65 78 61 73 | 2e 65 64 75 20 28 35 2e |s.utexas|.edu (5.|
|000000e0| 36 34 2f 31 2e 39 33 29 | 20 0a 46 72 6f 6d 3a 20 |64/1.93)| .From: |
|000000f0| 74 77 69 6e 73 75 6e 21 | 65 67 67 65 72 74 40 63 |twinsun!|eggert@c|
|00000100| 73 2e 75 74 65 78 61 73 | 2e 65 64 75 20 28 50 61 |s.utexas|.edu (Pa|
|00000110| 75 6c 20 45 67 67 65 72 | 74 29 0a 4e 65 77 73 67 |ul Egger|t).Newsg|
|00000120| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 73 74 64 2e |roups: c|omp.std.|
|00000130| 75 6e 69 78 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |unix.Sub|ject: Re|
|00000140| 3a 20 71 66 6f 72 6b 28 | 29 20 28 61 67 61 69 6e |: qfork(|) (again|
|00000150| 29 0a 4d 65 73 73 61 67 | 65 2d 49 64 3a 20 3c 31 |).Messag|e-Id: <1|
|00000160| 37 35 37 32 40 63 73 2e | 75 74 65 78 61 73 2e 65 |7572@cs.|utexas.e|
|00000170| 64 75 3e 0a 52 65 66 65 | 72 65 6e 63 65 73 3a 20 |du>.Refe|rences: |
|00000180| 3c 31 36 39 39 32 40 63 | 73 2e 75 74 65 78 61 73 |<16992@c|s.utexas|
|00000190| 2e 65 64 75 3e 20 3c 31 | 37 30 31 30 40 63 73 2e |.edu> <1|7010@cs.|
|000001a0| 75 74 65 78 61 73 2e 65 | 64 75 3e 20 3c 31 37 34 |utexas.e|du> <174|
|000001b0| 30 32 40 63 73 2e 75 74 | 65 78 61 73 2e 65 64 75 |02@cs.ut|exas.edu|
|000001c0| 3e 20 3c 31 37 35 32 37 | 40 63 73 2e 75 74 65 78 |> <17527|@cs.utex|
|000001d0| 61 73 2e 65 64 75 3e 0a | 53 65 6e 64 65 72 3a 20 |as.edu>.|Sender: |
|000001e0| 6a 73 71 40 63 73 2e 75 | 74 65 78 61 73 2e 65 64 |jsq@cs.u|texas.ed|
|000001f0| 75 0a 4f 72 67 61 6e 69 | 7a 61 74 69 6f 6e 3a 20 |u.Organi|zation: |
|00000200| 54 77 69 6e 20 53 75 6e | 2c 20 49 6e 63 0a 58 2d |Twin Sun|, Inc.X-|
|00000210| 53 75 62 6d 69 73 73 69 | 6f 6e 73 3a 20 73 74 64 |Submissi|ons: std|
|00000220| 2d 75 6e 69 78 40 75 75 | 6e 65 74 2e 75 75 2e 6e |-unix@uu|net.uu.n|
|00000230| 65 74 0a 44 61 74 65 3a | 20 31 20 46 65 62 20 39 |et.Date:| 1 Feb 9|
|00000240| 31 20 30 32 3a 31 38 3a | 32 35 20 47 4d 54 0a 52 |1 02:18:|25 GMT.R|
|00000250| 65 70 6c 79 2d 54 6f 3a | 20 73 74 64 2d 75 6e 69 |eply-To:| std-uni|
|00000260| 78 40 75 75 6e 65 74 2e | 75 75 2e 6e 65 74 0a 54 |x@uunet.|uu.net.T|
|00000270| 6f 3a 20 73 74 64 2d 75 | 6e 69 78 40 75 75 6e 65 |o: std-u|nix@uune|
|00000280| 74 2e 75 75 2e 6e 65 74 | 0a 0a 53 75 62 6d 69 74 |t.uu.net|..Submit|
|00000290| 74 65 64 2d 62 79 3a 20 | 65 67 67 65 72 74 40 74 |ted-by: |eggert@t|
|000002a0| 77 69 6e 73 75 6e 2e 75 | 75 63 70 20 28 50 61 75 |winsun.u|ucp (Pau|
|000002b0| 6c 20 45 67 67 65 72 74 | 29 0a 0a 09 2e 2e 2e 20 |l Eggert|)...... |
|000002c0| 61 6e 79 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 77 |any defi|nition w|
|000002d0| 68 69 63 68 20 69 73 20 | 73 61 66 65 20 6f 6e 20 |hich is |safe on |
|000002e0| 61 6c 6c 20 61 72 63 68 | 69 74 65 63 74 75 72 65 |all arch|itecture|
|000002f0| 73 20 69 73 20 6c 69 61 | 62 6c 65 20 74 6f 0a 09 |s is lia|ble to..|
|00000300| 63 6f 6e 73 74 72 61 69 | 6e 20 77 68 61 74 20 6f |constrai|n what o|
|00000310| 6e 65 20 6d 61 79 20 64 | 6f 20 62 65 74 77 65 65 |ne may d|o betwee|
|00000320| 6e 20 5b 71 76 5d 66 6f | 72 6b 28 29 20 61 6e 64 |n [qv]fo|rk() and|
|00000330| 20 65 78 65 63 28 29 20 | 73 6f 20 67 72 65 61 74 | exec() |so great|
|00000340| 6c 79 0a 09 74 68 61 74 | 20 69 74 20 74 75 72 6e |ly..that| it turn|
|00000350| 73 20 6f 75 74 20 74 6f | 20 62 65 20 62 65 74 74 |s out to| be bett|
|00000360| 65 72 20 74 6f 20 64 65 | 66 69 6e 65 20 61 20 63 |er to de|fine a c|
|00000370| 6f 6d 62 69 6e 65 64 20 | 73 70 61 77 6e 28 29 20 |ombined |spawn() |
|00000380| 66 75 6e 63 74 69 6f 6e | 2e 0a 0a 57 68 61 74 27 |function|...What'|
|00000390| 73 20 77 72 6f 6e 67 20 | 77 69 74 68 20 74 68 65 |s wrong |with the|
|000003a0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 64 65 66 69 6e | followi|ng defin|
|000003b0| 69 74 69 6f 6e 2c 20 77 | 68 69 63 68 20 70 65 72 |ition, w|hich per|
|000003c0| 6d 69 74 73 20 74 68 65 | 20 75 73 75 61 6c 20 61 |mits the| usual a|
|000003d0| 63 74 69 6f 6e 73 0a 62 | 65 74 77 65 65 6e 20 66 |ctions.b|etween f|
|000003e0| 6f 72 6b 28 29 20 61 6e | 64 20 65 78 65 63 28 29 |ork() an|d exec()|
|000003f0| 3f 20 20 49 73 6e 27 74 | 20 74 68 69 73 20 64 65 |? Isn't| this de|
|00000400| 66 69 6e 69 74 69 6f 6e | 20 65 61 73 79 20 74 6f |finition| easy to|
|00000410| 20 65 78 70 6c 61 69 6e | 20 61 6e 64 20 73 75 70 | explain| and sup|
|00000420| 70 6f 72 74 3f 0a 0a 09 | 76 66 6f 72 6b 28 29 20 |port?...|vfork() |
|00000430| 61 63 74 73 20 6c 69 6b | 65 20 66 6f 72 6b 28 29 |acts lik|e fork()|
|00000440| 2c 20 65 78 63 65 70 74 | 3a 0a 0a 09 31 2e 20 20 |, except|:...1. |
|00000450| 41 6e 79 20 76 61 72 69 | 61 62 6c 65 73 20 74 68 |Any vari|ables th|
|00000460| 61 74 20 61 72 65 20 63 | 6f 6d 6d 6f 6e 20 74 6f |at are c|ommon to|
|00000470| 20 62 6f 74 68 20 70 61 | 72 65 6e 74 20 61 6e 64 | both pa|rent and|
|00000480| 20 63 68 69 6c 64 2c 20 | 61 6e 64 20 61 72 65 0a | child, |and are.|
|00000490| 09 63 68 61 6e 67 65 64 | 20 62 79 20 74 68 65 20 |.changed| by the |
|000004a0| 63 68 69 6c 64 20 62 65 | 66 6f 72 65 20 69 74 20 |child be|fore it |
|000004b0| 65 78 69 74 73 20 6f 72 | 20 65 78 65 63 73 2c 20 |exits or| execs, |
|000004c0| 68 61 76 65 20 75 6e 64 | 65 66 69 6e 65 64 20 76 |have und|efined v|
|000004d0| 61 6c 75 65 73 20 69 6e | 0a 09 74 68 65 20 70 61 |alues in|..the pa|
|000004e0| 72 65 6e 74 20 77 68 65 | 6e 20 69 74 73 20 76 66 |rent whe|n its vf|
|000004f0| 6f 72 6b 28 29 20 72 65 | 74 75 72 6e 73 2e 0a 0a |ork() re|turns...|
|00000500| 09 32 2e 20 20 54 68 65 | 20 63 68 69 6c 64 20 6d |.2. The| child m|
|00000510| 61 79 20 6e 6f 74 20 63 | 61 6c 6c 20 75 6e 73 61 |ay not c|all unsa|
|00000520| 66 65 20 73 74 61 6e 64 | 61 72 64 20 66 75 6e 63 |fe stand|ard func|
|00000530| 74 69 6f 6e 73 20 28 74 | 68 65 73 65 20 61 72 65 |tions (t|hese are|
|00000540| 0a 09 6e 6f 6e 72 65 65 | 6e 74 72 61 6e 74 3b 20 |..nonree|ntrant; |
|00000550| 73 65 65 20 50 6f 73 69 | 78 20 31 30 30 33 2e 31 |see Posi|x 1003.1|
|00000560| 2d 31 39 38 38 20 73 65 | 63 74 69 6f 6e 20 33 2e |-1988 se|ction 3.|
|00000570| 33 2e 31 2e 33 28 33 29 | 28 66 29 29 2e 0a 0a 09 |3.1.3(3)|(f))....|
|00000580| 33 2e 20 20 54 68 65 20 | 63 68 69 6c 64 20 6d 61 |3. The |child ma|
|00000590| 79 20 6e 6f 74 20 72 65 | 74 75 72 6e 20 66 72 6f |y not re|turn fro|
|000005a0| 6d 20 74 68 65 20 66 75 | 6e 63 74 69 6f 6e 20 74 |m the fu|nction t|
|000005b0| 68 61 74 20 63 61 6c 6c | 65 64 20 76 66 6f 72 6b |hat call|ed vfork|
|000005c0| 28 29 2c 0a 09 65 69 74 | 68 65 72 20 65 78 70 6c |(),..eit|her expl|
|000005d0| 69 63 69 74 6c 79 20 6f | 72 20 76 69 61 20 6c 6f |icitly o|r via lo|
|000005e0| 6e 67 6a 6d 70 28 29 2e | 0a 0a 09 34 2e 20 20 54 |ngjmp().|...4. T|
|000005f0| 68 65 20 70 72 6f 67 72 | 61 6d 20 6d 75 73 74 20 |he progr|am must |
|00000600| 23 69 6e 63 6c 75 64 65 | 20 3c 76 66 6f 72 6b 2e |#include| <vfork.|
|00000610| 68 3e 2e 0a 0a 28 32 29 | 20 66 6f 6c 6c 6f 77 73 |h>...(2)| follows|
|00000620| 20 66 72 6f 6d 20 28 31 | 29 2e 20 20 28 34 29 20 | from (1|). (4) |
|00000630| 69 73 20 63 6f 6d 6d 6f | 6e 20 70 72 61 63 74 69 |is commo|n practi|
|00000640| 63 65 2c 20 61 6e 64 20 | 67 65 74 73 20 61 72 6f |ce, and |gets aro|
|00000650| 75 6e 64 20 74 68 65 20 | 65 78 6f 74 69 63 0a 61 |und the |exotic.a|
|00000660| 72 63 68 69 74 65 63 74 | 75 72 65 20 70 72 6f 62 |rchitect|ure prob|
|00000670| 6c 65 6d 2e 20 20 28 32 | 29 27 73 20 70 68 72 61 |lem. (2|)'s phra|
|00000680| 73 65 20 60 60 63 6f 6d | 6d 6f 6e 20 74 6f 20 62 |se ``com|mon to b|
|00000690| 6f 74 68 20 70 61 72 65 | 6e 74 20 61 6e 64 20 63 |oth pare|nt and c|
|000006a0| 68 69 6c 64 27 27 20 6c | 65 74 73 0a 74 68 65 20 |hild'' l|ets.the |
|000006b0| 63 68 69 6c 64 20 63 61 | 6c 6c 20 72 65 65 6e 74 |child ca|ll reent|
|000006c0| 72 61 6e 74 20 66 75 6e | 63 74 69 6f 6e 73 2c 20 |rant fun|ctions, |
|000006d0| 62 65 63 61 75 73 65 20 | 74 68 65 69 72 20 61 75 |because |their au|
|000006e0| 74 6f 6d 61 74 69 63 20 | 76 61 72 69 61 62 6c 65 |tomatic |variable|
|000006f0| 73 20 64 6f 20 6e 6f 74 | 0a 65 78 69 73 74 20 69 |s do not|.exist i|
|00000700| 6e 20 74 68 65 20 70 61 | 72 65 6e 74 2e 0a 0a 49 |n the pa|rent...I|
|00000710| 20 64 6f 6e 27 74 20 6d | 75 63 68 20 6c 69 6b 65 | don't m|uch like|
|00000720| 20 76 66 6f 72 6b 28 29 | 2c 20 62 75 74 20 69 74 | vfork()|, but it|
|00000730| 27 73 20 63 6f 6d 6d 6f | 6e 20 70 72 61 63 74 69 |'s commo|n practi|
|00000740| 63 65 2c 20 69 74 20 69 | 73 20 6d 75 63 68 20 66 |ce, it i|s much f|
|00000750| 61 73 74 65 72 20 6f 6e | 20 6d 61 6e 79 0a 68 6f |aster on| many.ho|
|00000760| 73 74 73 2c 20 61 6e 64 | 20 6d 61 6e 79 20 77 69 |sts, and| many wi|
|00000770| 64 65 6c 79 20 64 69 73 | 74 72 69 62 75 74 65 64 |dely dis|tributed|
|00000780| 20 55 6e 69 78 20 70 72 | 6f 67 72 61 6d 73 20 75 | Unix pr|ograms u|
|00000790| 73 65 20 69 74 2e 20 20 | 42 79 20 61 6c 6c 20 6d |se it. |By all m|
|000007a0| 65 61 6e 73 2c 20 6c 65 | 74 27 73 0a 69 6e 76 65 |eans, le|t's.inve|
|000007b0| 6e 74 20 6f 74 68 65 72 | 20 70 72 69 6d 69 74 69 |nt other| primiti|
|000007c0| 76 65 73 20 69 66 20 74 | 68 65 79 27 72 65 20 6e |ves if t|hey're n|
|000007d0| 65 65 64 65 64 2c 20 62 | 75 74 20 77 68 79 20 6e |eeded, b|ut why n|
|000007e0| 6f 74 20 66 69 72 73 74 | 20 73 74 61 6e 64 61 72 |ot first| standar|
|000007f0| 64 69 7a 65 20 74 68 65 | 0a 70 72 69 6d 69 74 69 |dize the|.primiti|
|00000800| 76 65 73 20 77 65 20 61 | 6c 72 65 61 64 79 20 68 |ves we a|lready h|
|00000810| 61 76 65 3f 0a 0a 56 6f | 6c 75 6d 65 2d 4e 75 6d |ave?..Vo|lume-Num|
|00000820| 62 65 72 3a 20 56 6f 6c | 75 6d 65 20 32 32 2c 20 |ber: Vol|ume 22, |
|00000830| 4e 75 6d 62 65 72 20 39 | 36 0a 0a |Number 9|6.. |
+--------+-------------------------+-------------------------+--------+--------+