1998-06-15 18:07  Ulrich Drepper  <drepper@cygnus.com>

	* iconvdata/ksc5601.h: Clean up a bit.

1998-06-15 14:35  Ulrich Drepper  <drepper@cygnus.com>

	* sunrpc/svc_tcp.c (readtcp): Also listen to all the other connections
	and process incoming data.
	* sunrpc/xdr_rec.c (set_input_fragment): Only recognize zero length
	fragments as invalid.
	Patches by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.

1998-06-13  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	Removal of duplicates like "the the".
	* manual/time.texi (TZ Variable): Likewise.
	* manual/users.texi (Manipulating the Database): Likewise.
	* manual/sysinfo.texi (Filesystem handling): Likewise.
	* manual/signal.texi (Signaling Yourself): Likewise.
	* manual/message.texi (Message Translation): Likewise.
	(Common Usage): Likewise.
	* manual/llio.texi: Likewise.
	* manual/arith.texi (Old-style number conversion): Likewise.
	* manual/argp.texi (Argp): Likewise.
	(Argp Parsers): Likewise.
	(Argp Help Filtering): Likewise.

	* hesiod/README.hesiod: Correct typo.

	* manual/llio.texi: Correct typos.
	* manual/sysinfo.texi: Likewise.

1998-06-13  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* rt/aio.h: Rename __op to __operation for g++.

1998-06-13 20:17 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* iconvdata/gen-8bit-gap.sh: Use awk not perl.  Clean up sed
	script.
	* iconvdata/gen-8bit-gap-1.sh: Likewise.
	* iconvdata/gen-8bit.sh: Clean up sed script.

	* iconvdata/Makefile: Remove all PERL conditionals; build all
	the modules all the time.  Export AWK.
	(gen-8bit-gap): Delete setting of PERL.
	(gen-8bit-gap-1): Likewise.
	(perl-generated-headers): Renamed awk-generated-headers.

	* iconvdata/gap.pl: Removed.
	* iconvdata/gaptab.pl: Removed.
	* iconvdata/gap.awk: New file.
	* iconvdata/gaptab.awk: New file.

1998-06-15  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/generic/Dist: Add errno-loc.c.

	* sysdeps/unix/sysv/linux/alpha/glob.c: Add prototypes for the
	__new_* functions.

1998-06-14 14:21 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* stdio-common/bug12.c: New test for fread()/fseek().
	* stdio-common/Makefile (tests): Add bug12.
This commit is contained in:
Ulrich Drepper 1998-06-15 18:12:05 +00:00
parent e5bafd559a
commit fed8f7f7ae
22 changed files with 333 additions and 183 deletions

View File

@ -1,3 +1,69 @@
1998-06-15 18:07 Ulrich Drepper <drepper@cygnus.com>
* iconvdata/ksc5601.h: Clean up a bit.
1998-06-15 14:35 Ulrich Drepper <drepper@cygnus.com>
* sunrpc/svc_tcp.c (readtcp): Also listen to all the other connections
and process incoming data.
* sunrpc/xdr_rec.c (set_input_fragment): Only recognize zero length
fragments as invalid.
Patches by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
1998-06-13 Andreas Jaeger <aj@arthur.rhein-neckar.de>
Removal of duplicates like "the the".
* manual/time.texi (TZ Variable): Likewise.
* manual/users.texi (Manipulating the Database): Likewise.
* manual/sysinfo.texi (Filesystem handling): Likewise.
* manual/signal.texi (Signaling Yourself): Likewise.
* manual/message.texi (Message Translation): Likewise.
(Common Usage): Likewise.
* manual/llio.texi: Likewise.
* manual/arith.texi (Old-style number conversion): Likewise.
* manual/argp.texi (Argp): Likewise.
(Argp Parsers): Likewise.
(Argp Help Filtering): Likewise.
* hesiod/README.hesiod: Correct typo.
* manual/llio.texi: Correct typos.
* manual/sysinfo.texi: Likewise.
1998-06-13 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* rt/aio.h: Rename __op to __operation for g++.
1998-06-13 20:17 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* iconvdata/gen-8bit-gap.sh: Use awk not perl. Clean up sed
script.
* iconvdata/gen-8bit-gap-1.sh: Likewise.
* iconvdata/gen-8bit.sh: Clean up sed script.
* iconvdata/Makefile: Remove all PERL conditionals; build all
the modules all the time. Export AWK.
(gen-8bit-gap): Delete setting of PERL.
(gen-8bit-gap-1): Likewise.
(perl-generated-headers): Renamed awk-generated-headers.
* iconvdata/gap.pl: Removed.
* iconvdata/gaptab.pl: Removed.
* iconvdata/gap.awk: New file.
* iconvdata/gaptab.awk: New file.
1998-06-15 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/Dist: Add errno-loc.c.
* sysdeps/unix/sysv/linux/alpha/glob.c: Add prototypes for the
__new_* functions.
1998-06-14 14:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* stdio-common/bug12.c: New test for fread()/fseek().
* stdio-common/Makefile (tests): Add bug12.
1998-06-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> 1998-06-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/elf/backtracesyms.c: Make array elements * sysdeps/generic/elf/backtracesyms.c: Make array elements

View File

@ -26,9 +26,9 @@ and their reentrant counterparts.
Configuring your systems Configuring your systems
======================== ========================
Configuring your systems to make use use the Hesiod name service Configuring your systems to make use the Hesiod name service requires
requires one or more of the following steps, depending on whether you one or more of the following steps, depending on whether you are
are already running Hesiod in your network. already running Hesiod in your network.
Configuring NSS Configuring NSS
--------------- ---------------

View File

