|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: s
Length: 7601 (0x1db1)
Names: »socket.2«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./bsd/usr/man/cat2/socket.2«
└─⟦this⟧ »./usr/man/cat2/socket.2«
0x0000…0020 0a 0a 0a 5f 08 4f 5f 08 6e 5f 08 6c 5f 08 69 5f 08 6e 5f 08 65 20 5f 08 4d 5f 08 61 5f 08 6e 5f ┆ _ O_ n_ l_ i_ n_ e _ M_ a_ n_┆ 0x0020…0040 08 75 5f 08 61 5f 08 6c 20 20 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 20 43 61 6c 6c ┆ u_ a_ l System Call┆ 0x0040…0060 73 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 6f 63 6b 65 74 28 32 29 0a 0a 0a 0a ┆s socket(2) ┆ 0x0060…0080 4e 08 4e 08 4e 08 4e 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 45 08 45 08 45 08 45 0a 20 20 20 ┆N N N NA A A AM M M ME E E E ┆ 0x0080…00a0 20 20 73 6f 63 6b 65 74 20 2d 20 63 72 65 61 74 65 20 61 6e 20 65 6e 64 70 6f 69 6e 74 20 66 6f ┆ socket - create an endpoint fo┆ 0x00a0…00c0 72 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 0a 0a 53 08 53 08 53 08 53 59 08 59 08 59 08 59 4e ┆r communication S S S SY Y Y YN┆ 0x00c0…00e0 08 4e 08 4e 08 4e 54 08 54 08 54 08 54 41 08 41 08 41 08 41 58 08 58 08 58 08 58 0a 20 20 20 20 ┆ N N NT T T TA A A AX X X X ┆ 0x00e0…0100 20 23 08 23 08 23 08 23 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 63 08 63 08 63 08 63 6c 08 6c ┆ # # # #i i i in n n nc c c cl l┆ 0x0100…0120 08 6c 08 6c 75 08 75 08 75 08 75 64 08 64 08 64 08 64 65 08 65 08 65 08 65 20 3c 08 3c 08 3c 08 ┆ l lu u u ud d d de e e e < < < ┆ 0x0120…0140 3c 73 08 73 08 73 08 73 79 08 79 08 79 08 79 73 08 73 08 73 08 73 2f 08 2f 08 2f 08 2f 74 08 74 ┆<s s s sy y y ys s s s/ / / /t t┆ 0x0140…0160 08 74 08 74 79 08 79 08 79 08 79 70 08 70 08 70 08 70 65 08 65 08 65 08 65 73 08 73 08 73 08 73 ┆ t ty y y yp p p pe e e es s s s┆ 0x0160…0180 2e 08 2e 08 2e 08 2e 68 08 68 08 68 08 68 3e 08 3e 08 3e 08 3e 0a 20 20 20 20 20 23 08 23 08 23 ┆. . . .h h h h> > > > # # #┆ 0x0180…01a0 08 23 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 63 08 63 08 63 08 63 6c 08 6c 08 6c 08 6c 75 08 ┆ #i i i in n n nc c c cl l l lu ┆ 0x01a0…01c0 75 08 75 08 75 64 08 64 08 64 08 64 65 08 65 08 65 08 65 20 3c 08 3c 08 3c 08 3c 73 08 73 08 73 ┆u u ud d d de e e e < < < <s s s┆ 0x01c0…01e0 08 73 79 08 79 08 79 08 79 73 08 73 08 73 08 73 2f 08 2f 08 2f 08 2f 73 08 73 08 73 08 73 6f 08 ┆ sy y y ys s s s/ / / /s s s so ┆ 0x01e0…0200 6f 08 6f 08 6f 63 08 63 08 63 08 63 6b 08 6b 08 6b 08 6b 65 08 65 08 65 08 65 74 08 74 08 74 08 ┆o o oc c c ck k k ke e e et t t ┆ 0x0200…0220 74 2e 08 2e 08 2e 08 2e 68 08 68 08 68 08 68 3e 08 3e 08 3e 08 3e 0a 0a 20 20 20 20 20 73 08 73 ┆t. . . .h h h h> > > > s s┆ 0x0220…0240 08 73 08 73 20 3d 08 3d 08 3d 08 3d 20 73 08 73 08 73 08 73 6f 08 6f 08 6f 08 6f 63 08 63 08 63 ┆ s s = = = = s s s so o o oc c c┆ 0x0240…0260 08 63 6b 08 6b 08 6b 08 6b 65 08 65 08 65 08 65 74 08 74 08 74 08 74 28 08 28 08 28 08 28 64 08 ┆ ck k k ke e e et t t t( ( ( (d ┆ 0x0260…0280 64 08 64 08 64 6f 08 6f 08 6f 08 6f 6d 08 6d 08 6d 08 6d 61 08 61 08 61 08 61 69 08 69 08 69 08 ┆d d do o o om m m ma a a ai i i ┆ 0x0280…02a0 69 6e 08 6e 08 6e 08 6e 2c 08 2c 08 2c 08 2c 20 74 08 74 08 74 08 74 79 08 79 08 79 08 79 70 08 ┆in n n n, , , , t t t ty y y yp ┆ 0x02a0…02c0 70 08 70 08 70 65 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 70 08 70 08 70 08 70 72 08 72 08 72 ┆p p pe e e e, , , , p p p pr r r┆ 0x02c0…02e0 08 72 6f 08 6f 08 6f 08 6f 74 08 74 08 74 08 74 6f 08 6f 08 6f 08 6f 63 08 63 08 63 08 63 6f 08 ┆ ro o o ot t t to o o oc c c co ┆ 0x02e0…0300 6f 08 6f 08 6f 6c 08 6c 08 6c 08 6c 29 08 29 08 29 08 29 0a 20 20 20 20 20 69 08 69 08 69 08 69 ┆o o ol l l l) ) ) ) i i i i┆ 0x0300…0320 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 73 08 73 08 73 08 73 2c 08 2c 08 2c 08 2c 20 64 08 ┆n n n nt t t t s s s s, , , , d ┆ 0x0320…0340 64 08 64 08 64 6f 08 6f 08 6f 08 6f 6d 08 6d 08 6d 08 6d 61 08 61 08 61 08 61 69 08 69 08 69 08 ┆d d do o o om m m ma a a ai i i ┆ 0x0340…0360 69 6e 08 6e 08 6e 08 6e 2c 08 2c 08 2c 08 2c 20 74 08 74 08 74 08 74 79 08 79 08 79 08 79 70 08 ┆in n n n, , , , t t t ty y y yp ┆ 0x0360…0380 70 08 70 08 70 65 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 70 08 70 08 70 08 70 72 08 72 08 72 ┆p p pe e e e, , , , p p p pr r r┆ 0x0380…03a0 08 72 6f 08 6f 08 6f 08 6f 74 08 74 08 74 08 74 6f 08 6f 08 6f 08 6f 63 08 63 08 63 08 63 6f 08 ┆ ro o o ot t t to o o oc c c co ┆ 0x03a0…03c0 6f 08 6f 08 6f 6c 08 6c 08 6c 08 6c 3b 08 3b 08 3b 08 3b 0a 0a 44 08 44 08 44 08 44 45 08 45 08 ┆o o ol l l l; ; ; ; D D D DE E ┆ 0x03c0…03e0 45 08 45 53 08 53 08 53 08 53 43 08 43 08 43 08 43 52 08 52 08 52 08 52 49 08 49 08 49 08 49 50 ┆E ES S S SC C C CR R R RI I I IP┆ 0x03e0…0400 08 50 08 50 08 50 54 08 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08 4e ┆ P P PT T T TI I I IO O O ON N N┆ 0x0400…0420 08 4e 0a 20 20 20 20 20 54 68 69 73 20 63 61 6c 6c 20 63 72 65 61 74 65 73 20 61 6e 20 65 6e 64 ┆ N This call creates an end┆ 0x0420…0440 70 6f 69 6e 74 20 28 66 6f 72 20 34 2e 33 42 53 44 20 55 4e 49 58 20 49 50 43 29 20 61 6e 64 0a ┆point (for 4.3BSD UNIX IPC) and ┆ 0x0440…0460 20 20 20 20 20 72 65 74 75 72 6e 73 20 61 20 64 65 73 63 72 69 70 74 6f 72 2e 20 20 54 68 69 73 ┆ returns a descriptor. This┆ 0x0460…0480 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 6d 65 74 68 6f 64 20 69 73 20 61 76 61 69 6c 2d 0a ┆ communication method is avail- ┆ 0x0480…04a0 20 20 20 20 20 61 62 6c 65 20 69 6e 20 61 64 64 69 74 69 6f 6e 20 74 6f 20 54 58 20 49 50 43 2e ┆ able in addition to TX IPC.┆ 0x04a0…04c0 20 20 54 68 65 20 66 75 6c 6c 20 54 58 20 74 72 61 6e 73 61 63 74 69 6f 6e 0a 20 20 20 20 20 66 ┆ The full TX transaction f┆ 0x04c0…04e0 65 61 74 75 72 65 73 20 61 72 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65 64 20 66 6f 72 20 74 68 ┆eatures are not supported for th┆ 0x04e0…0500 65 20 5f 08 73 5f 08 6f 5f 08 63 5f 08 6b 5f 08 65 5f 08 74 20 49 50 43 20 6d 65 63 68 61 6e 69 ┆e _ s_ o_ c_ k_ e_ t IPC mechani┆ 0x0500…0520 73 6d 2e 0a 20 20 20 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 64 65 61 64 6c 6f 63 6b 20 61 ┆sm. For example, deadlock a┆ 0x0520…0540 76 6f 69 64 61 6e 63 65 2f 64 65 74 65 63 74 69 6f 6e 20 69 73 20 61 20 75 73 65 72 20 72 65 73 ┆voidance/detection is a user res┆ 0x0540…0560 70 6f 6e 2d 0a 20 20 20 20 20 73 69 62 69 6c 69 74 79 2e 0a 0a 20 20 20 20 20 54 68 65 20 5f 08 ┆pon- sibility. The _ ┆ 0x0560…0580 64 5f 08 6f 5f 08 6d 5f 08 61 5f 08 69 5f 08 6e 20 70 61 72 61 6d 65 74 65 72 20 73 70 65 63 69 ┆d_ o_ m_ a_ i_ n parameter speci┆ 0x0580…05a0 66 69 65 73 20 61 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 73 20 64 6f 6d 61 69 6e 0a 20 20 20 ┆fies a communications domain ┆ 0x05a0…05c0 20 20 77 69 74 68 69 6e 20 77 68 69 63 68 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 77 69 6c ┆ within which communication wil┆ 0x05c0…05e0 6c 20 74 61 6b 65 20 70 6c 61 63 65 3b 20 74 68 69 73 20 73 65 6c 65 63 74 73 20 74 68 65 0a 20 ┆l take place; this selects the ┆ 0x05e0…0600 20 20 20 20 70 72 6f 74 6f 63 6f 6c 20 66 61 6d 69 6c 79 20 77 68 69 63 68 20 73 68 6f 75 6c 64 ┆ protocol family which should┆ 0x0600…0620 20 62 65 20 75 73 65 64 2e 20 20 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 66 61 6d 69 6c 79 0a 20 ┆ be used. The protocol family ┆ 0x0620…0640 20 20 20 20 67 65 6e 65 72 61 6c 6c 79 20 69 73 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 65 ┆ generally is the same as the┆ 0x0640…0660 20 61 64 64 72 65 73 73 20 66 61 6d 69 6c 79 20 66 6f 72 20 74 68 65 0a 20 20 20 20 20 61 64 64 ┆ address family for the add┆ 0x0660…0680 72 65 73 73 65 73 20 73 75 70 70 6c 69 65 64 20 69 6e 20 6c 61 74 65 72 20 6f 70 65 72 61 74 69 ┆resses supplied in later operati┆ 0x0680…06a0 6f 6e 73 20 6f 6e 20 74 68 65 20 73 6f 63 6b 65 74 2e 20 20 54 68 65 73 65 0a 20 20 20 20 20 66 ┆ons on the socket. These f┆ 0x06a0…06c0 61 6d 69 6c 69 65 73 20 61 72 65 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 65 20 69 6e 63 6c 75 ┆amilies are defined in the inclu┆ 0x06c0…06e0 64 65 20 66 69 6c 65 20 3c 73 79 73 2f 73 6f 63 6b 65 74 2e 68 3e 2e 0a 20 20 20 20 20 54 68 65 ┆de file <sys/socket.h>. The┆ 0x06e0…0700 20 63 75 72 72 65 6e 74 6c 79 20 75 6e 64 65 72 73 74 6f 6f 64 20 66 6f 72 6d 61 74 73 20 61 72 ┆ currently understood formats ar┆ 0x0700…0720 65 0a 0a 20 20 20 20 20 20 20 20 20 20 50 46 5f 55 4e 49 58 20 20 20 20 20 28 55 4e 49 58 20 69 ┆e PF_UNIX (UNIX i┆ 0x0720…0740 6e 74 65 72 6e 61 6c 20 70 72 6f 74 6f 63 6f 6c 73 29 2c 0a 20 20 20 20 20 20 20 20 20 20 50 46 ┆nternal protocols), PF┆ 0x0740…0760 5f 49 4e 45 54 20 20 20 20 20 28 41 52 50 41 20 49 6e 74 65 72 6e 65 74 20 70 72 6f 74 6f 63 6f ┆_INET (ARPA Internet protoco┆ 0x0760…0780 6c 73 29 2c 0a 20 20 20 20 20 20 20 20 20 20 50 46 5f 4e 53 20 20 20 20 20 20 20 28 58 65 72 6f ┆ls), PF_NS (Xero┆ 0x0780…07a0 78 20 4e 65 74 77 6f 72 6b 20 53 79 73 74 65 6d 73 20 70 72 6f 74 6f 63 6f 6c 73 29 2c 20 61 6e ┆x Network Systems protocols), an┆ 0x07a0…07c0 64 0a 0a 20 20 20 20 20 54 68 65 20 73 6f 63 6b 65 74 20 68 61 73 20 74 68 65 20 69 6e 64 69 63 ┆d The socket has the indic┆ 0x07c0…07e0 61 74 65 64 20 5f 08 74 5f 08 79 5f 08 70 5f 08 65 2c 20 77 68 69 63 68 20 73 70 65 63 69 66 69 ┆ated _ t_ y_ p_ e, which specifi┆ 0x07e0…0800 65 73 20 74 68 65 0a 20 20 20 20 20 73 65 6d 61 6e 74 69 63 73 20 6f 66 20 63 6f 6d 6d 75 6e 69 ┆es the semantics of communi┆ 0x0800…0820 63 61 74 69 6f 6e 2e 20 20 43 75 72 72 65 6e 74 6c 79 20 64 65 66 69 6e 65 64 20 74 79 70 65 73 ┆cation. Currently defined types┆ 0x0820…0840 20 61 72 65 3a 0a 0a 20 20 20 20 20 20 20 20 20 20 53 4f 43 4b 5f 53 54 52 45 41 4d 0a 20 20 20 ┆ are: SOCK_STREAM ┆ 0x0840…0860 20 20 20 20 20 20 20 53 4f 43 4b 5f 44 47 52 41 4d 0a 20 20 20 20 20 20 20 20 20 20 53 4f 43 4b ┆ SOCK_DGRAM SOCK┆ 0x0860…0880 5f 52 41 57 0a 20 20 20 20 20 20 20 20 20 20 53 4f 43 4b 5f 53 45 51 50 41 43 4b 45 54 0a 20 20 ┆_RAW SOCK_SEQPACKET ┆ 0x0880…08a0 20 20 20 20 20 20 20 20 53 4f 43 4b 5f 52 44 4d 0a 0a 20 20 20 20 20 41 20 53 4f 43 4b 5f 53 54 ┆ SOCK_RDM A SOCK_ST┆ 0x08a0…08c0 52 45 41 4d 20 74 79 70 65 20 70 72 6f 76 69 64 65 73 20 73 65 71 75 65 6e 63 65 64 2c 20 72 65 ┆REAM type provides sequenced, re┆ 0x08c0…08e0 6c 69 61 62 6c 65 2c 20 74 77 6f 2d 77 61 79 0a 20 20 20 20 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 ┆liable, two-way connection ┆ 0x08e0…0900 62 61 73 65 64 20 62 79 74 65 20 73 74 72 65 61 6d 73 2e 20 20 41 6e 20 6f 75 74 2d 6f 66 2d 62 ┆based byte streams. An out-of-b┆ 0x0900…0920 61 6e 64 20 64 61 74 61 0a 20 20 20 20 20 74 72 61 6e 73 6d 69 73 73 69 6f 6e 20 6d 65 63 68 61 ┆and data transmission mecha┆ 0x0920…0940 6e 69 73 6d 20 6d 61 79 20 62 65 20 73 75 70 70 6f 72 74 65 64 2e 20 20 41 20 53 4f 43 4b 5f 44 ┆nism may be supported. A SOCK_D┆ 0x0940…0960 47 52 41 4d 0a 20 20 20 20 20 73 6f 63 6b 65 74 20 73 75 70 70 6f 72 74 73 20 64 61 74 61 67 72 ┆GRAM socket supports datagr┆ 0x0960…0980 61 6d 73 20 28 63 6f 6e 6e 65 63 74 69 6f 6e 6c 65 73 73 2c 20 75 6e 72 65 6c 69 61 62 6c 65 20 ┆ams (connectionless, unreliable ┆ 0x0980…09a0 6d 65 73 2d 0a 20 20 20 20 20 73 61 67 65 73 20 6f 66 20 61 20 66 69 78 65 64 20 28 74 79 70 69 ┆mes- sages of a fixed (typi┆ 0x09a0…09c0 63 61 6c 6c 79 20 73 6d 61 6c 6c 29 20 6d 61 78 69 6d 75 6d 20 6c 65 6e 67 74 68 29 2e 20 20 41 ┆cally small) maximum length). A┆ 0x09c0…09e0 0a 20 20 20 20 20 53 4f 43 4b 5f 53 45 51 50 41 43 4b 45 54 20 73 6f 63 6b 65 74 20 6d 61 79 20 ┆ SOCK_SEQPACKET socket may ┆ 0x09e0…0a00 70 72 6f 76 69 64 65 20 61 20 73 65 71 75 65 6e 63 65 64 2c 20 72 65 6c 69 61 62 6c 65 2c 0a 20 ┆provide a sequenced, reliable, ┆ 0x0a00…0a20 20 20 20 20 74 77 6f 2d 77 61 79 20 63 6f 6e 6e 65 63 74 69 6f 6e 2d 62 61 73 65 64 20 64 61 74 ┆ two-way connection-based dat┆ 0x0a20…0a40 61 20 74 72 61 6e 73 6d 69 73 73 69 6f 6e 20 70 61 74 68 20 66 6f 72 0a 20 20 20 20 20 64 61 74 ┆a transmission path for dat┆ 0x0a40…0a60 61 67 72 61 6d 73 20 6f 66 20 66 69 78 65 64 20 6d 61 78 69 6d 75 6d 20 6c 65 6e 67 74 68 3b 20 ┆agrams of fixed maximum length; ┆ 0x0a60…0a80 61 20 63 6f 6e 73 75 6d 65 72 20 6d 61 79 20 62 65 0a 20 20 20 20 20 72 65 71 75 69 72 65 64 20 ┆a consumer may be required ┆ 0x0a80…0aa0 74 6f 20 72 65 61 64 20 61 6e 20 65 6e 74 69 72 65 20 70 61 63 6b 65 74 20 77 69 74 68 20 65 61 ┆to read an entire packet with ea┆ 0x0aa0…0ac0 63 68 20 72 65 61 64 20 73 79 73 74 65 6d 0a 20 20 20 20 20 63 61 6c 6c 2e 20 20 54 68 69 73 20 ┆ch read system call. This ┆ 0x0ac0…0ae0 66 61 63 69 6c 69 74 79 20 69 73 20 70 72 6f 74 6f 63 6f 6c 20 73 70 65 63 69 66 69 63 2c 20 61 ┆facility is protocol specific, a┆ 0x0ae0…0b00 6e 64 20 70 72 65 73 65 6e 74 6c 79 0a 20 20 20 20 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 6f 6e ┆nd presently implemented on┆ 0x0b00…0b20 6c 79 20 66 6f 72 20 50 46 5f 4e 53 2e 20 20 53 4f 43 4b 5f 52 41 57 20 73 6f 63 6b 65 74 73 20 ┆ly for PF_NS. SOCK_RAW sockets ┆ 0x0b20…0b40 70 72 6f 76 69 64 65 20 61 63 63 65 73 73 0a 20 20 20 20 20 74 6f 20 69 6e 74 65 72 6e 61 6c 20 ┆provide access to internal ┆ 0x0b40…0b60 6e 65 74 77 6f 72 6b 20 70 72 6f 74 6f 63 6f 6c 73 20 61 6e 64 20 69 6e 74 65 72 66 61 63 65 73 ┆network protocols and interfaces┆ 0x0b60…0b80 2e 20 20 54 68 65 20 74 79 70 65 73 0a 20 20 20 20 20 53 4f 43 4b 5f 52 41 57 2c 20 77 68 69 63 ┆. The types SOCK_RAW, whic┆ 0x0b80…0ba0 68 20 69 73 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 6c 79 20 74 6f 20 74 68 65 20 73 75 70 65 72 ┆h is available only to the super┆ 0x0ba0…0bc0 2d 75 73 65 72 2c 20 61 6e 64 0a 20 20 20 20 20 53 4f 43 4b 5f 52 44 4d 2c 20 77 68 69 63 68 20 ┆-user, and SOCK_RDM, which ┆ 0x0bc0…0be0 69 73 20 70 6c 61 6e 6e 65 64 2c 20 62 75 74 20 6e 6f 74 20 79 65 74 20 69 6d 70 6c 65 6d 65 6e ┆is planned, but not yet implemen┆ 0x0be0…0c00 74 65 64 2c 20 61 72 65 20 6e 6f 74 0a 20 20 20 20 20 64 65 73 63 72 69 62 65 64 20 68 65 72 65 ┆ted, are not described here┆ 0x0c00…0c20 2e 0a 0a 20 20 20 20 20 54 68 65 20 5f 08 70 5f 08 72 5f 08 6f 5f 08 74 5f 08 6f 5f 08 63 5f 08 ┆. The _ p_ r_ o_ t_ o_ c_ ┆ 0x0c20…0c40 6f 5f 08 6c 20 73 70 65 63 69 66 69 65 73 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 70 72 6f 74 ┆o_ l specifies a particular prot┆ 0x0c40…0c60 6f 63 6f 6c 20 74 6f 20 62 65 20 75 73 65 64 20 77 69 74 68 0a 20 20 20 20 20 74 68 65 20 73 6f ┆ocol to be used with the so┆ 0x0c60…0c80 63 6b 65 74 2e 20 20 4e 6f 72 6d 61 6c 6c 79 20 6f 6e 6c 79 20 61 20 73 69 6e 67 6c 65 20 70 72 ┆cket. Normally only a single pr┆ 0x0c80…0ca0 6f 74 6f 63 6f 6c 20 65 78 69 73 74 73 20 74 6f 20 73 75 70 2d 0a 20 20 20 20 20 70 6f 72 74 20 ┆otocol exists to sup- port ┆ 0x0ca0…0cc0 61 20 70 61 72 74 69 63 75 6c 61 72 20 73 6f 63 6b 65 74 20 74 79 70 65 20 77 69 74 68 69 6e 20 ┆a particular socket type within ┆ 0x0cc0…0ce0 61 20 67 69 76 65 6e 20 70 72 6f 74 6f 63 6f 6c 20 66 61 6d 2d 0a 20 20 20 20 20 69 6c 79 2e 20 ┆a given protocol fam- ily. ┆ 0x0ce0…0d00 20 48 6f 77 65 76 65 72 2c 20 69 74 20 69 73 20 70 6f 73 73 69 62 6c 65 20 74 68 61 74 20 6d 61 ┆ However, it is possible that ma┆ 0x0d00…0d20 6e 79 20 70 72 6f 74 6f 63 6f 6c 73 20 6d 61 79 20 65 78 69 73 74 2c 0a 0a 0a 0a 0a 0a 0a 20 20 ┆ny protocols may exist, ┆ 0x0d20…0d40 20 20 20 69 6e 20 77 68 69 63 68 20 63 61 73 65 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 70 72 ┆ in which case a particular pr┆ 0x0d40…0d60 6f 74 6f 63 6f 6c 20 6d 75 73 74 20 62 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 0a 20 20 20 20 ┆otocol must be specified in ┆ 0x0d60…0d80 20 74 68 69 73 20 6d 61 6e 6e 65 72 2e 20 20 54 68 65 20 70 72 6f 74 6f 63 6f 6c 20 6e 75 6d 62 ┆ this manner. The protocol numb┆ 0x0d80…0da0 65 72 20 74 6f 20 75 73 65 20 69 73 20 70 61 72 74 69 63 75 6c 61 72 20 74 6f 0a 20 20 20 20 20 ┆er to use is particular to ┆ 0x0da0…0dc0 74 68 65 20 22 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 64 6f 6d 61 69 6e 22 20 69 6e 20 77 68 ┆the "communication domain" in wh┆ 0x0dc0…0de0 69 63 68 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 69 73 20 74 6f 20 74 61 6b 65 0a 20 20 20 ┆ich communication is to take ┆ 0x0de0…0e00 20 20 70 6c 61 63 65 3b 20 73 65 65 20 5f 08 70 5f 08 72 5f 08 6f 5f 08 74 5f 08 6f 5f 08 63 5f ┆ place; see _ p_ r_ o_ t_ o_ c_┆ 0x0e00…0e20 08 6f 5f 08 6c 5f 08 73 28 33 6e 29 2e 0a 0a 20 20 20 20 20 53 6f 63 6b 65 74 73 20 6f 66 20 74 ┆ o_ l_ s(3n). Sockets of t┆ 0x0e20…0e40 79 70 65 20 53 4f 43 4b 5f 53 54 52 45 41 4d 20 61 72 65 20 66 75 6c 6c 2d 64 75 70 6c 65 78 20 ┆ype SOCK_STREAM are full-duplex ┆ 0x0e40…0e60 62 79 74 65 20 73 74 72 65 61 6d 73 2c 0a 20 20 20 20 20 73 69 6d 69 6c 61 72 20 74 6f 20 70 69 ┆byte streams, similar to pi┆ 0x0e60…0e80 70 65 73 2e 20 20 41 20 73 74 72 65 61 6d 20 73 6f 63 6b 65 74 20 6d 75 73 74 20 62 65 20 69 6e ┆pes. A stream socket must be in┆ 0x0e80…0ea0 20 61 20 5f 08 63 5f 08 6f 5f 08 6e 5f 08 6e 5f 08 65 5f 08 63 5f 08 74 5f 08 65 5f 08 64 0a 20 ┆ a _ c_ o_ n_ n_ e_ c_ t_ e_ d ┆ 0x0ea0…0ec0 20 20 20 20 73 74 61 74 65 20 62 65 66 6f 72 65 20 61 6e 79 20 64 61 74 61 20 6d 61 79 20 62 65 ┆ state before any data may be┆ 0x0ec0…0ee0 20 73 65 6e 74 20 6f 72 20 72 65 63 65 69 76 65 64 20 6f 6e 20 69 74 2e 20 20 41 20 63 6f 6e 2d ┆ sent or received on it. A con-┆ 0x0ee0…0f00 0a 20 20 20 20 20 6e 65 63 74 69 6f 6e 20 74 6f 20 61 6e 6f 74 68 65 72 20 73 6f 63 6b 65 74 20 ┆ nection to another socket ┆ 0x0f00…0f20 69 73 20 63 72 65 61 74 65 64 20 77 69 74 68 20 61 20 5f 08 63 5f 08 6f 5f 08 6e 5f 08 6e 5f 08 ┆is created with a _ c_ o_ n_ n_ ┆ 0x0f20…0f40 65 5f 08 63 5f 08 74 20 63 61 6c 6c 2e 0a 20 20 20 20 20 4f 6e 63 65 20 63 6f 6e 6e 65 63 74 65 ┆e_ c_ t call. Once connecte┆ 0x0f40…0f60 64 2c 20 64 61 74 61 20 6d 61 79 20 62 65 20 74 72 61 6e 73 66 65 72 72 65 64 20 75 73 69 6e 67 ┆d, data may be transferred using┆ 0x0f60…0f80 20 5f 08 72 5f 08 65 5f 08 61 5f 08 64 20 61 6e 64 20 5f 08 77 5f 08 72 5f 08 69 5f 08 74 5f 08 ┆ _ r_ e_ a_ d and _ w_ r_ i_ t_ ┆ 0x0f80…0fa0 65 0a 20 20 20 20 20 63 61 6c 6c 73 20 6f 72 20 73 6f 6d 65 20 76 61 72 69 61 6e 74 20 6f 66 20 ┆e calls or some variant of ┆ 0x0fa0…0fc0 74 68 65 20 5f 08 73 5f 08 65 5f 08 6e 5f 08 64 20 61 6e 64 20 5f 08 72 5f 08 65 5f 08 63 5f 08 ┆the _ s_ e_ n_ d and _ r_ e_ c_ ┆ 0x0fc0…0fe0 76 20 63 61 6c 6c 73 2e 20 20 57 68 65 6e 20 61 0a 20 20 20 20 20 73 65 73 73 69 6f 6e 20 68 61 ┆v calls. When a session ha┆ 0x0fe0…1000 73 20 62 65 65 6e 20 63 6f 6d 70 6c 65 74 65 64 20 61 20 5f 08 63 5f 08 6c 5f 08 6f 5f 08 73 5f ┆s been completed a _ c_ l_ o_ s_┆ 0x1000…1020 08 65 20 6d 61 79 20 62 65 20 70 65 72 66 6f 72 6d 65 64 2e 20 20 4f 75 74 2d 0a 20 20 20 20 20 ┆ e may be performed. Out- ┆ 0x1020…1040 6f 66 2d 62 61 6e 64 20 64 61 74 61 20 6d 61 79 20 61 6c 73 6f 20 62 65 20 74 72 61 6e 73 6d 69 ┆of-band data may also be transmi┆ 0x1040…1060 74 74 65 64 20 61 73 20 64 65 73 63 72 69 62 65 64 20 69 6e 20 5f 08 73 5f 08 65 5f 08 6e 5f 08 ┆tted as described in _ s_ e_ n_ ┆ 0x1060…1080 64 0a 20 20 20 20 20 61 6e 64 20 72 65 63 65 69 76 65 64 20 61 73 20 64 65 73 63 72 69 62 65 64 ┆d and received as described┆ 0x1080…10a0 20 69 6e 20 5f 08 72 5f 08 65 5f 08 63 5f 08 76 2e 0a 0a 20 20 20 20 20 54 68 65 20 63 6f 6d 6d ┆ in _ r_ e_ c_ v. The comm┆ 0x10a0…10c0 75 6e 69 63 61 74 69 6f 6e 73 20 70 72 6f 74 6f 63 6f 6c 73 20 75 73 65 64 20 74 6f 20 69 6d 70 ┆unications protocols used to imp┆ 0x10c0…10e0 6c 65 6d 65 6e 74 20 61 20 53 4f 43 4b 5f 53 54 52 45 41 4d 0a 20 20 20 20 20 69 6e 73 75 72 65 ┆lement a SOCK_STREAM insure┆ 0x10e0…1100 20 74 68 61 74 20 64 61 74 61 20 69 73 20 6e 6f 74 20 6c 6f 73 74 20 6f 72 20 64 75 70 6c 69 63 ┆ that data is not lost or duplic┆ 0x1100…1120 61 74 65 64 2e 20 20 49 66 20 61 20 70 69 65 63 65 20 6f 66 0a 20 20 20 20 20 64 61 74 61 20 66 ┆ated. If a piece of data f┆ 0x1120…1140 6f 72 20 77 68 69 63 68 20 74 68 65 20 70 65 65 72 20 70 72 6f 74 6f 63 6f 6c 20 68 61 73 20 62 ┆or which the peer protocol has b┆ 0x1140…1160 75 66 66 65 72 20 73 70 61 63 65 20 63 61 6e 6e 6f 74 20 62 65 0a 20 20 20 20 20 73 75 63 63 65 ┆uffer space cannot be succe┆ 0x1160…1180 73 73 66 75 6c 6c 79 20 74 72 61 6e 73 6d 69 74 74 65 64 20 77 69 74 68 69 6e 20 61 20 72 65 61 ┆ssfully transmitted within a rea┆ 0x1180…11a0 73 6f 6e 61 62 6c 65 20 6c 65 6e 67 74 68 20 6f 66 20 74 69 6d 65 2c 0a 20 20 20 20 20 74 68 65 ┆sonable length of time, the┆ 0x11a0…11c0 6e 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 62 ┆n the connection is considered b┆ 0x11c0…11e0 72 6f 6b 65 6e 20 61 6e 64 20 63 61 6c 6c 73 20 77 69 6c 6c 0a 20 20 20 20 20 69 6e 64 69 63 61 ┆roken and calls will indica┆ 0x11e0…1200 74 65 20 61 6e 20 65 72 72 6f 72 20 77 69 74 68 20 2d 31 20 72 65 74 75 72 6e 73 20 61 6e 64 20 ┆te an error with -1 returns and ┆ 0x1200…1220 77 69 74 68 20 45 54 49 4d 45 44 4f 55 54 20 61 73 20 74 68 65 0a 20 20 20 20 20 73 70 65 63 69 ┆with ETIMEDOUT as the speci┆ 0x1220…1240 66 69 63 20 63 6f 64 65 20 69 6e 20 74 68 65 20 67 6c 6f 62 61 6c 20 76 61 72 69 61 62 6c 65 20 ┆fic code in the global variable ┆ 0x1240…1260 65 72 72 6e 6f 2e 20 20 54 68 65 20 70 72 6f 74 6f 63 6f 6c 73 0a 20 20 20 20 20 6f 70 74 69 6f ┆errno. The protocols optio┆ 0x1260…1280 6e 61 6c 6c 79 20 6b 65 65 70 20 73 6f 63 6b 65 74 73 20 22 77 61 72 6d 22 20 62 79 20 66 6f 72 ┆nally keep sockets "warm" by for┆ 0x1280…12a0 63 69 6e 67 20 74 72 61 6e 73 6d 69 73 73 69 6f 6e 73 0a 20 20 20 20 20 72 6f 75 67 68 6c 79 20 ┆cing transmissions roughly ┆ 0x12a0…12c0 65 76 65 72 79 20 6d 69 6e 75 74 65 20 69 6e 20 74 68 65 20 61 62 73 65 6e 63 65 20 6f 66 20 6f ┆every minute in the absence of o┆ 0x12c0…12e0 74 68 65 72 20 61 63 74 69 76 69 74 79 2e 20 20 41 6e 0a 20 20 20 20 20 65 72 72 6f 72 20 69 73 ┆ther activity. An error is┆ 0x12e0…1300 20 74 68 65 6e 20 69 6e 64 69 63 61 74 65 64 20 69 66 20 6e 6f 20 72 65 73 70 6f 6e 73 65 20 63 ┆ then indicated if no response c┆ 0x1300…1320 61 6e 20 62 65 20 65 6c 69 63 69 74 65 64 20 6f 6e 20 61 6e 0a 20 20 20 20 20 6f 74 68 65 72 77 ┆an be elicited on an otherw┆ 0x1320…1340 69 73 65 20 69 64 6c 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 6f 72 20 61 20 65 78 74 65 6e 64 ┆ise idle connection for a extend┆ 0x1340…1360 65 64 20 70 65 72 69 6f 64 20 28 65 2e 67 2e 20 35 0a 20 20 20 20 20 6d 69 6e 75 74 65 73 29 2e ┆ed period (e.g. 5 minutes).┆ 0x1360…1380 20 20 41 20 53 49 47 50 49 50 45 20 73 69 67 6e 61 6c 20 69 73 20 72 61 69 73 65 64 20 69 66 20 ┆ A SIGPIPE signal is raised if ┆ 0x1380…13a0 61 20 70 72 6f 63 65 73 73 20 73 65 6e 64 73 20 6f 6e 0a 20 20 20 20 20 61 20 62 72 6f 6b 65 6e ┆a process sends on a broken┆ 0x13a0…13c0 20 73 74 72 65 61 6d 3b 20 74 68 69 73 20 63 61 75 73 65 73 20 6e 61 69 76 65 20 70 72 6f 63 65 ┆ stream; this causes naive proce┆ 0x13c0…13e0 73 73 65 73 2c 20 77 68 69 63 68 20 64 6f 20 6e 6f 74 0a 20 20 20 20 20 68 61 6e 64 6c 65 20 74 ┆sses, which do not handle t┆ 0x13e0…1400 68 65 20 73 69 67 6e 61 6c 2c 20 74 6f 20 65 78 69 74 2e 0a 0a 20 20 20 20 20 53 4f 43 4b 5f 53 ┆he signal, to exit. SOCK_S┆ 0x1400…1420 45 51 50 41 43 4b 45 54 20 73 6f 63 6b 65 74 73 20 65 6d 70 6c 6f 79 20 74 68 65 20 73 61 6d 65 ┆EQPACKET sockets employ the same┆ 0x1420…1440 20 73 79 73 74 65 6d 20 63 61 6c 6c 73 20 61 73 0a 20 20 20 20 20 53 4f 43 4b 5f 53 54 52 45 41 ┆ system calls as SOCK_STREA┆ 0x1440…1460 4d 20 73 6f 63 6b 65 74 73 2e 20 20 54 68 65 20 6f 6e 6c 79 20 64 69 66 66 65 72 65 6e 63 65 20 ┆M sockets. The only difference ┆ 0x1460…1480 69 73 20 74 68 61 74 20 5f 08 72 5f 08 65 5f 08 61 5f 08 64 20 63 61 6c 6c 73 0a 20 20 20 20 20 ┆is that _ r_ e_ a_ d calls ┆ 0x1480…14a0 77 69 6c 6c 20 72 65 74 75 72 6e 20 6f 6e 6c 79 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 64 ┆will return only the amount of d┆ 0x14a0…14c0 61 74 61 20 72 65 71 75 65 73 74 65 64 2c 20 61 6e 64 20 61 6e 79 0a 20 20 20 20 20 72 65 6d 61 ┆ata requested, and any rema┆ 0x14c0…14e0 69 6e 69 6e 67 20 69 6e 20 74 68 65 20 61 72 72 69 76 69 6e 67 20 70 61 63 6b 65 74 20 77 69 6c ┆ining in the arriving packet wil┆ 0x14e0…1500 6c 20 62 65 20 64 69 73 63 61 72 64 65 64 2e 0a 0a 20 20 20 20 20 53 4f 43 4b 5f 44 47 52 41 4d ┆l be discarded. SOCK_DGRAM┆ 0x1500…1520 20 61 6e 64 20 53 4f 43 4b 5f 52 41 57 20 73 6f 63 6b 65 74 73 20 61 6c 6c 6f 77 20 73 65 6e 64 ┆ and SOCK_RAW sockets allow send┆ 0x1520…1540 69 6e 67 20 6f 66 20 64 61 74 61 67 72 61 6d 73 0a 20 20 20 20 20 74 6f 20 63 6f 72 72 65 73 70 ┆ing of datagrams to corresp┆ 0x1540…1560 6f 6e 64 65 6e 74 73 20 6e 61 6d 65 64 20 69 6e 20 5f 08 73 5f 08 65 5f 08 6e 5f 08 64 20 63 61 ┆ondents named in _ s_ e_ n_ d ca┆ 0x1560…1580 6c 6c 73 2e 20 20 44 61 74 61 67 72 61 6d 73 20 61 72 65 20 67 65 6e 2d 0a 20 20 20 20 20 65 72 ┆lls. Datagrams are gen- er┆ 0x1580…15a0 61 6c 6c 79 20 72 65 63 65 69 76 65 64 20 77 69 74 68 20 5f 08 72 5f 08 65 5f 08 63 5f 08 76 5f ┆ally received with _ r_ e_ c_ v_┆ 0x15a0…15c0 08 66 5f 08 72 5f 08 6f 5f 08 6d 2c 20 77 68 69 63 68 20 72 65 74 75 72 6e 73 20 74 68 65 20 6e ┆ f_ r_ o_ m, which returns the n┆ 0x15c0…15e0 65 78 74 0a 20 20 20 20 20 64 61 74 61 67 72 61 6d 20 77 69 74 68 20 69 74 73 20 72 65 74 75 72 ┆ext datagram with its retur┆ 0x15e0…1600 6e 20 61 64 64 72 65 73 73 2e 0a 0a 20 20 20 20 20 41 6e 20 5f 08 66 5f 08 63 5f 08 6e 5f 08 74 ┆n address. An _ f_ c_ n_ t┆ 0x1600…1620 5f 08 6c 20 63 61 6c 6c 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 73 70 65 63 69 66 79 20 ┆_ l call can be used to specify ┆ 0x1620…1640 61 20 70 72 6f 63 65 73 73 20 67 72 6f 75 70 20 74 6f 0a 20 20 20 20 20 72 65 63 65 69 76 65 20 ┆a process group to receive ┆ 0x1640…1660 61 20 53 49 47 55 52 47 20 73 69 67 6e 61 6c 20 77 68 65 6e 20 74 68 65 20 6f 75 74 2d 6f 66 2d ┆a SIGURG signal when the out-of-┆ 0x1660…1680 62 61 6e 64 20 64 61 74 61 20 61 72 72 69 76 65 73 2e 0a 20 20 20 20 20 49 74 20 6d 61 79 20 61 ┆band data arrives. It may a┆ 0x1680…16a0 6c 73 6f 20 65 6e 61 62 6c 65 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 20 49 2f 4f 20 61 6e 64 20 ┆lso enable non-blocking I/O and ┆ 0x16a0…16c0 61 73 79 6e 63 68 72 6f 6e 6f 75 73 20 6e 6f 74 69 66 69 2d 0a 20 20 20 20 20 63 61 74 69 6f 6e ┆asynchronous notifi- cation┆ 0x16c0…16e0 20 6f 66 20 49 2f 4f 20 65 76 65 6e 74 73 20 76 69 61 20 53 49 47 49 4f 2e 0a 0a 20 20 20 20 20 ┆ of I/O events via SIGIO. ┆ 0x16e0…1700 54 68 65 20 6f 70 65 72 61 74 69 6f 6e 20 6f 66 20 73 6f 63 6b 65 74 73 20 69 73 20 63 6f 6e 74 ┆The operation of sockets is cont┆ 0x1700…1720 72 6f 6c 6c 65 64 20 62 79 20 73 6f 63 6b 65 74 20 6c 65 76 65 6c 0a 20 20 20 20 20 5f 08 6f 5f ┆rolled by socket level _ o_┆ 0x1720…1740 08 70 5f 08 74 5f 08 69 5f 08 6f 5f 08 6e 5f 08 73 2e 20 20 54 68 65 73 65 20 6f 70 74 69 6f 6e ┆ p_ t_ i_ o_ n_ s. These option┆ 0x1740…1760 73 20 61 72 65 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 0a 20 20 20 20 20 3c ┆s are defined in the file <┆ 0x1760…1780 73 79 73 2f 73 6f 63 6b 65 74 2e 68 3e 2e 20 20 5f 08 53 5f 08 65 5f 08 74 5f 08 73 5f 08 6f 5f ┆sys/socket.h>. _ S_ e_ t_ s_ o_┆ 0x1780…17a0 08 63 5f 08 6b 5f 08 6f 5f 08 70 5f 08 74 20 61 6e 64 20 5f 08 67 5f 08 65 5f 08 74 5f 08 73 5f ┆ c_ k_ o_ p_ t and _ g_ e_ t_ s_┆ 0x17a0…17c0 08 6f 5f 08 63 5f 08 6b 5f 08 6f 5f 08 70 5f 08 74 20 61 72 65 20 75 73 65 64 20 74 6f 20 73 65 ┆ o_ c_ k_ o_ p_ t are used to se┆ 0x17c0…17e0 74 0a 20 20 20 20 20 61 6e 64 20 67 65 74 20 6f 70 74 69 6f 6e 73 2c 20 72 65 73 70 65 63 74 69 ┆t and get options, respecti┆ 0x17e0…1800 76 65 6c 79 2e 0a 0a 52 08 52 08 52 08 52 45 08 45 08 45 08 45 54 08 54 08 54 08 54 55 08 55 08 ┆vely. R R R RE E E ET T T TU U ┆ 0x1800…1820 55 08 55 52 08 52 08 52 08 52 4e 08 4e 08 4e 08 4e 20 56 08 56 08 56 08 56 41 08 41 08 41 08 41 ┆U UR R R RN N N N V V V VA A A A┆ 0x1820…1840 4c 08 4c 08 4c 08 4c 55 08 55 08 55 08 55 45 08 45 08 45 08 45 0a 20 20 20 20 20 41 20 2d 31 20 ┆L L L LU U U UE E E E A -1 ┆ 0x1840…1860 69 73 20 72 65 74 75 72 6e 65 64 20 69 66 20 61 6e 20 65 72 72 6f 72 20 6f 63 63 75 72 73 2c 20 ┆is returned if an error occurs, ┆ 0x1860…1880 6f 74 68 65 72 77 69 73 65 20 74 68 65 20 72 65 74 75 72 6e 0a 20 20 20 20 20 76 61 6c 75 65 20 ┆otherwise the return value ┆ 0x1880…18a0 69 73 20 61 20 64 65 73 63 72 69 70 74 6f 72 20 72 65 66 65 72 65 6e 63 69 6e 67 20 74 68 65 20 ┆is a descriptor referencing the ┆ 0x18a0…18c0 73 6f 63 6b 65 74 2e 0a 0a 45 08 45 08 45 08 45 52 08 52 08 52 08 52 52 08 52 08 52 08 52 4f 08 ┆socket. E E E ER R R RR R R RO ┆ 0x18c0…18e0 4f 08 4f 08 4f 52 08 52 08 52 08 52 53 08 53 08 53 08 53 0a 20 20 20 20 20 54 68 65 20 5f 08 73 ┆O O OR R R RS S S S The _ s┆ 0x18e0…1900 5f 08 6f 5f 08 63 5f 08 6b 5f 08 65 5f 08 74 20 63 61 6c 6c 20 66 61 69 6c 73 20 69 66 3a 0a 0a ┆_ o_ c_ k_ e_ t call fails if: ┆ 0x1900…1920 20 20 20 20 20 5b 45 50 52 4f 54 4f 4e 4f 53 55 50 50 4f 52 54 5d 20 54 68 65 20 70 72 6f 74 6f ┆ [EPROTONOSUPPORT] The proto┆ […truncated at 200 lines…]