== 最終更新日 2010年12月16日 == <<Errata 2010年2月17日>> -Wallを付けた時にwarningを出る系の間違い多数。。。 Chapter 2 ■List 2-4 #include が不足 ■List 2-5 int len; => socklen_t len; ■List 2-6 #include #include が不足 ■List 2-11 #include が不足 ■List 2-12 31行目 int n; は未使用 32行目 char buf[1024]; は未使用 ■List 2-19 #include が不足 addr.s_addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr; printf("ip address : %s\n", inet_ntoa(addr)); char buf[16];宣言の追加 inet_ntoa()を以下に変更。 inet_ntop(AF_INET, &addr, buf, sizeof(buf)); printf("ip address : %s\n", buf); でも、そもそも2-19は煩雑。 ■List 2-25 #include が不足 int n = write(sock, buf, (int)strlen(buf)); と「int n」が変なところに紛れ込んでいる。 int n;を最初の方に宣言し、write()の前の「int 」削除。 Chapter 3 ■ List 3-6 #include が不足 ■ List 3-11 #include が不足 Chapter 4 ■ List 4-7 #include が不足 ■ List 4-13 #include が不足 inet_addr()を使ってしまっている。 s_in->sin_addr.s_addr = inet_addr("10.1.2.30"); ↓ inet_pton(AF_INET, "10.1.2.30", &s_in->sin_addr); ■ List 4-15 #include が不足 ■ List 4-16 #include が不足 char buf[256];が不要 ■ List 4-17 #include が不足 ■ List 4-19 サンプルコードの最後が切れている。以下を最後に追加。 === close(fd); return 0; } === Chapter 6 ■ List 6-1 #include が不足 ■ List 6-3 最後のreturn 1;となっている部分はreturn 0; ■ List 6-25 最後のreturn 1;となっている部分はreturn 0; ■ List 6-26 最後のreturn 1;となっている部分はreturn 0; Chapter 7 ■ List 7-3 #include #include が不足 ■ List 7-8 SIGUSR1 シグナルの補足 => 捕捉 #include が不足 ■ List 7-10 #include が不足 ■ List 7-11 socklen_t addrlen;が不要 ■ List 7-13 socklen_t addrlen;が不要 ■ List 7-14 最初のincludeの#が抜けている #include が不足 ■ List 7-17 int n;が不要 ■ List 7-22 #include が不足 ■ List 7-37 mbuf.mtext[0] = ‘B’; ↓ mbuf.mtext[0] = 'B'; Chapter 8 ■ List 8-16 List 8-16の名前は「select()を使ったデータ送信プログラム」ではなく「List8-15へのデータ送信プログラム」の間違い memset(buf, 0, sizeof(buf));2カ所は不要 ■ List 8-19 #include #include が不足 Chapter 11 ■ List 11-14 #include が不足 最後のreturn 1; => return 0; Chapter 13 ■ List 13-1 #include #include が不足 ■ List 13-2 #include #include が不足 ■ List 13-5 #include が不足 ■ List 13-6 #include が不足 ■ List 13-7 #include #include が不足 int n;の宣言が不足 ■ List 13-8 #include #include #include が不足 ■ List 13-16 #include #include が不足 Appendix ■ List A-2 #include #include が不足 int n = sock, buf, sizeof(buf), 0);の最初の「int 」を削除と同時に、int n;の宣言をmain()最初のブロックへ。 ■ List A-4 #include が不足 <<Errata 2010年2月26日追加>> Chapter 2 図2-5 Write()のWが大文字になっている。write()に修正。 Chapter 10 10-5 321ページ 「glibc-2.7では/misc/daemon.c内で実装されていますが、」 ↓ 「glibc-2.7ではmisc/daemon.c内で実装されていますが、」に修正。「/」は紛らわしい Chapter 11 338ページ 「来年」→「2011年」 <<Errata 2010年12月16日追加>> Chapter 9 284ページ 「Flow Label 16ビット」→「Flow Label 20ビット」