@ -31,17 +31,15 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
EBCDIC-FI-SE-A EBCDIC-FR EBCDIC-IS-FRISS EBCDIC-IT EBCDIC-PT \ EBCDIC-FI-SE-A EBCDIC-FR EBCDIC-IS-FRISS EBCDIC-IT EBCDIC-PT \
EBCDIC-UK EBCDIC-US IBM037 IBM038 IBM274 IBM275 IBM423 \ EBCDIC-UK EBCDIC-US IBM037 IBM038 IBM274 IBM275 IBM423 \
IBM500 IBM870 IBM871 IBM891 IBM903 IBM904 IBM905 IBM1047 \ IBM500 IBM870 IBM871 IBM891 IBM903 IBM904 IBM905 IBM1047 \
CP874 CP737 CP775 ISO-2022-KR CP874 CP737 CP775 ISO-2022-KR \
ifneq ($(PERL),no) KOI8-R LATIN-GREEK LATIN-GREEK-1 IBM256 IBM273 IBM277 IBM278 \
modules += KOI8-R LATIN-GREEK LATIN-GREEK-1 IBM256 IBM273 IBM277 IBM278 \
IBM280 IBM281 IBM284 IBM285 IBM290 IBM297 IBM420 IBM424 \ IBM280 IBM281 IBM284 IBM285 IBM290 IBM297 IBM420 IBM424 \
IBM437 IBM850 IBM851 IBM852 IBM855 IBM857 IBM860 IBM861 \ IBM437 IBM850 IBM851 IBM852 IBM855 IBM857 IBM860 IBM861 \
IBM862 IBM863 IBM864 IBM865 IBM868 IBM869 IBM875 IBM880 \ IBM862 IBM863 IBM864 IBM865 IBM868 IBM869 IBM875 IBM880 \
IBM918 IBM1004 IBM1026 CP1250 CP1251 CP1252 CP1253 CP1254 \ IBM918 IBM1004 IBM1026 CP1250 CP1251 CP1252 CP1253 CP1254 \
CP1255 CP1256 CP1257 ISO-2022-JP CP1255 CP1256 CP1257 ISO-2022-JP
endif
modules.so := $(addsuffix .so, $(modules))
modules.so := $(addsuffix .so, $(modules))
include ../Makeconfig include ../Makeconfig
@ -173,7 +171,7 @@ LDFLAGS-libKSC.so = -Wl,-soname,$(@F)
LDFLAGS-libGB.so = -Wl,-soname,$(@F) LDFLAGS-libGB.so = -Wl,-soname,$(@F)
LDFLAGS-libCNS.so = -Wl,-soname,$(@F) LDFLAGS-libCNS.so = -Wl,-soname,$(@F)
distribute := 8bit-generic.c 8bit-gap.c gap.pl gaptab.pl gconv-modules \ distribute := 8bit-generic.c 8bit-gap.c gap.awk gaptab.awk gconv-modules \
iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \ iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \
iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c \ iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c \
t61.c iso6937.c sjis.c jis0201.h jis0208.h jis0212.h \ t61.c iso6937.c sjis.c jis0201.h jis0208.h jis0212.h \
@ -245,12 +243,14 @@ sed-generated-headers := iso8859-2.h iso8859-3.h iso8859-4.h iso8859-6.h \
define generate-8bit-gap-table define generate-8bit-gap-table
$(make-target-directory) $(make-target-directory)
PERL="$(PERL)" $(SHELL) ./gen-8bit-gap.sh $< > $(@:stmp=T) $(SHELL) ./gen-8bit-gap.sh $< > $(@:stmp=T)
$(move-if-change) $(@:stmp=T) $(@:stmp=h) $(move-if-change) $(@:stmp=T) $(@:stmp=h)
touch $@ touch $@
endef endef
perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h \ export AWK
awk-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h \
ibm256.h ibm273.h ibm277.h ibm278.h ibm280.h \ ibm256.h ibm273.h ibm277.h ibm278.h ibm280.h \
ibm281.h ibm284.h ibm285.h ibm290.h ibm297.h \ ibm281.h ibm284.h ibm285.h ibm290.h ibm297.h \
ibm420.h ibm424.h ibm437.h ibm850.h ibm851.h \ ibm420.h ibm424.h ibm437.h ibm850.h ibm851.h \
@ -263,17 +263,15 @@ perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h \
iso8859-10.h iso8859-7jp.h iso8859-10.h iso8859-7jp.h
generated = $(sed-generated-headers) $(sed-generated-headers:%.h=%.stmp) \ generated = $(sed-generated-headers) $(sed-generated-headers:%.h=%.stmp) \
$(perl-generated-headers) $(perl-generated-headers:%.h=%.stmp) \ $(awk-generated-headers) $(awk-generated-headers:%.h=%.stmp) \
iconv-test.out iconv-test.out
ifdef objpfx ifdef objpfx
generated += $(objpfx)gconv-modules generated += $(objpfx)gconv-modules
endif endif
# The headers must be generated before the compilation. # The headers must be generated before the compilation.
before-compile = $(addprefix $(objpfx),$(sed-generated-headers)) before-compile = $(addprefix $(objpfx),\
ifneq ($(PERL),no) $(sed-generated-headers) $(awk-generated-headers))
before-compile += $(addprefix $(objpfx),$(perl-generated-headers))
endif
# Rules to generate the headers. # Rules to generate the headers.
$(sed-generated-headers:%=$(objpfx)%): $(objpfx)%.h: $(objpfx)%.stmp $(sed-generated-headers:%=$(objpfx)%): $(objpfx)%.h: $(objpfx)%.stmp
@ -355,8 +353,7 @@ $(objpfx)ibm905.stmp: ../localedata/charmaps/IBM905 gen-8bit.sh
$(objpfx)ibm1047.stmp: ../localedata/charmaps/IBM1047 gen-8bit.sh $(objpfx)ibm1047.stmp: ../localedata/charmaps/IBM1047 gen-8bit.sh
$(generate-8bit-table) $(generate-8bit-table)
ifneq ($(PERL),no) $(awk-generated-headers:%=$(objpfx)%): $(objpfx)%.h: $(objpfx)%.stmp
$(perl-generated-headers:%=$(objpfx)%): $(objpfx)%.h: $(objpfx)%.stmp
@: @:
$(objpfx)iso8859-5.stmp: ../localedata/charmaps/ISO-8859-5 gen-8bit-gap.sh $(objpfx)iso8859-5.stmp: ../localedata/charmaps/ISO-8859-5 gen-8bit-gap.sh
@ -365,7 +362,7 @@ $(objpfx)iso8859-7.stmp: ../localedata/charmaps/ISO-8859-7 gen-8bit-gap.sh
$(generate-8bit-gap-table) $(generate-8bit-gap-table)
$(objpfx)iso8859-7jp.stmp: ../localedata/charmaps/ISO-8859-7 gen-8bit-gap-1.sh $(objpfx)iso8859-7jp.stmp: ../localedata/charmaps/ISO-8859-7 gen-8bit-gap-1.sh
$(make-target-directory) $(make-target-directory)
PERL="$(PERL)" $(SHELL) ./gen-8bit-gap-1.sh $< >$(@:stmp=T) $(SHELL) ./gen-8bit-gap-1.sh $< >$(@:stmp=T)
$(move-if-change) $(@:stmp=T) $(@:stmp=h) $(move-if-change) $(@:stmp=T) $(@:stmp=h)
touch $@ touch $@
@ -460,13 +457,9 @@ $(objpfx)cp1256.stmp: ../localedata/charmaps/CP1256 gen-8bit-gap.sh
$(generate-8bit-gap-table) $(generate-8bit-gap-table)
$(objpfx)cp1257.stmp: ../localedata/charmaps/CP1257 gen-8bit-gap.sh $(objpfx)cp1257.stmp: ../localedata/charmaps/CP1257 gen-8bit-gap.sh
$(generate-8bit-gap-table) $(generate-8bit-gap-table)
endif
headers: $(addprefix $(objpfx),$(sed-generated-headers))
ifneq ($(PERL),no)
headers: $(addprefix $(objpfx),$(perl-generated-headers))
endif
headers: $(addprefix $(objpfx),\
$(sed-generated-headers) $(awk-generated-headers))
$(addprefix $(inst_gconvdir)/, $(modules.so)): \ $(addprefix $(inst_gconvdir)/, $(modules.so)): \
$(inst_gconvdir)/%: $(objpfx)% $(+force) $(inst_gconvdir)/%: $(objpfx)% $(+force)

39
iconvdata/gap.awk Normal file
View File

