[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r23040 - in /fsf/trunk/libc: ./ benchtests/ elf/ iconv/ locale/programs/ math/ sunrpc/ sysdeps/mach/hurd/bits/ sysdeps/unix/...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r23040 - in /fsf/trunk/libc: ./ benchtests/ elf/ iconv/ locale/programs/ math/ sunrpc/ sysdeps/mach/hurd/bits/ sysdeps/unix/...
- From: eglibc@xxxxxxxxxx
- Date: Sat, 11 May 2013 00:02:23 -0000
Author: eglibc
Date: Sat May 11 00:02:21 2013
New Revision: 23040
Log:
Import glibc-mainline for 2013-05-11
Added:
fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/getgid.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/benchtests/bench-skeleton.c
fsf/trunk/libc/elf/sprof.c
fsf/trunk/libc/iconv/iconv_charmap.c
fsf/trunk/libc/iconv/iconv_prog.c
fsf/trunk/libc/locale/programs/charmap-dir.c
fsf/trunk/libc/locale/programs/locfile.c
fsf/trunk/libc/math/gen-libm-test.pl
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/math/w_tgamma.c
fsf/trunk/libc/math/w_tgammaf.c
fsf/trunk/libc/math/w_tgammal.c
fsf/trunk/libc/sunrpc/rpc_main.c
fsf/trunk/libc/sysdeps/mach/hurd/bits/statvfs.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat May 11 00:02:21 2013
@@ -1,3 +1,78 @@
+2013-05-10 Christian GrÃÂnke <cgr_bugs@xxxxxxxxx>
+
+ [BZ #12387]
+ * sysdeps/unix/sysv/linux/sh/getgid.c: New file.
+
+2013-05-10 Pino Toscano <toscano.pino@xxxxxxxxxx>
+
+ * sysdeps/mach/hurd/bits/statvfs.h: Add ST_NOATIME.
+
+2013-05-10 Andreas Jaeger <aj@xxxxxxx>
+
+ [BZ #15448]
+ * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S)
+ (__CPU_CLR_S, __CPU_ISSET_S): Avoid integer overflow.
+
+2013-05-10 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * math/gen-libm-test.pl (adjust_arg): New function.
+ (special_functions): Handle generating output in both functions
+ and arrays.
+ (parse_args): Likewise.
+ (generate_testfile): Handle START_DATA and END_DATA. Pass extra
+ $in_func argument to parse_args.
+ * math/libm-test.inc (struct test_f_f_data): New type.
+ (IF_ROUND_INIT_): New macro.
+ (IF_ROUND_INIT_FE_DOWNWARD): Likewise.
+ (IF_ROUND_INIT_FE_TONEAREST): Likewise.
+ (IF_ROUND_INIT_FE_TOWARDZERO): Likewise.
+ (IF_ROUND_INIT_FE_UPWARD): Likewise.
+ (ROUND_RESTORE_): Likewise.
+ (ROUND_RESTORE_FE_DOWNWARD): Likewise.
+ (ROUND_RESTORE_FE_TONEAREST): Likewise.
+ (ROUND_RESTORE_FE_TOWARDZERO): Likewise.
+ (ROUND_RESTORE_FE_UPWARD): Likewise.
+ (RUN_TEST_LOOP_f_f): New macro.
+ (acos_test_data): New variable.
+ (acos_test): Run tests with RUN_TEST_LOOP_f_f.
+ (acos_tonearest_test_data): New variable.
+ (acos_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+
+2013-05-10 Siddhesh Poyarekar <siddhesh@xxxxxxxxxx>
+
+ * benchtests/bench-skeleton.c (startup): Fix coding style.
+
+2013-05-10 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ [BZ #6809]
+ * math/w_tgamma.c (__tgamma): Also call __kernel_standard for
+ negative infinity argument.
+ * math/w_tgammaf.c (__tgammaf): Also call __kernel_standard_f for
+ negative infinity argument.
+ * math/w_tgammal.c (__tgammal): Also call __kernel_standard_l for
+ negative infinity argument.
+ * math/libm-test.inc (tgamma_test): Expect errno to be set for
+ domain errors.
+
+2013-05-10 Florian Weimer <fweimer@xxxxxxxxxx>
+
+ * elf/sprof.c (load_profdata): Use fstat64 instead of fstat.
+ * iconv/iconv_charmap.c (charmap_conversion): Likewise.
+ * iconv/iconv_prog.c (main): Likewise.
+ * locale/programs/charmap-dir.c (charmap_readdir)
+ (fopen_uncompressed): Likewise.
+ * locale/programs/locfile.c (siblings_uncached)
+ (write_locale_data): Use lstat64 instead of lstat.
+ * sunrpc/rpc_main.c (find_cpp, checkfiles): Use stat64 instead of
+ stat.
+
+2013-05-10 Andreas Jaeger <aj@xxxxxxx>
+
+ [BZ #15395]
+ * sunrpc/rpc_main.c (main): Invoke setlocale and textdomain for
+ localization.
+ Include <locale.h>.
+
2013-05-09 Carlos O'Donell <carlos@xxxxxxxxxx>
* elf/dl-close.c (_dl_close_worker): Add comments.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat May 11 00:02:21 2013
@@ -9,14 +9,15 @@
* The following bugs are resolved with this release:
- 2546, 2560, 5159, 10060, 10062, 10357, 11120, 11561, 12723, 13550, 13889,
- 13951, 13988, 14142, 14176, 14200, 14280, 14293, 14317, 14327, 14478,
- 14496, 14686, 14812, 14888, 14920, 14952, 14964, 14981, 14982, 14985,
- 14994, 14996, 15003, 15006, 15007, 15020, 15023, 15036, 15054, 15055,
- 15062, 15078, 15084, 15085, 15086, 15160, 15214, 15221, 15232, 15234,
- 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15335,
- 15336, 15337, 15342, 15346, 15359, 15361, 15366, 15380, 15394, 15405,
- 15406, 15409, 15416, 15418, 15419, 15423, 15426, 15429.
+ 2546, 2560, 5159, 6809, 10060, 10062, 10357, 11120, 11561, 12387, 12723,
+ 13550, 13889, 13951, 13988, 14142, 14176, 14200, 14280, 14293, 14317,
+ 14327, 14478, 14496, 14686, 14812, 14888, 14920, 14952, 14964, 14981,
+ 14982, 14985, 14994, 14996, 15003, 15006, 15007, 15020, 15023, 15036,
+ 15054, 15055, 15062, 15078, 15084, 15085, 15086, 15160, 15214, 15221,
+ 15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327,
+ 15330, 15335, 15336, 15337, 15342, 15346, 15359, 15361, 15366, 15380,
+ 15394, 15395, 15405, 15406, 15409, 15416, 15418, 15419, 15423, 15426,
+ 15429, 15448.
* CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
#15078).
Modified: fsf/trunk/libc/benchtests/bench-skeleton.c
==============================================================================
--- fsf/trunk/libc/benchtests/bench-skeleton.c (original)
+++ fsf/trunk/libc/benchtests/bench-skeleton.c Sat May 11 00:02:21 2013
@@ -23,7 +23,9 @@
#include <inttypes.h>
volatile unsigned int dontoptimize = 0;
-void startup ()
+
+void
+startup (void)
{
/* This loop should cause CPU to switch to maximal freqency.
This makes subsequent measurement more accurate. We need a side effect
@@ -31,9 +33,7 @@
This should be enough to cause CPU to speed up and it is simpler than
running loop for constant time. This is used when user does not have root
access to set a constant freqency. */
-
- int k;
- for (k = 0; k < 10000000; k++)
+ for (int k = 0; k < 10000000; k++)
dontoptimize += 23 * dontoptimize + 2;
}
Modified: fsf/trunk/libc/elf/sprof.c
==============================================================================
--- fsf/trunk/libc/elf/sprof.c (original)
+++ fsf/trunk/libc/elf/sprof.c Sat May 11 00:02:21 2013
@@ -744,7 +744,7 @@
{
struct profdata *result;
int fd;
- struct stat st;
+ struct stat64 st;
void *addr;
uint32_t *narcsp;
size_t fromlimit;
@@ -783,7 +783,7 @@
/* We have found the file, now make sure it is the right one for the
data file. */
- if (fstat (fd, &st) < 0)
+ if (fstat64 (fd, &st) < 0)
{
error (0, errno, _("while stat'ing profiling data file"));
close (fd);
Modified: fsf/trunk/libc/iconv/iconv_charmap.c
==============================================================================
--- fsf/trunk/libc/iconv/iconv_charmap.c (original)
+++ fsf/trunk/libc/iconv/iconv_charmap.c Sat May 11 00:02:21 2013
@@ -171,11 +171,11 @@
}
#ifdef _POSIX_MAPPED_FILES
- struct stat st;
+ struct stat64 st;
char *addr;
/* We have possibilities for reading the input file. First try
to mmap() it since this will provide the fastest solution. */
- if (fstat (fd, &st) == 0
+ if (fstat64 (fd, &st) == 0
&& ((addr = mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE,
fd, 0)) != MAP_FAILED))
{
Modified: fsf/trunk/libc/iconv/iconv_prog.c
==============================================================================
--- fsf/trunk/libc/iconv/iconv_prog.c (original)
+++ fsf/trunk/libc/iconv/iconv_prog.c Sat May 11 00:02:21 2013
@@ -275,7 +275,7 @@
do
{
#ifdef _POSIX_MAPPED_FILES
- struct stat st;
+ struct stat64 st;
char *addr;
#endif
int fd, ret;
@@ -300,7 +300,7 @@
#ifdef _POSIX_MAPPED_FILES
/* We have possibilities for reading the input file. First try
to mmap() it since this will provide the fastest solution. */
- if (fstat (fd, &st) == 0
+ if (fstat64 (fd, &st) == 0
&& ((addr = mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE,
fd, 0)) != MAP_FAILED))
{
Modified: fsf/trunk/libc/locale/programs/charmap-dir.c
==============================================================================
--- fsf/trunk/libc/locale/programs/charmap-dir.c (original)
+++ fsf/trunk/libc/locale/programs/charmap-dir.c Sat May 11 00:02:21 2013
@@ -121,9 +121,9 @@
else
#endif
{
- struct stat statbuf;
-
- if (stat (cdir->pathname, &statbuf) < 0)
+ struct stat64 statbuf;
+
+ if (stat64 (cdir->pathname, &statbuf) < 0)
continue;
mode = statbuf.st_mode;
@@ -167,10 +167,10 @@
pfd = open (pathname, O_RDONLY);
if (pfd >= 0)
{
- struct stat statbuf;
+ struct stat64 statbuf;
int fd[2];
- if (fstat (pfd, &statbuf) >= 0
+ if (fstat64 (pfd, &statbuf) >= 0
&& S_ISREG (statbuf.st_mode)
&& pipe (fd) >= 0)
{
Modified: fsf/trunk/libc/locale/programs/locfile.c
==============================================================================
--- fsf/trunk/libc/locale/programs/locfile.c (original)
+++ fsf/trunk/libc/locale/programs/locfile.c Sat May 11 00:02:21 2013
@@ -355,7 +355,7 @@
{
size_t len;
char *base, *p;
- struct stat output_stat;
+ struct stat64 output_stat;
DIR *dirp;
int nelems;
const char **elems;
@@ -378,7 +378,7 @@
len = p - base;
/* Get the properties of output_path. */
- if (lstat (output_path, &output_stat) < 0 || !S_ISDIR (output_stat.st_mode))
+ if (lstat64 (output_path, &output_stat) < 0 || !S_ISDIR (output_stat.st_mode))
return NULL;
/* Iterate through the directories in base directory. */
@@ -392,7 +392,7 @@
struct dirent64 *other_dentry;
const char *other_name;
char *other_path;
- struct stat other_stat;
+ struct stat64 other_stat;
other_dentry = readdir64 (dirp);
if (other_dentry == NULL)
@@ -407,7 +407,7 @@
other_path[len] = '/';
strcpy (other_path + len + 1, other_name);
- if (lstat (other_path, &other_stat) >= 0
+ if (lstat64 (other_path, &other_stat) >= 0
&& S_ISDIR (other_stat.st_mode)
&& other_stat.st_uid == output_stat.st_uid
&& other_stat.st_gid == output_stat.st_gid
@@ -580,9 +580,9 @@
fd = -2;
if (strcmp (category, "LC_MESSAGES") == 0)
{
- struct stat st;
-
- if (stat (fname, &st) < 0)
+ struct stat64 st;
+
+ if (stat64 (fname, &st) < 0)
{
if (mkdir (fname, 0777) >= 0)
{
@@ -659,9 +659,9 @@
other_paths = siblings (output_path);
if (other_paths != NULL)
{
- struct stat fname_stat;
-
- if (lstat (fname, &fname_stat) >= 0
+ struct stat64 fname_stat;
+
+ if (lstat64 (fname, &fname_stat) >= 0
&& S_ISREG (fname_stat.st_mode))
{
const char *fname_tail = fname + strlen (output_path);
@@ -680,14 +680,14 @@
const char *other_path = *other_p;
size_t other_path_len = strlen (other_path);
char *other_fname;
- struct stat other_fname_stat;
+ struct stat64 other_fname_stat;
other_fname =
(char *) xmalloc (other_path_len + strlen (fname_tail) + 1);
memcpy (other_fname, other_path, other_path_len);
strcpy (other_fname + other_path_len, fname_tail);
- if (lstat (other_fname, &other_fname_stat) >= 0
+ if (lstat64 (other_fname, &other_fname_stat) >= 0
&& S_ISREG (other_fname_stat.st_mode)
/* Consider only files on the same device.
Otherwise hard linking won't work anyway. */
Modified: fsf/trunk/libc/math/gen-libm-test.pl
==============================================================================
--- fsf/trunk/libc/math/gen-libm-test.pl (original)
+++ fsf/trunk/libc/math/gen-libm-test.pl Sat May 11 00:02:21 2013
@@ -185,10 +185,21 @@
return $rest;
}
+# Adjust an argument or expected value for use in a constant
+# initializer.
+sub adjust_arg {
+ my ($arg, $in_func) = @_;
+ if (!$in_func) {
+ $arg =~ s/(plus_zero|minus_zero|plus_infty|minus_infty|qnan_value
+ |max_value|min_value|min_subnorm_value)/\U$1\E_INIT/xg;
+ }
+ return $arg;
+}
+
# Treat some functions especially.
# Currently only sincos needs extra treatment.
sub special_functions {
- my ($file, $args) = @_;
+ my ($file, $in_func, $args) = @_;
my (@args, $str, $test, $cline);
@args = split /,\s*/, $args;
@@ -196,33 +207,43 @@
unless ($args[0] =~ /sincos/) {
die ("Don't know how to handle $args[0] extra.");
}
- $cline = " RUN_TEST_sincos ($args[1]";
+ if ($in_func) {
+ $cline = " RUN_TEST_sincos (" . adjust_arg ($args[1], $in_func);
+ } else {
+ $cline = " { " . adjust_arg ($args[1], $in_func);
+ }
$str = 'sincos (' . &beautify ($args[1]) . ', &sin_res, &cos_res)';
# handle sin
$test = $str . ' puts ' . &beautify ($args[2]) . ' in sin_res';
- $cline .= ", \"$test\", sin_res, $args[2]";
+ my ($sin_res_var) = ($in_func ? ", sin_res" : "");
+ $cline .= ", \"$test\"$sin_res_var, " . adjust_arg ($args[2], $in_func);
$cline .= &new_test ($test, $args[4], 0);
# handle cos
$test = $str . ' puts ' . &beautify ($args[3]) . ' in cos_res';
- $cline .= ", \"$test\", cos_res, $args[3]";
+ my ($cos_res_var) = ($in_func ? ", cos_res" : "");
+ $cline .= ", \"$test\"$cos_res_var, " . adjust_arg ($args[3], $in_func);
$cline .= &new_test ($test, $args[4], 1);
- $cline .= ");\n";
+ if ($in_func) {
+ $cline .= ");\n";
+ } else {
+ $cline .= " },\n";
+ }
print $file $cline;
}
# Parse the arguments to TEST_x_y
sub parse_args {
- my ($file, $descr, $fct, $args) = @_;
+ my ($file, $descr, $fct, $in_func, $args) = @_;
my (@args, $str, $descr_args, $descr_res, @descr);
my ($current_arg, $cline, $i);
my (@special);
my ($extra_var, $call);
if ($descr eq 'extra') {
- &special_functions ($file, $args);
+ &special_functions ($file, $in_func, $args);
return;
}
($descr_args, $descr_res) = split /_/,$descr, 2;
@@ -297,19 +318,29 @@
# Reset some variables to start again
$current_arg = 1;
$extra_var = 0;
- $cline = "RUN_TEST_$descr";
+ if ($in_func) {
+ $cline = "RUN_TEST_$descr";
+ } else {
+ $cline = "{ ";
+ }
# Special handling for some macros:
- if ($args[0] =~ /fpclassify|isnormal|isfinite|isinf|isnan|issignaling|signbit
- |isgreater|isgreaterequal|isless|islessequal
+ if ($in_func && $args[0] =~ /fpclassify|isnormal|isfinite|isinf|isnan
+ |issignaling|signbit|isgreater|isgreaterequal|isless|islessequal
|islessgreater|isunordered/x) {
- $cline = "${cline}_tg";
- }
- $cline .= " (\"$str\", $args[0]";
+ $cline = "${cline}_tg";
+ }
+ if ($in_func) {
+ $cline .= " (";
+ }
+ $cline .= "\"$str\"";
+ if ($in_func) {
+ $cline .= ", $args[0]";
+ }
@descr = split //,$descr_args;
for ($i=0; $i <= $#descr; $i++) {
# FLOAT, int, long int, long long int
if ($descr[$i] =~ /f|i|l|L/) {
- $cline .= ", $args[$current_arg]";
+ $cline .= ", " . adjust_arg ($args[$current_arg], $in_func);
$current_arg++;
next;
}
@@ -319,7 +350,8 @@
}
# complex
if ($descr[$i] eq 'c') {
- $cline .= ", $args[$current_arg], $args[$current_arg+1]";
+ $cline .= ", " . adjust_arg ($args[$current_arg], $in_func);
+ $cline .= ", " . adjust_arg ($args[$current_arg+1], $in_func);
$current_arg += 2;
next;
}
@@ -329,10 +361,11 @@
@descr = split //,$descr_res;
foreach (@descr) {
if ($_ =~ /b|f|i|l|L/ ) {
- $cline .= $args[$current_arg];
+ $cline .= adjust_arg ($args[$current_arg], $in_func);
$current_arg++;
} elsif ($_ eq 'c') {
- $cline .= "$args[$current_arg], $args[$current_arg+1]";
+ $cline .= adjust_arg ($args[$current_arg], $in_func);
+ $cline .= ", " . adjust_arg ($args[$current_arg+1], $in_func);
$current_arg += 2;
} elsif ($_ eq '1') {
push @special, $args[$current_arg];
@@ -348,11 +381,12 @@
my ($extra_expected) = $special[0];
my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0);
my ($str) = "$call sets x to $extra_expected";
+ my ($out_var) = ($in_func ? ", x" : "");
if (!$run_extra) {
$str = "";
$extra_expected = "0";
}
- $cline .= ", \"$str\", x, 123456789, $run_extra, $extra_expected";
+ $cline .= ", \"$str\"$out_var, 123456789, $run_extra, $extra_expected";
if ($run_extra) {
$cline .= &new_test ($str, undef, 0);
} else {
@@ -364,11 +398,12 @@
my ($extra_expected) = $special[0];
my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0);
my ($str) = "$call sets signgam to $extra_expected";
+ my ($out_var) = ($in_func ? ", signgam" : "");
if (!$run_extra) {
$str = "";
$extra_expected = "0";
}
- $cline .= ", \"$str\", signgam, 0, $run_extra, $extra_expected";
+ $cline .= ", \"$str\"$out_var, 0, $run_extra, $extra_expected";
if ($run_extra) {
$cline .= &new_test ($str, undef, 0);
} else {
@@ -380,11 +415,13 @@
my ($extra_expected) = $special[0];
my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0);
my ($str) = "$call sets x to $extra_expected";
+ my ($out_var) = ($in_func ? ", x" : "");
if (!$run_extra) {
$str = "";
$extra_expected = "0";
}
- $cline .= ", \"$str\", x, 123.456789, $run_extra, $extra_expected";
+ $extra_expected = adjust_arg ($extra_expected, $in_func);
+ $cline .= ", \"$str\"$out_var, 123.456789, $run_extra, $extra_expected";
if ($run_extra) {
$cline .= &new_test ($str, undef, 0);
} else {
@@ -396,11 +433,12 @@
my ($extra_expected) = $special[0];
my ($run_extra) = ($extra_expected ne "IGNORE" ? 1 : 0);
my ($str) = "$call sets x to $extra_expected";
+ my ($out_var) = ($in_func ? ", x" : "");
if (!$run_extra) {
$str = "";
$extra_expected = "0";
}
- $cline .= ", \"$str\", x, 123456789, $run_extra, $extra_expected";
+ $cline .= ", \"$str\"$out_var, 123456789, $run_extra, $extra_expected";
if ($run_extra) {
$cline .= &new_test ($str, undef, 0);
} else {
@@ -408,19 +446,24 @@
}
}
}
- print $file " $cline);\n";
+ if ($in_func) {
+ print $file " $cline);\n";
+ } else {
+ print $file " $cline },\n";
+ }
}
# Generate libm-test.c
sub generate_testfile {
my ($input, $output) = @_;
my ($lasttext);
- my (@args, $i, $str, $thisfct);
+ my (@args, $i, $str, $thisfct, $in_func);
open INPUT, $input or die ("Can't open $input: $!");
open OUTPUT, ">$output" or die ("Can't open $output: $!");
# Replace the special macros
+ $in_func = 0;
while (<INPUT>) {
# TEST_...
@@ -428,18 +471,30 @@
my ($descr, $args);
chop;
($descr, $args) = ($_ =~ /TEST_(\w+)\s*\((.*)\)/);
- &parse_args (\*OUTPUT, $descr, $thisfct, $args);
+ &parse_args (\*OUTPUT, $descr, $thisfct, $in_func, $args);
+ next;
+ }
+ # START_DATA (function)
+ if (/START_DATA/) {
+ ($thisfct) = ($_ =~ /START_DATA\s*\((.*)\)/);
+ $in_func = 0;
next;
}
# START (function)
if (/START/) {
($thisfct) = ($_ =~ /START\s*\((.*)\)/);
+ $in_func = 1;
print OUTPUT " init_max_error ();\n";
+ next;
+ }
+ # END_DATA (function)
+ if (/END_DATA/) {
next;
}
# END (function)
if (/END/) {
my ($fct, $line, $type);
+ $in_func = 0;
if (/complex/) {
s/,\s*complex\s*//;
$type = 'complex';
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sat May 11 00:02:21 2013
@@ -863,12 +863,53 @@
errno = 0;
}
+/* Structures for each kind of test. */
+struct test_f_f_data
+{
+ const char *test_name;
+ FLOAT arg;
+ FLOAT expected;
+ FLOAT max_ulp;
+ int exceptions;
+};
+
+/* Set the rounding mode, or restore the saved value. */
+#define IF_ROUND_INIT_ /* Empty. */
+#define IF_ROUND_INIT_FE_DOWNWARD \
+ int save_round_mode = fegetround (); \
+ if (fesetround (FE_DOWNWARD) == 0)
+#define IF_ROUND_INIT_FE_TONEAREST \
+ int save_round_mode = fegetround (); \
+ if (fesetround (FE_TONEAREST) == 0)
+#define IF_ROUND_INIT_FE_TOWARDZERO \
+ int save_round_mode = fegetround (); \
+ if (fesetround (FE_TOWARDZERO) == 0)
+#define IF_ROUND_INIT_FE_UPWARD \
+ int save_round_mode = fegetround (); \
+ if (fesetround (FE_UPWARD) == 0)
+#define ROUND_RESTORE_ /* Empty. */
+#define ROUND_RESTORE_FE_DOWNWARD \
+ fesetround (save_round_mode)
+#define ROUND_RESTORE_FE_TONEAREST \
+ fesetround (save_round_mode)
+#define ROUND_RESTORE_FE_TOWARDZERO \
+ fesetround (save_round_mode)
+#define ROUND_RESTORE_FE_UPWARD \
+ fesetround (save_round_mode)
+
/* Run an individual test, including any required setup and checking
- of results. */
+ of results, or loop over all tests in an array. */
#define RUN_TEST_f_f(TEST_NAME, FUNC_NAME, ARG, EXPECTED, \
MAX_ULP, EXCEPTIONS) \
check_float (TEST_NAME, FUNC (FUNC_NAME) (ARG), EXPECTED, \
MAX_ULP, EXCEPTIONS)
+#define RUN_TEST_LOOP_f_f(FUNC_NAME, ARRAY, ROUNDING_MODE) \
+ IF_ROUND_INIT_ ## ROUNDING_MODE \
+ for (size_t i = 0; i < sizeof (ARRAY) / sizeof (ARRAY)[0]; i++) \
+ RUN_TEST_f_f ((ARRAY)[i].test_name, FUNC_NAME, (ARRAY)[i].arg, \
+ (ARRAY)[i].expected, (ARRAY)[i].max_ulp, \
+ (ARRAY)[i].exceptions); \
+ ROUND_RESTORE_ ## ROUNDING_MODE
#define RUN_TEST_2_f(TEST_NAME, FUNC_NAME, ARG1, ARG2, EXPECTED, \
MAX_ULP, EXCEPTIONS) \
check_float (TEST_NAME, FUNC (FUNC_NAME) (ARG1, ARG2), EXPECTED, \
@@ -1012,6 +1053,43 @@
Please keep them alphabetically sorted!
****************************************************************************/
+static const struct test_f_f_data acos_test_data[] =
+ {
+ START_DATA (acos),
+ TEST_f_f (acos, plus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, minus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, qnan_value, qnan_value),
+
+ /* |x| > 1: */
+ TEST_f_f (acos, 1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, -1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, -max_value, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (acos, 0, M_PI_2l),
+ TEST_f_f (acos, minus_zero, M_PI_2l),
+ TEST_f_f (acos, 1, 0),
+ TEST_f_f (acos, -1, M_PIl),
+ TEST_f_f (acos, 0.5, M_PI_6l*2.0),
+ TEST_f_f (acos, -0.5, M_PI_6l*4.0),
+ TEST_f_f (acos, 0.75L, 0.722734247813415611178377352641333362L),
+ TEST_f_f (acos, 2e-17L, 1.57079632679489659923132169163975144L),
+ TEST_f_f (acos, 0.0625L, 1.50825556499840522843072005474337068L),
+ TEST_f_f (acos, 0x0.ffffffp0L, 3.4526698471620358760324948263873649728491e-4L),
+ TEST_f_f (acos, -0x0.ffffffp0L, 3.1412473866050770348750401337968641476999L),
+#ifndef TEST_FLOAT
+ TEST_f_f (acos, 0x0.ffffffff8p0L, 1.5258789062648029736620564947844627548516e-5L),
+ TEST_f_f (acos, -0x0.ffffffff8p0L, 3.1415773948007305904329067627145550395696L),
+ TEST_f_f (acos, 0x0.ffffffffffffp0L, 8.4293697021788088529885473244391795127130e-8L),
+ TEST_f_f (acos, -0x0.ffffffffffffp0L, 3.1415925692960962166745548533940296398054L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
+ TEST_f_f (acos, 0x0.ffffffffffffffffp0L, 3.2927225399135962333718255320079907245059e-10L),
+ TEST_f_f (acos, -0x0.ffffffffffffffffp0L, 3.1415926532605209844712837599423203309964L),
+#endif
+ END_DATA (acos)
+ };
+
static void
acos_test (void)
{
@@ -1022,46 +1100,26 @@
return;
START (acos);
-
- TEST_f_f (acos, plus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acos, minus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acos, qnan_value, qnan_value);
-
- /* |x| > 1: */
- TEST_f_f (acos, 1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acos, -1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acos, max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acos, -max_value, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (acos, 0, M_PI_2l);
- TEST_f_f (acos, minus_zero, M_PI_2l);
- TEST_f_f (acos, 1, 0);
- TEST_f_f (acos, -1, M_PIl);
- TEST_f_f (acos, 0.5, M_PI_6l*2.0);
- TEST_f_f (acos, -0.5, M_PI_6l*4.0);
- TEST_f_f (acos, 0.75L, 0.722734247813415611178377352641333362L);
- TEST_f_f (acos, 2e-17L, 1.57079632679489659923132169163975144L);
- TEST_f_f (acos, 0.0625L, 1.50825556499840522843072005474337068L);
- TEST_f_f (acos, 0x0.ffffffp0L, 3.4526698471620358760324948263873649728491e-4L);
- TEST_f_f (acos, -0x0.ffffffp0L, 3.1412473866050770348750401337968641476999L);
-#ifndef TEST_FLOAT
- TEST_f_f (acos, 0x0.ffffffff8p0L, 1.5258789062648029736620564947844627548516e-5L);
- TEST_f_f (acos, -0x0.ffffffff8p0L, 3.1415773948007305904329067627145550395696L);
- TEST_f_f (acos, 0x0.ffffffffffffp0L, 8.4293697021788088529885473244391795127130e-8L);
- TEST_f_f (acos, -0x0.ffffffffffffp0L, 3.1415925692960962166745548533940296398054L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
- TEST_f_f (acos, 0x0.ffffffffffffffffp0L, 3.2927225399135962333718255320079907245059e-10L);
- TEST_f_f (acos, -0x0.ffffffffffffffffp0L, 3.1415926532605209844712837599423203309964L);
-#endif
+ RUN_TEST_LOOP_f_f (acos, acos_test_data, );
END (acos);
}
+static const struct test_f_f_data acos_tonearest_test_data[] =
+ {
+ START_DATA (acos_tonearest),
+ TEST_f_f (acos, 0, M_PI_2l),
+ TEST_f_f (acos, minus_zero, M_PI_2l),
+ TEST_f_f (acos, 1, 0),
+ TEST_f_f (acos, -1, M_PIl),
+ TEST_f_f (acos, 0.5, M_PI_6l*2.0),
+ TEST_f_f (acos, -0.5, M_PI_6l*4.0),
+ END_DATA (acos_tonearest)
+ };
+
static void
acos_test_tonearest (void)
{
- int save_round_mode;
errno = 0;
FUNC(acos) (0);
if (errno == ENOSYS)
@@ -1069,21 +1127,7 @@
return;
START (acos_tonearest);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TONEAREST))
- {
- TEST_f_f (acos, 0, M_PI_2l);
- TEST_f_f (acos, minus_zero, M_PI_2l);
- TEST_f_f (acos, 1, 0);
- TEST_f_f (acos, -1, M_PIl);
- TEST_f_f (acos, 0.5, M_PI_6l*2.0);
- TEST_f_f (acos, -0.5, M_PI_6l*4.0);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (acos, acos_tonearest_test_data, FE_TONEAREST);
END (acos_tonearest);
}
@@ -13615,9 +13659,9 @@
TEST_f_f (tgamma, 0, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
TEST_f_f (tgamma, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
/* tgamma (x) == qNaN plus invalid exception for integer x <= 0. */
- TEST_f_f (tgamma, -2, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (tgamma, -max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (tgamma, minus_infty, qnan_value, INVALID_EXCEPTION);
+ TEST_f_f (tgamma, -2, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM);
+ TEST_f_f (tgamma, -max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM);
+ TEST_f_f (tgamma, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM);
TEST_f_f (tgamma, qnan_value, qnan_value);
TEST_f_f (tgamma, 0.5, M_SQRT_PIl);
Modified: fsf/trunk/libc/math/w_tgamma.c
==============================================================================
--- fsf/trunk/libc/math/w_tgamma.c (original)
+++ fsf/trunk/libc/math/w_tgamma.c Sat May 11 00:02:21 2013
@@ -24,7 +24,8 @@
int local_signgam;
double y = __ieee754_gamma_r(x,&local_signgam);
- if(__builtin_expect(!__finite(y), 0)&&__finite(x)
+ if(__builtin_expect(!__finite(y), 0)
+ && (__finite (x) || __isinf (x) < 0)
&& _LIB_VERSION != _IEEE_) {
if (x == 0.0)
return __kernel_standard(x,x,50); /* tgamma pole */
Modified: fsf/trunk/libc/math/w_tgammaf.c
==============================================================================
--- fsf/trunk/libc/math/w_tgammaf.c (original)
+++ fsf/trunk/libc/math/w_tgammaf.c Sat May 11 00:02:21 2013
@@ -22,7 +22,8 @@
int local_signgam;
float y = __ieee754_gammaf_r(x,&local_signgam);
- if(__builtin_expect(!__finitef(y), 0) && __finitef(x)
+ if(__builtin_expect(!__finitef(y), 0)
+ && (__finitef (x) || __isinff (x) < 0)
&& _LIB_VERSION != _IEEE_) {
if (x == (float)0.0)
/* tgammaf pole */
Modified: fsf/trunk/libc/math/w_tgammal.c
==============================================================================
--- fsf/trunk/libc/math/w_tgammal.c (original)
+++ fsf/trunk/libc/math/w_tgammal.c Sat May 11 00:02:21 2013
@@ -27,7 +27,8 @@
int local_signgam;
long double y = __ieee754_gammal_r(x,&local_signgam);
- if(__builtin_expect(!__finitel(y), 0) && __finitel(x)
+ if(__builtin_expect(!__finitel(y), 0)
+ && (__finitel (x) || __isinfl (x) < 0)
&& _LIB_VERSION != _IEEE_) {
if(x==0.0)
return __kernel_standard_l(x,x,250); /* tgamma pole */
Modified: fsf/trunk/libc/sunrpc/rpc_main.c
==============================================================================
--- fsf/trunk/libc/sunrpc/rpc_main.c (original)
+++ fsf/trunk/libc/sunrpc/rpc_main.c Sat May 11 00:02:21 2013
@@ -39,6 +39,7 @@
#include <string.h>
#include <unistd.h>
#include <libintl.h>
+#include <locale.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -173,6 +174,9 @@
{
struct commandline cmd;
+ setlocale (LC_ALL, "");
+ textdomain (_libc_intl_domainname);
+
(void) memset ((char *) &cmd, 0, sizeof (struct commandline));
clear_args ();
if (!parseargs (argc, argv, &cmd))
@@ -322,9 +326,9 @@
static void
find_cpp (void)
{
- struct stat buf;
-
- if (stat (CPP, &buf) == 0)
+ struct stat64 buf;
+
+ if (stat64 (CPP, &buf) == 0)
return;
if (cppDefined) /* user specified cpp but it does not exist */
@@ -1110,17 +1114,17 @@
static void
checkfiles (const char *infile, const char *outfile)
{
- struct stat buf;
+ struct stat64 buf;
if (infile) /* infile ! = NULL */
- if (stat (infile, &buf) < 0)
+ if (stat64 (infile, &buf) < 0)
{
perror (infile);
crash ();
}
if (outfile)
{
- if (stat (outfile, &buf) < 0)
+ if (stat64 (outfile, &buf) < 0)
return; /* file does not exist */
else
{
Modified: fsf/trunk/libc/sysdeps/mach/hurd/bits/statvfs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/mach/hurd/bits/statvfs.h (original)
+++ fsf/trunk/libc/sysdeps/mach/hurd/bits/statvfs.h Sat May 11 00:02:21 2013
@@ -87,7 +87,9 @@
,
ST_NOEXEC = 8,
# define ST_NOEXEC ST_NOEXEC
- ST_SYNCHRONOUS = 16
+ ST_SYNCHRONOUS = 16,
# define ST_SYNCHRONOUS ST_SYNCHRONOUS
+ ST_NOATIME = 32 /* Do not update access times. */
+# define ST_NOATIME ST_NOATIME
#endif
};
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h Sat May 11 00:02:21 2013
@@ -144,21 +144,21 @@
# define __CPU_SET_S(cpu, setsize, cpusetp) \
(__extension__ \
({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
+ __cpu / 8 < (setsize) \
? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
|= __CPUMASK (__cpu)) \
: 0; }))
# define __CPU_CLR_S(cpu, setsize, cpusetp) \
(__extension__ \
({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
+ __cpu / 8 < (setsize) \
? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
&= ~__CPUMASK (__cpu)) \
: 0; }))
# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
(__extension__ \
({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
+ __cpu / 8 < (setsize) \
? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
& __CPUMASK (__cpu))) != 0 \
: 0; }))
Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/getgid.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/getgid.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/getgid.c Sat May 11 00:02:21 2013
@@ -1,0 +1,1 @@
+#include <sysdeps/unix/sysv/linux/i386/getgid.c>
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits