/usr/share/doc/HOWTO/ja-html/Software-Building-HOWTO-11.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>Building and Installing Software Packages for Linux: 3 $BHVL\$NNc(B: Fortune</TITLE>
<LINK HREF="Software-Building-HOWTO-12.html" REL=next>
<LINK HREF="Software-Building-HOWTO-10.html" REL=previous>
<LINK HREF="Software-Building-HOWTO.html#toc11" REL=contents>
</HEAD>
<BODY>
<A HREF="Software-Building-HOWTO-12.html">$B<!$N%Z!<%8(B</A>
<A HREF="Software-Building-HOWTO-10.html">$BA0$N%Z!<%8(B</A>
<A HREF="Software-Building-HOWTO.html#toc11">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s11">11.</A> <A HREF="Software-Building-HOWTO.html#toc11">3 $BHVL\$NNc(B: Fortune</A></H2>
<P>$B$3$NNc$O(B C $B8@8l$N%W%m%0%i%_%s%0$NCN<1$r$"$kDxEYI,MW$H$7$^$9!#(BUNIX $B$d(B
Linux $B$N%=%U%H%&%'%"$N$[$H$s$I$O(B C $B8@8l$G=q$+$l$F$$$k$N$G!"%=%U%H%&%'(B
$B%"$N%$%s%9%H!<%k$r$^$8$a$K$d$m$&$H$9$k$J$iB?>/$G$b(B C $B8@8l$r3P$($F$*$1(B
$B$P$-$C$HLr$KN)$D$G$7$g$&!#(B</P>
<P>$BM-L>$J(B <EM>fortune</EM> $B%W%m%0%i%`$O%f!<%b%"$N$"$k$3$H$o$6!"$$$o$f$k(B
"fortune cookie" $B$r(B Linux $B$,%V!<%H$9$k$?$S$KI=<($7$^$9!#(B
$BIT1?$J$3$H$K(B($B$3$3$O(B unfortune $B$K$+$1$?%7%c%l$N$D$b$j(B)$B!"(B
$B%+!<%M%k$N%P!<%8%g%s$,(B 2.0.30 $B$N(B RedHat $B%G%#%9%H%j%S%e!<%7%g%s$G$OCWL?(B
$BE*$J%(%i!<$,H/@8$7$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
~/fortune# make all
gcc -O2 -Wall -fomit-frame-pointer -pipe -c fortune.c -o
fortune.o
fortune.c: In function `add_dir':
fortune.c:551: structure has no member named `d_namlen'
fortune.c:553: structure has no member named `d_namlen'
make[1]: *** [fortune.o] Error 1
make[1]: Leaving directory `/home/thegrendel/for/fortune/fortune'
make: *** [fortune-bin] Error 2
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><CODE>fortune.c</CODE> $B$r8+$F$_$k$H!"%(%i!<$N5/$3$C$F$$$kItJ,$O0J2<$N>l=j(B
$B$G$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
if (dirent->d_namlen == 0)
continue;
name = copy(dirent->d_name, dirent->d_namlen);
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><CODE>dirent</CODE> $B9=B$BN$r8+IU$1$kI,MW$,$"$j$^$9$,!"(B<EM>fortune.c</EM>
$B$G$ODj5A$5$l$F$$$^$;$s$7!"(B<B>grep dirent</B> $B$GC5$7$F$_$F$bB>$N(B
$B%=!<%9%U%!%$%k$G@k8@$5$l$F$$$k$o$1$G$b$"$j$^$;$s!#$7$+$7(B
<EM>fortune.c</EM> $B$N:G=i$K<!$N$h$&$J9T$,$"$j$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
#include <dirent.h>
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B$3$l$O%7%9%F%`%i%$%V%i%j$N%$%s%/%k!<%I%U%!%$%k$N$h$&$G$9!#$7$?$,$C$F!"(B
$BI,A3E*$K(B <EM>dirent.h</EM> $B$rC5$7$K9T$/>l=j$O(B <EM>/usr/include</EM> $B$H(B
$B$J$j$^$9!#<B$r8@$&$H!"(B<EM>/usr/include</EM> $B$K(B <EM>dirent.h</EM> $B$O$"(B
$B$k$N$G$9$,!"(B<EM>dirent.h</EM> $B$K$O(B <CODE>dirent</CODE> $B9=B$BN$N@k8@$O$"$j(B
$B$^$;$s!#$7$+$7!"B>$N(B <EM>dirent.h</EM> $B%U%!%$%k$r;2>H$9$k$h$&$K$J$C$F(B
$B$$$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
#include <linux/dirent.h>
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B$d$C$H(B <EM>/usr/include/linux/dirent.h</EM> $B$^$G$/$l$P!"C5$7$F$$$k(B
$B9=B$BN$N@k8@$,8+$D$+$j$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
struct dirent {
long d_ino;
__kernel_off_t d_off;
unsigned short d_reclen;
char d_name[256]; /* We must not include
limits.h! */
};
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B$d$C$Q$j!"9=B$BN$N@k8@$K(B <EM>d_namelen</EM> $B$,F~$C$F$$$^$;$s$G$7$?!#$7(B
$B$+$7!"$=$l$KAjEv$7$=$&$J!V8uJd!W$,(B 2 $B$D$"$j$^$9!#$=$N$&$A$b$C$H$b$=$l(B
$B$i$7$$$N$O(B <EM>d_reclen</EM> $B$G$9!#$H$$$&$N$b!"$3$N9=B$BN%a%s%P$O(B
$B2?$+$ND9$5$rI=$7$F$$$k$h$&$G$9$7!"(Bshort $B7?$N@0?t$@$+$i$G$9!#$b$&0l$D$N(B
$BJ}$O(B <EM>d_ino</EM> $B$G$9$,!"$3$l$OL>A0$H7?$+$i9M$($k$H(B inode $BHV9f$N$h(B
$B$&$G$9!#<B$r$$$&$H!"$3$3$G$O!V%G%#%l%/%H%j%(%s%H%j!W9=B$BN$r07$C$F$$$F!"(B
$B3FMWAG$O%U%!%$%k$NB0@-!"%U%!%$%kL>!"(Binode $BHV9f!"(B($B%V%m%C%/C10L$G$N(B)$BD9$5(B
$B$rI=$7$F$$$^$9!#$3$N;v<B$HFM$-9g$o$;$k$H?dB,$,3N<B$K$J$k$G$7$g$&!#(B</P>
<P><CODE>fortune.c</CODE> $B$rJT=8$7$F!"(B551 $B9TL\$H(B 553 $B9TL\$K$"$k(B <EM>d_namelen</EM>
$B$X$N;2>H$r(B <EM>d_reclen</EM> $B$K=q$-49$($F$_$^$7$g$&!#$=$l$+$i(B
<EM>make all</EM> $B$r$b$&0lEY;n$7$^$7$g$&!#(B<B>$B@.8y$7$^$7$?!#(B</B>
$B%(%i!<$b$J$7$K9=C[$G$-$^$7$?!#$3$l$G(B fortune $B$r;H$C$F(B
$B!V$A$g$C$H$I$-$I$-!W$G$-$^$9$M!#(B</P>
<HR>
<A HREF="Software-Building-HOWTO-12.html">$B<!$N%Z!<%8(B</A>
<A HREF="Software-Building-HOWTO-10.html">$BA0$N%Z!<%8(B</A>
<A HREF="Software-Building-HOWTO.html#toc11">$BL\<!$X(B</A>
</BODY>
</HTML>
|