@ -0,0 +1,39 @@
BEGIN { hv["0"] = 0; hv["1"] = 1; hv["2"] = 2; hv["3"] = 3;
hv["4"] = 4; hv["5"] = 5; hv["6"] = 6; hv["7"] = 7;
hv["8"] = 8; hv["9"] = 9; hv["A"] = 10; hv["B"] = 11;
hv["C"] = 12; hv["D"] = 13; hv["E"] = 14; hv["F"] = 15;
hv["a"] = 10; hv["b"] = 11; hv["c"] = 12; hv["d"] = 13;
hv["e"] = 14; hv["f"] = 15;
first = 0; last = 0; idx = 0;
}
function tonum(str)
{
num=0;
cnt=1;
while (cnt <= length(str)) {
num *= 16;
num += hv[substr(str,cnt,1)];
++cnt;
}
return num;
}
{
u = tonum($1);
if (u - last > 6)
{
if (last)
{
printf (" { start: 0x%04x, end: 0x%04x, idx: %5d },\n",
first, last, idx);
idx -= u - last - 1;
}
first = u;
}
last = u;
}
END { printf (" { start: 0x%04x, end: 0x%04x, idx: %5d },\n",
first, last, idx); }

View File

@ -1,16 +0,0 @@
$first=$last=$idx=0;
while (<>) {
local($ucs,$rest) = split;
local($u)=hex($ucs);
if ($u - $last > 6) {
if ($last != 0) {
printf (" { start: 0x%04x, end: 0x%04x, idx: %5d },\n",
$first, $last, $idx);
$idx -= $u - $last - 1;
}
$first=$u;
}
$last=$u;
}
printf (" { start: 0x%04x, end: 0x%04x, idx: %5d },\n",
$first, $last, $idx);

48
iconvdata/gaptab.awk Normal file
View File

@ -0,0 +1,48 @@
BEGIN { hv["0"] = 0; hv["1"] = 1; hv["2"] = 2; hv["3"] = 3;
hv["4"] = 4; hv["5"] = 5; hv["6"] = 6; hv["7"] = 7;
hv["8"] = 8; hv["9"] = 9; hv["A"] = 10; hv["B"] = 11;
hv["C"] = 12; hv["D"] = 13; hv["E"] = 14; hv["F"] = 15;
hv["a"] = 10; hv["b"] = 11; hv["c"] = 12; hv["d"] = 13;
hv["e"] = 14; hv["f"] = 15;
first = 0; last = 0; idx = 0; f = 0;
}
function tonum(str)
{
num=0;
cnt=1;
while (cnt <= length(str)) {
num *= 16;
num += hv[substr(str,cnt,1)];
++cnt;
}
return num;
}
function fmt(val)
{
if (f++ % 8 == 0)
{ printf ("\n '\\x%02x',", val); }
else
{ printf (" '\\x%02x',", val); }
}
{
u = tonum($1); c = tonum($2);
if (u - last > 6)
{
if (last) { idx += last - first + 1; }
first = u;
}
else
{
for (m = last+1; m < u; m++) { fmt(0); }
}
fmt(c);
last = u;
}
END { print "" }

View File

@ -1,25 +0,0 @@
$first=$last=$idx=0;
sub fmt {
printf ("\n ") if (($n % 8) == 0);
++$n;
my($val) = pop(@_);
printf (" '\\x%02x',", $val);
}
while (<>) {
local($ucs,$char,$rest) = split;
local($u)=hex($ucs);
local($c)=hex($char);
if ($u - $last > 6) {
if ($last != 0) {
$idx += $last - $first + 1;
}
$first=$u;
} else {
for ($m = $last + 1; $m < $u; ++$m) {
fmt (0);
}
}
fmt ($c);
$last=$u;
}
printf ("\n");

View File

@ -1,18 +1,15 @@
#! /bin/sh #! /bin/sh
echo "static const uint32_t iso88597_to_ucs4[96] = {" echo "static const uint32_t iso88597_to_ucs4[96] = {"
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' \ sed -ne '/^[^[:space:]]*[[:space:]]*.x00/d' \
-e 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/ [0x\1 - 0xA0] = 0x\2,/p' \ -e 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/ [0x\1 - 0xA0] = 0x\2,/p' \
-e d "$@" | \ "$@" | sort -u
sort -u
echo "};" echo "};"
echo "static const struct gap from_idx[] = {" echo "static const struct gap from_idx[] = {"
sed -e 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' \ sed -ne 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/\2/p' \
-e d "$@" | \ "$@" | sort -u | $AWK -f gap.awk
sort -u | $PERL gap.pl
echo " { start: 0xffff, end: 0xffff, idx: 0 }" echo " { start: 0xffff, end: 0xffff, idx: 0 }"
echo "};" echo "};"
echo "static const char iso88597_from_ucs4[] = {" echo "static const char iso88597_from_ucs4[] = {"
sed -e 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' \ sed -ne 's/^[^[:space:]]*[[:space:]]*.x\([A-F].\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' \
-e d "$@" | \ "$@" | sort -u | $AWK -f gaptab.awk
sort -u | $PERL gaptab.pl
echo "};" echo "};"

View File

@ -1,18 +1,15 @@
#! /bin/sh #! /bin/sh
echo "static const uint32_t to_ucs4[256] = {" echo "static const uint32_t to_ucs4[256] = {"
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' \ sed -ne '/^[^[:space:]]*[[:space:]]*.x00/d' \
-e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' \ -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' \
-e d "$@" | \ "$@" | sort -u
sort -u
echo "};" echo "};"
echo "static const struct gap from_idx[] = {" echo "static const struct gap from_idx[] = {"
sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' \ sed -ne 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/\2/p' \
-e d "$@" | \ "$@" | sort -u | $AWK -f gap.awk
sort -u | $PERL gap.pl
echo " { start: 0xffff, end: 0xffff, idx: 0 }" echo " { start: 0xffff, end: 0xffff, idx: 0 }"
echo "};" echo "};"
echo "static const char from_ucs4[] = {" echo "static const char from_ucs4[] = {"
sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' \ sed -ne 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/\2 \1/p' \
-e d "$@" | \ "$@" | sort -u | $AWK -f gaptab.awk
sort -u | $PERL gaptab.pl
echo "};" echo "};"

View File

@ -1,13 +1,11 @@
#! /bin/sh #! /bin/sh
echo "static const uint32_t to_ucs4[256] = {" echo "static const uint32_t to_ucs4[256] = {"
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' \ sed -ne '/^[^[:space:]]*[[:space:]]*.x00/d' \
-e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' \ -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' \
-e d "$@" | \ "$@" | sort -u
sort -u
echo "};" echo "};"
echo "static const char from_ucs4[] = {" echo "static const char from_ucs4[] = {"
sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' \ sed -ne '/^[^[:space:]]*[[:space:]]*.x00/d' \
-e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' \ -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' \
-e d "$@" | \ "$@" | sort -u
sort -u
echo "};" echo "};"

View File

@ -85,13 +85,12 @@ static inline size_t
ucs4_to_ksc5601_hangul (uint32_t wch, unsigned char *s, size_t avail) ucs4_to_ksc5601_hangul (uint32_t wch, unsigned char *s, size_t avail)
{ {
int l = 0; int l = 0;
int m;
int u = KSC5601_HANGUL - 1; int u = KSC5601_HANGUL - 1;
uint32_t try; uint32_t try;
while (l <= u) while (l <= u)
{ {
m = (l + u) / 2; int m = (l + u) / 2;
try = (uint32_t) __ksc5601_hangul_to_ucs[m]; try = (uint32_t) __ksc5601_hangul_to_ucs[m];
if (try > wch) if (try > wch)
u = m - 1; u = m - 1;
@ -117,13 +116,12 @@ static inline size_t
ucs4_to_ksc5601_hanja (uint32_t wch, unsigned char *s, size_t avail) ucs4_to_ksc5601_hanja (uint32_t wch, unsigned char *s, size_t avail)
{ {
int l = 0; int l = 0;
int m;
int u = KSC5601_HANJA - 1; int u = KSC5601_HANJA - 1;
uint32_t try; uint32_t try;
while (l <= u) while (l <= u)
{ {
m = (l + u) / 2; int m = (l + u) / 2;
try = (uint32_t) __ksc5601_hanja_from_ucs[m].ucs; try = (uint32_t) __ksc5601_hanja_from_ucs[m].ucs;
if (try > wch) if (try > wch)
u=m-1; u=m-1;
@ -148,13 +146,12 @@ static inline size_t
ucs4_to_ksc5601_sym (uint32_t wch, unsigned char *s, size_t avail) ucs4_to_ksc5601_sym (uint32_t wch, unsigned char *s, size_t avail)
{ {
int l = 0; int l = 0;
int m;
int u = KSC5601_SYMBOL - 1; int u = KSC5601_SYMBOL - 1;
uint32_t try; uint32_t try;
while (l <= u) while (l <= u)
{ {
m = (l + u) / 2; int m = (l + u) / 2;
try = __ksc5601_sym_from_ucs[m].ucs; try = __ksc5601_sym_from_ucs[m].ucs;
if (try > wch) if (try > wch)
u = m - 1; u = m - 1;

View File

@ -60,7 +60,7 @@ call to @code{argp_parse} is the only argument-parsing code needed in
@comment argp.h @comment argp.h
@comment GNU @comment GNU
@deftypefun {error_t} argp_parse (const struct argp *@var{argp}, int @var{argc}, char **@var{argv}, unsigned @var{flags}, int *@var{arg_index}, void *@var{input}) @deftypefun {error_t} argp_parse (const struct argp *@var{argp}, int @var{argc}, char **@var{argv}, unsigned @var{flags}, int *@var{arg_index}, void *@var{input})
The @code{argp_parse} function parses the arguments in in @var{argv}, of The @code{argp_parse} function parses the arguments in @var{argv}, of
length @var{argc}, using the argp parser @var{argp} (@pxref{Argp length @var{argc}, using the argp parser @var{argp} (@pxref{Argp
Parsers}); a value of zero is the same as a @code{struct argp} Parsers}); a value of zero is the same as a @code{struct argp}
containing all zeros. @var{flags} is a set of flag bits that modify the containing all zeros. @var{flags} is a set of flag bits that modify the
@ -203,7 +203,7 @@ messages. @xref{Argp Help Filtering}.
The @code{options}, @code{parser}, @code{args_doc}, and @code{doc} The @code{options}, @code{parser}, @code{args_doc}, and @code{doc}
fields are usually all that are needed. If an argp parser is defined as fields are usually all that are needed. If an argp parser is defined as
an initialized C variable, only the used fields need be specified in in an initialized C variable, only the used fields need be specified in
the initializer---the rest will default to zero due to the way C the initializer---the rest will default to zero due to the way C
structure initialization works (this fact is exploited for most argp structure initialization works (this fact is exploited for most argp
structures, grouping the most-used fields near the beginning, so that structures, grouping the most-used fields near the beginning, so that
@ -845,7 +845,7 @@ Turns off any message-printing/exiting options, specifically
@need 2000 @need 2000
@subsection Customizing Argp Help Output @subsection Customizing Argp Help Output
The @code{help_filter} field in a a @code{struct argp} is a pointer to a The @code{help_filter} field in a @code{struct argp} is a pointer to a
function to filter the text of help messages before displaying them. function to filter the text of help messages before displaying them.
They have a function signature like: They have a function signature like:

View File

@ -1339,7 +1339,7 @@ library also provides these functions together with some useful
extensions in the same sense. extensions in the same sense.
Generally, you should avoid using these functions unless the really fit Generally, you should avoid using these functions unless the really fit
into the problem you have to to solve. Otherwise it is almost always into the problem you have to solve. Otherwise it is almost always
better to use @code{sprintf} since its greater availability (it is an better to use @code{sprintf} since its greater availability (it is an
@w{ISO C} function). @w{ISO C} function).

View File

@ -142,7 +142,7 @@ or @code{O_CREAT} is set and the file does not already exist.
If on a 32 bits machine the sources are translated with If on a 32 bits machine the sources are translated with
@code{_FILE_OFFSET_BITS == 64} the function @code{open} returns a file @code{_FILE_OFFSET_BITS == 64} the function @code{open} returns a file
descriptor opened in the large file mode which enables the file handling descriptor opened in the large file mode which enables the file handling
functions to use files up to @math{2^63} in size and offset from functions to use files up to @math{2^63} bytes in size and offset from
@math{-2^63} to @math{2^63}. This happens transparently for the user @math{-2^63} to @math{2^63}. This happens transparently for the user
since all of the lowlevel file handling functions are equally replaced. since all of the lowlevel file handling functions are equally replaced.
@ -266,7 +266,7 @@ on their meaning.
Please note that there is @emph{no} separate @code{close64} function. Please note that there is @emph{no} separate @code{close64} function.
This is not necessary since this function does not determine nor depend This is not necessary since this function does not determine nor depend
on the more of the file. The kernel which performs the @code{close} on the mode of the file. The kernel which performs the @code{close}
operation knows for which mode the descriptor is used and can handle operation knows for which mode the descriptor is used and can handle
this situation. this situation.
@end deftypefun @end deftypefun
@ -1402,7 +1402,7 @@ These functions are part of the library with realtime functions named
The implementation of these functions can be done using support in the The implementation of these functions can be done using support in the
kernel (if available) or using an implementation based on threads at kernel (if available) or using an implementation based on threads at
userlevel. In the latter case it might be necessary to link applications userlevel. In the latter case it might be necessary to link applications
with the thread library @file{libthread} in addition to @file{librt}. with the thread library @file{libpthread} in addition to @file{librt}.
All AIO operations operate on files which were opened previously. There All AIO operations operate on files which were opened previously. There
might be arbitrary many operations for one file running. The might be arbitrary many operations for one file running. The
@ -1429,8 +1429,8 @@ I.e., it is not possible to use any of the AIO operations on devices
like terminals where an @code{lseek} call would lead to an error. like terminals where an @code{lseek} call would lead to an error.
@item off_t aio_offset @item off_t aio_offset
This element specified at which offset in the file the operation (input This element specifies at which offset in the file the operation (input
or output) is performed. Since the operation are carried in arbitrary or output) is performed. Since the operations are carried out in arbitrary
order and more than one operation for one file descriptor can be order and more than one operation for one file descriptor can be
started, one cannot expect a current read/write position of the file started, one cannot expect a current read/write position of the file
descriptor. descriptor.
@ -1451,10 +1451,10 @@ AIO operation.
@item struct sigevent aio_sigevent @item struct sigevent aio_sigevent
This element specifies how the calling process is notified once the This element specifies how the calling process is notified once the
operation terminated. If the @code{sigev_notify} element is operation terminates. If the @code{sigev_notify} element is
@code{SIGEV_NONE} no notification is send. If it is @code{SIGEV_SIGNAL} @code{SIGEV_NONE} no notification is send. If it is @code{SIGEV_SIGNAL}
the signal determined by @code{sigev_signo} is send. Otherwise the signal determined by @code{sigev_signo} is send. Otherwise
@code{sigev_notify} must be @code{SIGEV_THREAD} in which case a thread @code{sigev_notify} must be @code{SIGEV_THREAD}. In this case a thread
is created which starts executing the function pointed to by is created which starts executing the function pointed to by
@code{sigev_notify_function}. @code{sigev_notify_function}.
@ -1478,12 +1478,12 @@ Start a write operation. Write @code{aio_nbytes} bytes starting at
@item LIO_NOP @item LIO_NOP
Do nothing for this control block. This value is useful sometimes when Do nothing for this control block. This value is useful sometimes when
an array of @code{struct aiocb} values contains holes, i.e., some of the an array of @code{struct aiocb} values contains holes, i.e., some of the
values must not be handled allthough the whole array is presented to the values must not be handled although the whole array is presented to the
@code{lio_listio} function. @code{lio_listio} function.
@end vtable @end vtable
@end table @end table
When the sourcs are compiled using @code{_FILE_OFFSET_BITS == 64} on a When the sources are compiled using @code{_FILE_OFFSET_BITS == 64} on a
32 bits machine this type is in fact @code{struct aiocb64} since the LFS 32 bits machine this type is in fact @code{struct aiocb64} since the LFS
interface transparently replaces the @code{struct aiocb} definition. interface transparently replaces the @code{struct aiocb} definition.
@end deftp @end deftp
@ -1529,7 +1529,7 @@ AIO operation.
@item struct sigevent aio_sigevent @item struct sigevent aio_sigevent
This element specifies how the calling process is notified once the This element specifies how the calling process is notified once the
operation terminated. If the @code{sigev_notify} element is operation terminates. If the @code{sigev_notify} element is
@code{SIGEV_NONE} no notification is send. If it is @code{SIGEV_SIGNAL} @code{SIGEV_NONE} no notification is send. If it is @code{SIGEV_SIGNAL}
the signal determined by @code{sigev_signo} is send. Otherwise the signal determined by @code{sigev_signo} is send. Otherwise
@code{sigev_notify} must be @code{SIGEV_THREAD} in which case a thread @code{sigev_notify} must be @code{SIGEV_THREAD} in which case a thread
@ -1539,7 +1539,7 @@ which starts executing the function pointeed to by
@item int aio_lio_opcode @item int aio_lio_opcode
This element is only used by the @code{lio_listio} and This element is only used by the @code{lio_listio} and
@code{[lio_listio64} functions. Since these functions allow to start an @code{[lio_listio64} functions. Since these functions allow to start an
arbitrary number of operations at once and since each operationcan be arbitrary number of operations at once and since each operation can be
input or output (or nothing) the information must be stored in the input or output (or nothing) the information must be stored in the
control block. See the description of @code{struct aiocb} for a description control block. See the description of @code{struct aiocb} for a description
of the possible values. of the possible values.
@ -1566,7 +1566,7 @@ aiocb64} since the LFS replaces transparently the old interface.
@deftypefun int aio_read (struct aiocb *@var{aiocbp}) @deftypefun int aio_read (struct aiocb *@var{aiocbp})
This function initiates an asynchronous read operation. The function This function initiates an asynchronous read operation. The function
call immediately returns after the operation was enqueued or when an call immediately returns after the operation was enqueued or when an
error was encoutered. error was encountered.
The first @code{aiocbp->aio_nbytes} bytes of the file for which The first @code{aiocbp->aio_nbytes} bytes of the file for which
@code{aiocbp->aio_fildes} is a descriptor are written to the buffer @code{aiocbp->aio_fildes} is a descriptor are written to the buffer
@ -1593,8 +1593,8 @@ limitations.
The @code{aio_read} function is not implemented. The @code{aio_read} function is not implemented.
@item EBADF @item EBADF
The @code{aiocbp->aio_fildes} descriptor is not valid. This condition The @code{aiocbp->aio_fildes} descriptor is not valid. This condition
need not be recognized before enqueueing the request and so this error needs not be recognized before enqueueing the request and so this error
might also be signaled asynchrously. might also be signaled asynchronously.
@item EINVAL @item EINVAL
The @code{aiocbp->aio_offset} or @code{aiocbp->aio_reqpiro} value is The @code{aiocbp->aio_offset} or @code{aiocbp->aio_reqpiro} value is
invalid. This condition need not be recognized before enqueueing the invalid. This condition need not be recognized before enqueueing the
@ -1609,7 +1609,7 @@ functions. As long as the value returned by @code{aio_error} is
otherwise the value is to be interpreted as an error code. If the otherwise the value is to be interpreted as an error code. If the
function terminated the result of the operation can be get using a call function terminated the result of the operation can be get using a call
to @code{aio_return}. The returned value is the same as an equivalent to @code{aio_return}. The returned value is the same as an equivalent
call to @code{read} would have returned. Possible error code returned call to @code{read} would have returned. Possible error codes returned
by @code{aio_error} are: by @code{aio_error} are:
@table @code @table @code
@ -1635,7 +1635,7 @@ difference is that on @w{32 bits} machines the file descriptor should
be opened in the large file mode. Internally @code{aio_read64} uses be opened in the large file mode. Internally @code{aio_read64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the reading, Primitive}) to position the file descriptor correctly for the reading,
as opposed to @code{lseek} funcationality used in @code{aio_read}. as opposed to @code{lseek} functionality used in @code{aio_read}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this
function is available under the name @code{aio_read} and so transparently function is available under the name @code{aio_read} and so transparently
@ -1650,7 +1650,7 @@ of functions with a very similar interface.
@deftypefun int aio_write (struct aiocb *@var{aiocbp}) @deftypefun int aio_write (struct aiocb *@var{aiocbp})
This function initiates an asynchronous write operation. The function This function initiates an asynchronous write operation. The function
call immediately returns after the operation was enqueued or if before call immediately returns after the operation was enqueued or if before
this happens an error was encoutered. this happens an error was encountered.
The first @code{aiocbp->aio_nbytes} bytes from the buffer starting at The first @code{aiocbp->aio_nbytes} bytes from the buffer starting at
@code{aiocbp->aio_buf} are written to the file for which @code{aiocbp->aio_buf} are written to the file for which
@ -1677,12 +1677,12 @@ limitations.
The @code{aio_write} function is not implemented. The @code{aio_write} function is not implemented.
@item EBADF @item EBADF
The @code{aiocbp->aio_fildes} descriptor is not valid. This condition The @code{aiocbp->aio_fildes} descriptor is not valid. This condition
need not be recognized before enqueueing the request and so this error needs not be recognized before enqueueing the request and so this error
might also be signaled asynchrously. might also be signaled asynchronously.
@item EINVAL @item EINVAL
The @code{aiocbp->aio_offset} or @code{aiocbp->aio_reqpiro} value is The @code{aiocbp->aio_offset} or @code{aiocbp->aio_reqpiro} value is
invalid. This condition need not be recognized before enqueueing the invalid. This condition needs not be recognized before enqueueing the
request and so this error might also be signaled asynchrously. request and so this error might also be signaled asynchronously.
@end table @end table
In the case @code{aio_write} returns zero the current status of the In the case @code{aio_write} returns zero the current status of the
@ -1715,11 +1715,11 @@ replaces the normal implementation.
@comment Unix98 @comment Unix98
@deftypefun int aio_write64 (struct aiocb *@var{aiocbp}) @deftypefun int aio_write64 (struct aiocb *@var{aiocbp})
This function is similar to the @code{aio_write} function. The only This function is similar to the @code{aio_write} function. The only
difference is that only @w{32 bits} machines the file descriptor should difference is that on @w{32 bits} machines the file descriptor should
be opened in the large file mode. Internally @code{aio_write64} uses be opened in the large file mode. Internally @code{aio_write64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the writing, Primitive}) to position the file descriptor correctly for the writing,
as opposed to @code{lseek} funcationality used in @code{aio_write}. as opposed to @code{lseek} functionality used in @code{aio_write}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this
function is available under the name @code{aio_write} and so transparently function is available under the name @code{aio_write} and so transparently
@ -1755,14 +1755,14 @@ a time. Another situation is where the @code{lio_listio} call was
cancelled before all requests are processed (@pxref{Cancel AIO cancelled before all requests are processed (@pxref{Cancel AIO
Operations}) and the remaining requests have to be reissued. Operations}) and the remaining requests have to be reissued.
The the other members of each element of the array pointed to by The other members of each element of the array pointed to by
@code{list} must have values suitable for the operation as described in @code{list} must have values suitable for the operation as described in
the documentation for @code{aio_read} and @code{aio_write} above. the documentation for @code{aio_read} and @code{aio_write} above.
The @var{mode} argument determines how @code{lio_listio} behaves after The @var{mode} argument determines how @code{lio_listio} behaves after
having enqueued all the requests. If @var{mode} is @code{LIO_WAIT} it having enqueued all the requests. If @var{mode} is @code{LIO_WAIT} it
waits until all requests terminated. Otherwise @var{mode} must be waits until all requests terminated. Otherwise @var{mode} must be
@code{LIO_NOWAIT} and in this case the function returns immeditely after @code{LIO_NOWAIT} and in this case the function returns immediately after
having enqueued all the requests. In this case the caller gets a having enqueued all the requests. In this case the caller gets a
notification of the termination of all requests according to the notification of the termination of all requests according to the
@var{sig} parameter. If @var{sig} is @code{NULL} no notification is @var{sig} parameter. If @var{sig} is @code{NULL} no notification is
@ -1793,7 +1793,7 @@ The resources necessary to queue all the requests are not available in
the moment. The error status for each element of @var{list} must be the moment. The error status for each element of @var{list} must be
checked which request failed. checked which request failed.
Another reason could be that the systemwide limit of AIO requests is Another reason could be that the system wide limit of AIO requests is
exceeded. This cannot be the case for the implementation on GNU systems exceeded. This cannot be the case for the implementation on GNU systems
since no arbitrary limits exist. since no arbitrary limits exist.
@item EINVAL @item EINVAL
@ -1801,7 +1801,7 @@ The @var{mode} parameter is invalid or @var{nent} is larger than
@code{AIO_LISTIO_MAX}. @code{AIO_LISTIO_MAX}.
@item EIO @item EIO
One or more of the request's I/O operations failed. The error status of One or more of the request's I/O operations failed. The error status of
each request should be checked which one failed. each request should be checked for which one failed.
@item ENOSYS @item ENOSYS
The @code{lio_listio} function is not supported. The @code{lio_listio} function is not supported.
@end table @end table
@ -1823,7 +1823,7 @@ difference is that only @w{32 bits} machines the file descriptor should
be opened in the large file mode. Internally @code{lio_listio64} uses be opened in the large file mode. Internally @code{lio_listio64} uses
functionality equivalent to @code{lseek64} (@pxref{File Position functionality equivalent to @code{lseek64} (@pxref{File Position
Primitive}) to position the file descriptor correctly for the reading or Primitive}) to position the file descriptor correctly for the reading or
writing, as opposed to @code{lseek} funcationality used in writing, as opposed to @code{lseek} functionality used in
@code{lio_listio}. @code{lio_listio}.
When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this When the sources are compiled with @code{_FILE_OFFSET_BITS == 64} this
@ -1835,7 +1835,7 @@ machines.
@node Status of AIO Operations @node Status of AIO Operations
@subsection Getting the Status of AIO Operations @subsection Getting the Status of AIO Operations
As already decsribes in the documentation of the functions in the last As already described in the documentation of the functions in the last
section it must be possible to get information about the status of a I/O section it must be possible to get information about the status of a I/O
request. When the operation is performed really asynchronous (as with request. When the operation is performed really asynchronous (as with
@code{aio_read} and @code{aio_write} and with @code{aio_listio} when the @code{aio_read} and @code{aio_write} and with @code{aio_listio} when the
@ -1847,11 +1847,11 @@ The following two function allow to get this kind of information.
@comment POSIX.1b @comment POSIX.1b
@deftypefun int aio_error (const struct aiocb *@var{aiocbp}) @deftypefun int aio_error (const struct aiocb *@var{aiocbp})
This function determines the error state of the request described by the This function determines the error state of the request described by the
@code{struct aiocb} variable pointed to by @var{aiocbp}. If the the @code{struct aiocb} variable pointed to by @var{aiocbp}. If the
request has not yet terminated the value returned is always request has not yet terminated the value returned is always
@code{EINPROGRESS}. Once the request has terminated the value @code{EINPROGRESS}. Once the request has terminated the value
@code{aio_error} returns is either @math{0} if the request completed @code{aio_error} returns is either @math{0} if the request completed
successfully or it returns the the value which would be stored in the successfully or it returns the value which would be stored in the
@code{errno} variable if the request would have been done using @code{errno} variable if the request would have been done using
@code{read}, @code{write}, or @code{fsync}. @code{read}, @code{write}, or @code{fsync}.
@ -1886,8 +1886,8 @@ carried out by the request described in the variable pointed to by
by @code{aio_error} is @code{EINPROGRESS} the return of this function is by @code{aio_error} is @code{EINPROGRESS} the return of this function is
undefined. undefined.
Once the request is finished this function can used used exactly once to Once the request is finished this function can be used exactly once to
retriece the return value. Following calls might lead to undefined retrieve the return value. Following calls might lead to undefined
behaviour. The return value itself is the value which would have been behaviour. The return value itself is the value which would have been
returned by the @code{read}, @code{write}, or @code{fsync} call. returned by the @code{read}, @code{write}, or @code{fsync} call.
@ -1917,10 +1917,10 @@ machines.
@subsection Getting into a Consistent State @subsection Getting into a Consistent State
When dealing with asynchronous operations it is sometimes necessary to When dealing with asynchronous operations it is sometimes necessary to
get into a consistent state. This would mean for AIO that ones wants to get into a consistent state. This would mean for AIO that one wants to
know whether a certain request or a group of request were processed. know whether a certain request or a group of request were processed.
This could be done by waiting for the notification sent by the system This could be done by waiting for the notification sent by the system
after the operation terminated but this sometimes would been a wasting after the operation terminated but this sometimes would mean wasting
resources (mainly computation time). Instead POSIX.1b defines two resources (mainly computation time). Instead POSIX.1b defines two
functions which will help with most kinds of consistency. functions which will help with most kinds of consistency.
@ -1933,7 +1933,7 @@ defined.
@comment POSIX.1b @comment POSIX.1b
@deftypefun int aio_fsync (int @var{op}, struct aiocb *@var{aiocbp}) @deftypefun int aio_fsync (int @var{op}, struct aiocb *@var{aiocbp})
Calling this function forces all I/O operations operating queued at the Calling this function forces all I/O operations operating queued at the
time of the function call operating on the file desriptor time of the function call operating on the file descriptor
@code{aiocbp->aio_fildes} into the synchronized I/O completion state @code{aiocbp->aio_fildes} into the synchronized I/O completion state
(@pxref{Synchronizing I/O}). The @code{aio_fsync} function return (@pxref{Synchronizing I/O}). The @code{aio_fsync} function return
immediately but the notification through the method described in immediately but the notification through the method described in
@ -1944,12 +1944,12 @@ after the synchronization request are not effected.
If @var{op} is @code{O_DSYNC} the synchronization happens as with a call If @var{op} is @code{O_DSYNC} the synchronization happens as with a call
to @code{fdatasync}. Otherwise @var{op} should be @code{O_SYNC} and to @code{fdatasync}. Otherwise @var{op} should be @code{O_SYNC} and
thee synchronization happens as with @code{fsync}. the synchronization happens as with @code{fsync}.
As long as the synchronization hasn't happened a call to As long as the synchronization has not happened a call to
@code{aio_error} with the reference to the object pointed to by @code{aio_error} with the reference to the object pointed to by
@var{aiocbp} returns @code{EINPROGRESS}. Once the synchronizatio is @var{aiocbp} returns @code{EINPROGRESS}. Once the synchronization is
done @code{aio_error} return @math{0} if the synchronization wasn done @code{aio_error} return @math{0} if the synchronization was not
successful. Otherwise the value returned is the value to which the successful. Otherwise the value returned is the value to which the
@code{fsync} or @code{fdatasync} function would have set the @code{fsync} or @code{fdatasync} function would have set the
@code{errno} variable. In this case nothing can be assumed about the @code{errno} variable. In this case nothing can be assumed about the
@ -1961,7 +1961,7 @@ successfully filed. Otherwise the return value is @math{-1} and
@table @code @table @code
@item EAGAIN @item EAGAIN
The request coulnd't be enqueued due to temporary lack of resources. The request could not be enqueued due to temporary lack of resources.
@item EBADF @item EBADF
The file descriptor @code{aiocbp->aio_fildes} is not valid or not open The file descriptor @code{aiocbp->aio_fildes} is not valid or not open
for writing. for writing.
@ -1990,7 +1990,7 @@ transparently replaces the interface for small files on 32 bits
machines. machines.
@end deftypefun @end deftypefun
Another method of synchronization is to until one or more requests of a Another method of synchronization is to wait until one or more requests of a
specific set terminated. This could be achieved by the @code{aio_*} specific set terminated. This could be achieved by the @code{aio_*}
functions to notify the initiating process about the termination but in functions to notify the initiating process about the termination but in
some situations this is not the ideal solution. In a program which some situations this is not the ideal solution. In a program which
@ -2020,7 +2020,7 @@ finished. If @var{timeout} is not @code{NULL} the process remains
suspended at as long as specified in @var{timeout}. In this case suspended at as long as specified in @var{timeout}. In this case
@code{aio_suspend} returns with an error. @code{aio_suspend} returns with an error.
The return value of the function is @math{0} is one or more requests The return value of the function is @math{0} if one or more requests
from the @var{list} have terminated. Otherwise the function returns from the @var{list} have terminated. Otherwise the function returns
@math{-1} and @code{errno} is set to one of the following values: @math{-1} and @code{errno} is set to one of the following values:
@ -2135,7 +2135,7 @@ The POSIX standard does not specify how the AIO functions are
implemented. They could be system calls but it is also possible to implemented. They could be system calls but it is also possible to
emulate them at userlevel. emulate them at userlevel.
At least the available implementatio at the point of this writing is a At least the available implementation at the point of this writing is a
userlevel implementation which uses threads for handling the enqueued userlevel implementation which uses threads for handling the enqueued
requests. This implementation requires to make some decisions about requests. This implementation requires to make some decisions about
limitations but hard limitations are something which better should be limitations but hard limitations are something which better should be

View File

@ -27,7 +27,7 @@ As mentioned above the message catalog handling provides easy
extendibility by using external data files which contain the message extendibility by using external data files which contain the message
translations. I.e., these files contain for each of the messages used translations. I.e., these files contain for each of the messages used
in the program a translation for the appropriate language. So the tasks in the program a translation for the appropriate language. So the tasks
of the message handling functions functions are of the message handling functions are
@itemize @bullet @itemize @bullet
@item @item
@ -537,7 +537,7 @@ following slavishly the X/Open specs and not relying on the extension
and by using the GNU extensions. We will take a look at the former and by using the GNU extensions. We will take a look at the former
method first to understand the benefits of extensions. method first to understand the benefits of extensions.
@subsubsection Not using symbolic symbolic names @subsubsection Not using symbolic names
Since the X/Open format of the message catalog files does not allow Since the X/Open format of the message catalog files does not allow
symbol names we have to work with numbers all the time. When we start symbol names we have to work with numbers all the time. When we start

View File

@ -2176,7 +2176,7 @@ provided only for compatibility with SVID.
One convenient use for @code{raise} is to reproduce the default behavior One convenient use for @code{raise} is to reproduce the default behavior
of a signal that you have trapped. For instance, suppose a user of your of a signal that you have trapped. For instance, suppose a user of your
program types the SUSP character (usually @kbd{C-z}; @pxref{Special program types the SUSP character (usually @kbd{C-z}; @pxref{Special
Characters}) to send it an interactive stop stop signal Characters}) to send it an interactive stop signal
(@code{SIGTSTP}), and you want to clean up some internal data buffers (@code{SIGTSTP}), and you want to clean up some internal data buffers
before stopping. You might set this up like this: before stopping. You might set this up like this:

View File

@ -225,7 +225,7 @@ This structure is used with the @code{getfsent}, @code{getfsspec}, and
@table @code @table @code
@item char *fs_spec @item char *fs_spec
This element desribes the device from which the filesystem is mounted. This element describes the device from which the filesystem is mounted.
Normally this is the name of a special device, such as a hard disk Normally this is the name of a special device, such as a hard disk
partition, but it could also be a more or less generic string. For partition, but it could also be a more or less generic string. For
@dfn{NFS} it would be a hostname and directory name combination. @dfn{NFS} it would be a hostname and directory name combination.
@ -236,8 +236,8 @@ function predates @w{ISO C}. The same is true for the other string
elements of this structure. elements of this structure.
@item char *fs_file @item char *fs_file
This desribes the mount point on the local system. I.e., accessing any This describes the mount point on the local system. I.e., accessing any
file in this filesystem has this string implicitly or explicitly as a file in this filesystem has implicitly or explicitly this string as a
prefix. prefix.
@item char *fs_vfstype @item char *fs_vfstype
@ -422,10 +422,10 @@ Expands to @code{"defaults"}. This option should be used alone since it
indicates all values for the custumizable values are chosen to be the indicates all values for the custumizable values are chosen to be the
default. default.
@item MNTOPT_RO @item MNTOPT_RO
Expands to @code{"ro"}. See the the @code{FSTAB_RO} value, it means the Expands to @code{"ro"}. See the @code{FSTAB_RO} value, it means the
filesystem is mounted read-only. filesystem is mounted read-only.
@item MNTOPT_RW @item MNTOPT_RW
Expand to @code{"rw"}. See the the @code{FSTAB_RW} value, it means the Expand to @code{"rw"}. See the @code{FSTAB_RW} value, it means the
filesystem is mounted with read and write permissions. filesystem is mounted with read and write permissions.
@item MNTOPT_SUID @item MNTOPT_SUID
Expands to @code{"suid"}. This means that the SUID bit (@pxref{How Expands to @code{"suid"}. This means that the SUID bit (@pxref{How

View File

@ -1064,7 +1064,7 @@ The second format is used when there is Daylight Saving Time:
The initial @var{std} and @var{offset} specify the standard time zone, as The initial @var{std} and @var{offset} specify the standard time zone, as
described above. The @var{dst} string and @var{offset} specify the name described above. The @var{dst} string and @var{offset} specify the name
and offset for the corresponding daylight saving time time zone; if the and offset for the corresponding daylight saving time zone; if the
@var{offset} is omitted, it defaults to one hour ahead of standard time. @var{offset} is omitted, it defaults to one hour ahead of standard time.
The remainder of the specification describes when daylight saving time is The remainder of the specification describes when daylight saving time is

View File

@ -1170,7 +1170,7 @@ database specified by @var{wtmp_file}. For possible values for the
subset of these functions, they are not standardized. There are often subset of these functions, they are not standardized. There are often
subtle differences in the return types, and there are considerable subtle differences in the return types, and there are considerable
differences between the various definitions of @code{struct utmp}. When differences between the various definitions of @code{struct utmp}. When
programming for the GNU system, it is probably probably best to stick programming for the GNU system, it is probably best to stick
with the functions described in this section. If however, you want your with the functions described in this section. If however, you want your
program to be portable, consider using the XPG functions described in program to be portable, consider using the XPG functions described in
@ref{XPG Functions}, or take a look at the BSD compatible functions in @ref{XPG Functions}, or take a look at the BSD compatible functions in
@ -1974,4 +1974,3 @@ found in the netgroup. The return value is @code{0} if the netgroup
itself is not found, the netgroup does not contain the triple or itself is not found, the netgroup does not contain the triple or
internal errors occurred. internal errors occurred.
@end deftypefun @end deftypefun

View File

@ -284,13 +284,19 @@ svctcp_destroy (SVCXPRT *xprt)
* All read operations timeout after 35 seconds. * All read operations timeout after 35 seconds.
* A timeout is fatal for the connection. * A timeout is fatal for the connection.
*/ */
static struct timeval wait_per_try = static struct timeval wait_per_try = {35, 0};
{35, 0};
/* /*
* reads data from the tcp connection. * reads data from the tcp connection.
* any error is fatal and the connection is closed. * any error is fatal and the connection is closed.
* (And a read of zero bytes is a half closed stream => error.) * (And a read of zero bytes is a half closed stream => error.)
*
* Note: we have to be careful here not to allow ourselves to become
* blocked too long in this routine. While we're waiting for data from one
* client, another client may be trying to connect. To avoid this situation,
* some code from svc_run() is transplanted here: the select() loop checks
* all RPC descriptors including the one we want and calls svc_getreqset2()
* to handle new requests if any are detected.
*/ */
static int static int
readtcp (char *xprtptr, char *buf, int len) readtcp (char *xprtptr, char *buf, int len)
@ -298,39 +304,41 @@ readtcp (char *xprtptr, char *buf, int len)
SVCXPRT *xprt = (SVCXPRT *)xprtptr; SVCXPRT *xprt = (SVCXPRT *)xprtptr;
int sock = xprt->xp_sock; int sock = xprt->xp_sock;
#ifdef FD_SETSIZE #ifdef FD_SETSIZE
fd_set mask;
fd_set readfds; fd_set readfds;
FD_ZERO (&mask);
FD_SET (sock, &mask);
#else #else
int mask = 1 << sock; int mask = 1 << sock;
int readfds; int readfds;
#endif /* def FD_SETSIZE */ #endif /* def FD_SETSIZE */
do while (1)
{ {
struct timeval timeout = wait_per_try; struct timeval timeout = wait_per_try;
readfds = mask; readfds = svc_fdset;
#ifdef FD_SETSIZE
FD_SET (sock, &readfds);
#else
readfds |= (1 << sock);
#endif /* def FD_SETSIZE */
if (select (_rpc_dtablesize (), &readfds, (fd_set *) NULL, if (select (_rpc_dtablesize (), &readfds, (fd_set *) NULL,
(fd_set *) NULL, &timeout) <= 0) (fd_set *) NULL, &timeout) <= 0)
{ {
if (errno == EINTR) if (errno == EINTR)
{
continue; continue;
}
goto fatal_err; goto fatal_err;
} }
#ifdef FD_SETSIZE #ifdef FD_SETSIZE
} if (FD_ISSET (sock, &readfds))
while (!FD_ISSET (sock, &readfds));
#else #else
} if (readfds == mask)
while (readfds != mask);
#endif /* def FD_SETSIZE */ #endif /* def FD_SETSIZE */
if ((len = read (sock, buf, len)) > 0) break;
{
return len; svc_getreqset (&readfds);
} }
if ((len = read (sock, buf, len)) > 0)
return len;
fatal_err: fatal_err:
((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED; ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
return -1; return -1;

View File

@ -565,16 +565,20 @@ set_input_fragment (RECSTREAM *rstrm)
{ {
u_long header; u_long header;
if (!get_input_bytes (rstrm, (caddr_t) & header, BYTES_PER_XDR_UNIT)) if (! get_input_bytes (rstrm, (caddr_t)&header, BYTES_PER_XDR_UNIT))
return FALSE; return FALSE;
header = ntohl (header); header = ntohl (header);
rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE; rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE;
/* /*
* Sanity check. Try not to accept wildly incorrect * Sanity check. Try not to accept wildly incorrect
* record sizes. * record sizes. Unfortunately, the only record size
* we can positively identify as being 'wildly incorrect'
* is zero. Ridiculously large record sizes may look wrong,
* but we don't have any way to be certain that they aren't
* what the client actually intended to send us.
*/ */
if ((header & (~LAST_FRAG)) > rstrm->recvsize) if ((header & (~LAST_FRAG)) == 0)
return(FALSE); return FALSE;
rstrm->fbtbc = header & ~LAST_FRAG; rstrm->fbtbc = header & ~LAST_FRAG;
return TRUE; return TRUE;
} }

45
sysdeps/i386/i686/ffs.c Normal file
View File

@ -0,0 +1,45 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
Copyright (C) 1991, 92, 93, 94, 97, 98 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <string.h>
#undef ffs
#ifdef __GNUC__
int
__ffs (x)
int x;
{
int cnt;
int tmp;
asm ("bsfl %2,%0\n" /* Count low bits in X and store in %1. */
"cmovel %1,%0\n" /* If number was zero, use -1 as result. */
: "=&r" (cnt), "=r" (tmp) : "rm" (x), "1" (-1));
return cnt + 1;
}
weak_alias (__ffs, ffs)
#else
#include <sysdeps/generic/ffs.c>
#endif