]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Merge branch 'fifteen' of ssh://git.ipfire.org/pub/git/ipfire-2.x into firewall-fifteen
authorAlexander Marx <amarx@ipfire.org>
Wed, 16 Oct 2013 12:22:38 +0000 (14:22 +0200)
committerAlexander Marx <amarx@ipfire.org>
Wed, 16 Oct 2013 12:22:38 +0000 (14:22 +0200)
76 files changed:
config/rootfiles/common/jquery [new file with mode: 0644]
config/rootfiles/core/fifteen/filelists/armv5tel/glibc [new symlink]
config/rootfiles/core/fifteen/filelists/files
config/rootfiles/core/fifteen/filelists/i586/glibc [new symlink]
config/rootfiles/core/fifteen/filelists/jquery [new symlink]
config/rootfiles/oldcore/73/update.sh
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_missings
html/cgi-bin/ddns.cgi
html/cgi-bin/proxy.cgi
html/html/include/jquery-1.9.1.min.js [deleted file]
html/html/themes/ipfire/include/functions.pl
html/html/themes/maniac/include/functions.pl
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/apache2
lfs/glibc
lfs/jquery [new file with mode: 0644]
lfs/linux
lfs/squid
make.sh
src/initscripts/init.d/squid
src/install+setup/libsmooth/libsmooth.h
src/misc-progs/backupctrl.c
src/misc-progs/fireinfoctrl.c
src/misc-progs/getconntracktable.c
src/misc-progs/iowrap.c
src/misc-progs/ipfiredeath.c
src/misc-progs/ipfirerebirth.c
src/misc-progs/ipfirereboot.c
src/misc-progs/ipsecctrl.c
src/misc-progs/netutil.h [new file with mode: 0644]
src/misc-progs/openvpnctrl.c
src/misc-progs/pakfire.c
src/misc-progs/rebuildhosts.c
src/misc-progs/setaliases.c
src/misc-progs/setuid.c
src/misc-progs/setuid.h
src/misc-progs/smartctrl.c
src/misc-progs/syslogdctrl.c
src/misc-progs/wirelessctrl.c
src/patches/glibc/glibc-rh804630.patch [deleted file]
src/patches/glibc/glibc-rh804686.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh806404.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh809726.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh823909.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh826149.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh827362.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh830127.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh832516.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh832694.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh833717.patch [moved from src/patches/glibc/glibc-rh833716.patch with 100% similarity]
src/patches/glibc/glibc-rh837026.patch [deleted file]
src/patches/glibc/glibc-rh837695.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh837918.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh841787.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh843673.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh846342.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh847932.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh848082.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh849203.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh849651.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh852445.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh861167.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh863453.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh864322.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh929388.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh970992.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh989558-2.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh989558.patch [new file with mode: 0644]
src/scripts/setddns.pl

diff --git a/config/rootfiles/common/jquery b/config/rootfiles/common/jquery
new file mode 100644 (file)
index 0000000..cb55288
--- /dev/null
@@ -0,0 +1 @@
+srv/web/ipfire/html/include/jquery.js
diff --git a/config/rootfiles/core/fifteen/filelists/armv5tel/glibc b/config/rootfiles/core/fifteen/filelists/armv5tel/glibc
new file mode 120000 (symlink)
index 0000000..4c70d72
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/armv5tel/glibc
\ No newline at end of file
index b97812d1d2f258212f361aa87163e48ac4963ab7..6a299d4f477ffe17d2d26902bc71554ac5b11372 100644 (file)
@@ -8,6 +8,8 @@ srv/web/ipfire/cgi-bin/proxy.cgi
 srv/web/ipfire/cgi-bin/upnp.cgi
 srv/web/ipfire/cgi-bin/speed.cgi
 srv/web/ipfire/cgi-bin/vpnmain.cgi
+srv/web/ipfire/html/themes/ipfire/include/functions.pl
+srv/web/ipfire/html/themes/maniac/include/functions.pl
 var/ipfire/backup/bin/backup.pl
 var/ipfire/backup/exclude
 var/ipfire/backup/include
diff --git a/config/rootfiles/core/fifteen/filelists/i586/glibc b/config/rootfiles/core/fifteen/filelists/i586/glibc
new file mode 120000 (symlink)
index 0000000..943021f
--- /dev/null
@@ -0,0 +1 @@
+../../../../common/i586/glibc
\ No newline at end of file
diff --git a/config/rootfiles/core/fifteen/filelists/jquery b/config/rootfiles/core/fifteen/filelists/jquery
new file mode 120000 (symlink)
index 0000000..65df10c
--- /dev/null
@@ -0,0 +1 @@
+../../../common/jquery
\ No newline at end of file
index 1fb3ac64269ed59b5cdb1173a2edcadfc10f0c87..ee799adb62f1cc9fea667943d6e57d11220b50c1 100644 (file)
@@ -42,6 +42,15 @@ done
 #Extract files
 extract_files
 
+if [ -e "/var/ipfire/proxy/enable" ] || [ -e "/var/ipfire/proxy/enable_blue" ]; then
+       (
+               eval $(/usr/local/bin/readhash /var/ipfire/proxy/advanced/settings)
+
+               TRANSPARENT_PORT="$(( ${PROXY_PORT} + 1 ))"
+               echo "TRANSPARENT_PORT=${TRANSPARENT_PORT}" >> /var/ipfire/proxy/advanced/settings
+       )
+fi
+
 # Regenerate squid configuration files.
 /srv/web/ipfire/cgi-bin/proxy.cgi
 
index d4f500ca78d6191ef18526f7da8696b680742460..7bf38299f5c4a3c2740eb0f3c1251d881ded856b 100644 (file)
@@ -549,6 +549,8 @@ WARNING: untranslated string: Set time on boot
 WARNING: untranslated string: advproxy cache-digest
 WARNING: untranslated string: advproxy errmsg cache
 WARNING: untranslated string: advproxy errmsg invalid upstream proxy
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
 WARNING: untranslated string: age seconds
 WARNING: untranslated string: age shour
index e16150060f07d69b519c739d3f067785907c8c84..70f8ecf54396a736182dfdc85d92c975f641acf2 100644 (file)
@@ -551,6 +551,8 @@ WARNING: untranslated string: Scan for Songs
 WARNING: untranslated string: advproxy cache-digest
 WARNING: untranslated string: advproxy errmsg cache
 WARNING: untranslated string: advproxy errmsg invalid upstream proxy
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
 WARNING: untranslated string: age seconds
 WARNING: untranslated string: age shour
index fed5e45c4d462703a70309e54cd1f9ae7bc47472..c27610fb03185d3b8be582220bdf3c80a6f88eb6 100644 (file)
@@ -552,6 +552,8 @@ WARNING: translation string unused: year-graph
 WARNING: translation string unused: yearly firewallhits
 WARNING: untranslated string: Scan for Songs
 WARNING: untranslated string: advproxy cache-digest
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
 WARNING: untranslated string: age seconds
 WARNING: untranslated string: age shour
index d4f500ca78d6191ef18526f7da8696b680742460..7bf38299f5c4a3c2740eb0f3c1251d881ded856b 100644 (file)
@@ -549,6 +549,8 @@ WARNING: untranslated string: Set time on boot
 WARNING: untranslated string: advproxy cache-digest
 WARNING: untranslated string: advproxy errmsg cache
 WARNING: untranslated string: advproxy errmsg invalid upstream proxy
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
 WARNING: untranslated string: age seconds
 WARNING: untranslated string: age shour
index 1d3eb79146ebf2e8b55b47c0f0cb7b37e80abd9a..35cba16dc42df8d8b2ff64b12029ed0077b378db 100644 (file)
@@ -543,6 +543,8 @@ WARNING: untranslated string: Scan for Songs
 WARNING: untranslated string: advproxy cache-digest
 WARNING: untranslated string: advproxy errmsg cache
 WARNING: untranslated string: advproxy errmsg invalid upstream proxy
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
 WARNING: untranslated string: age seconds
 WARNING: untranslated string: age shour
index 079f411a528ac101bb6fe4deead64ce125366762..f293e6ec0886b76c23f814e37b54d7edf3437b86 100644 (file)
@@ -555,6 +555,8 @@ WARNING: translation string unused: xtaccess bad transfert
 WARNING: translation string unused: year-graph
 WARNING: translation string unused: yearly firewallhits
 WARNING: untranslated string: Scan for Songs
+WARNING: untranslated string: advproxy errmsg proxy ports equal
+WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: bytes
 WARNING: untranslated string: dnsforward
 WARNING: untranslated string: dnsforward add a new entry
index 704db02cce419544969f71fc196dbf335618d14a..2dfa5c75ecf58affda02d225365c7c74a57e78e8 100644 (file)
@@ -13,6 +13,8 @@
 ############################################################################
 < advproxy errmsg cache
 < advproxy errmsg invalid upstream proxy
+< advproxy errmsg proxy ports equal
+< advproxy proxy port transparent
 < age second
 < age seconds
 < age shour
 ############################################################################
 < advproxy errmsg cache
 < advproxy errmsg invalid upstream proxy
+< advproxy errmsg proxy ports equal
+< advproxy proxy port transparent
 < age second
 < age seconds
 < age shour
 ############################################################################
 < advproxy errmsg cache
 < advproxy errmsg invalid upstream proxy
+< advproxy errmsg proxy ports equal
+< advproxy proxy port transparent
 < age second
 < age seconds
 < age shour
 < Add a route
 < advproxy errmsg cache
 < advproxy errmsg invalid upstream proxy
+< advproxy errmsg proxy ports equal
+< advproxy proxy port transparent
 < age second
 < age seconds
 < age shour
index 88847a050b04171d9b191aca28e4a1f18db25bd0..ae4de6cd55380aeaccfefdae5251e0f4a30ba2c9 100644 (file)
@@ -256,6 +256,7 @@ $checked{'SERVICE'}{'selfhost.de'} = '';
 $checked{'SERVICE'}{'strato.com'} = '';
 $checked{'SERVICE'}{'tzo.com'} = '';
 $checked{'SERVICE'}{'zoneedit.com'} = '';
+$checked{'SERVICE'}{'udmedia.de'} = '';
 $checked{'SERVICE'}{$settings{'SERVICE'}} = "selected='selected'";
 
 $checked{'BEHINDROUTER'}{'RED_IP'} = '';
@@ -351,6 +352,7 @@ print <<END
     <option $checked{'SERVICE'}{'selfhost.de'}>selfhost.de</option>
     <option $checked{'SERVICE'}{'strato.com'}>strato.com</option>
 <!--    <option $checked{'SERVICE'}{'tzo.com'}>tzo.com</option>        comment this service out until a working fix is developed -->
+    <option $checked{'SERVICE'}{'udmedia.de'}>udmedia.de</option>
     <option $checked{'SERVICE'}{'zoneedit.com'}>zoneedit.com</option>
     </select></td>
     <td width='20%' class='base'>$Lang::tr{'hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
index 97e752e28d202a8e6f7d3098396f7ff0c3502e77..6dd900ffda0faaab1aa0bdae295a29de497b3429 100644 (file)
@@ -195,6 +195,7 @@ $proxysettings{'ENABLE_BLUE'} = 'off';
 $proxysettings{'TRANSPARENT'} = 'off';
 $proxysettings{'TRANSPARENT_BLUE'} = 'off';
 $proxysettings{'PROXY_PORT'} = '800';
+$proxysettings{'TRANSPARENT_PORT'} = '3128';
 $proxysettings{'VISIBLE_HOSTNAME'} = '';
 $proxysettings{'ADMIN_MAIL_ADDRESS'} = '';
 $proxysettings{'ADMIN_PASSWORD'} = '';
@@ -212,7 +213,7 @@ $proxysettings{'LOGGING'} = 'off';
 $proxysettings{'CACHEMGR'} = 'off';
 $proxysettings{'LOGQUERY'} = 'off';
 $proxysettings{'LOGUSERAGENT'} = 'off';
-$proxysettings{'FILEDESCRIPTORS'} = '4096';
+$proxysettings{'FILEDESCRIPTORS'} = '16384';
 $proxysettings{'CACHE_MEM'} = '2';
 $proxysettings{'CACHE_SIZE'} = '50';
 $proxysettings{'MAX_SIZE'} = '4096';
@@ -359,6 +360,15 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'}
                $errormessage = $Lang::tr{'advproxy errmsg invalid proxy port'};
                goto ERROR;
        }
+       if (!(&General::validport($proxysettings{'TRANSPARENT_PORT'})))
+       {
+               $errormessage = $Lang::tr{'advproxy errmsg invalid proxy port'};
+               goto ERROR;
+       }
+       if ($proxysettings{'PROXY_PORT'} eq $proxysettings{'TRANSPARENT_PORT'}) {
+               $errormessage = $Lang::tr{'advproxy errmsg proxy ports equal'};
+               goto ERROR;
+       }
        if (!($proxysettings{'UPSTREAM_PROXY'} eq ''))
        {
                my @temp = split(/:/,$proxysettings{'UPSTREAM_PROXY'});
@@ -956,8 +966,8 @@ print <<END
 <tr>
        <td class='base'>$Lang::tr{'advproxy transparent on'} <font color="$Header::colourgreen">Green</font>:</td>
        <td><input type='checkbox' name='TRANSPARENT' $checked{'TRANSPARENT'}{'on'} /></td>
-       <td class='base'>$Lang::tr{'advproxy visible hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
-       <td><input type='text' name='VISIBLE_HOSTNAME' value='$proxysettings{'VISIBLE_HOSTNAME'}' /></td>
+       <td width='25%' class='base'>$Lang::tr{'advproxy proxy port transparent'}:</td>
+       <td width='30%'><input type='text' name='TRANSPARENT_PORT' value='$proxysettings{'TRANSPARENT_PORT'}' size='5' /></td>
 </tr>
 <tr>
 END
@@ -969,7 +979,8 @@ if ($netsettings{'BLUE_DEV'}) {
        print "<td colspan='2'>&nbsp;</td>";
 }
 print <<END
-       <td colspan='2'>&nbsp;</td>
+       <td class='base'>$Lang::tr{'advproxy visible hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
+       <td><input type='text' name='VISIBLE_HOSTNAME' value='$proxysettings{'VISIBLE_HOSTNAME'}' /></td>
 </tr>
 <tr>
 END
@@ -3078,15 +3089,25 @@ END
        }
 
        print FILE "http_port $netsettings{'GREEN_ADDRESS'}:$proxysettings{'PROXY_PORT'}";
-       if ($proxysettings{'TRANSPARENT'} eq 'on') { print FILE " transparent" }
        if ($proxysettings{'NO_CONNECTION_AUTH'} eq 'on') { print FILE " no-connection-auth" }
        print FILE "\n";
 
+       if ($proxysettings{'TRANSPARENT'} eq 'on') {
+               print FILE "http_port $netsettings{'GREEN_ADDRESS'}:$proxysettings{'TRANSPARENT_PORT'} intercept";
+               if ($proxysettings{'NO_CONNECTION_AUTH'} eq 'on') { print FILE " no-connection-auth" }
+               print FILE "\n";
+       }
+
        if ($netsettings{'BLUE_DEV'} && $proxysettings{'ENABLE_BLUE'} eq 'on') {
                print FILE "http_port $netsettings{'BLUE_ADDRESS'}:$proxysettings{'PROXY_PORT'}";
-               if ($proxysettings{'TRANSPARENT_BLUE'} eq 'on') { print FILE " transparent" }
                if ($proxysettings{'NO_CONNECTION_AUTH'} eq 'on') { print FILE " no-connection-auth" }
                print FILE "\n";
+
+               if ($proxysettings{'TRANSPARENT_BLUE'} eq 'on') {
+                       print FILE "http_port $netsettings{'BLUE_ADDRESS'}:$proxysettings{'TRANSPARENT_PORT'} intercept";
+                       if ($proxysettings{'NO_CONNECTION_AUTH'} eq 'on') { print FILE " no-connection-auth" }
+                       print FILE "\n";
+               }
        }
 
        if ($proxysettings{'CACHE_SIZE'} > 0)
@@ -3457,7 +3478,7 @@ END
        # Check if squidclamav is enabled.
        if ($proxysettings{'ENABLE_CLAMAV'} eq 'on') {
                print FILE "\n#Settings for squidclamav:\n";
-               print FILE "http_port 127.0.0.1:$proxysettings{'PROXY_PORT'} transparent\n";
+               print FILE "http_port 127.0.0.1:$proxysettings{'PROXY_PORT'}\n";
                print FILE "acl purge method PURGE\n";
                print FILE "http_access deny to_localhost\n";
                print FILE "http_access allow localhost\n";
diff --git a/html/html/include/jquery-1.9.1.min.js b/html/html/include/jquery-1.9.1.min.js
deleted file mode 100644 (file)
index 006e953..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
-//@ sourceMappingURL=jquery.min.map
-*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
-return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
-}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
\ No newline at end of file
index c557e8b17b12d486e7566cc21c5204feadf38c60..2707593dbcd8e4a80c4dcf2e1f1881d1f45458da 100644 (file)
@@ -177,7 +177,7 @@ END
 ;
 if ($settings{'SPEED'} ne 'off') {
 print <<END
-    <script type="text/javascript" src="/include/jquery-1.9.1.min.js"></script>
+    <script type="text/javascript" src="/include/jquery.js"></script>
     <script type="text/javascript">
         var t_current;
         var t_last;
index 62bbf101e724e6f4e44ab72b04f94059c4b76c83..0bb1d6e70d625dbb67b03ef2a3b0007d29ae51f6 100644 (file)
@@ -177,7 +177,7 @@ END
 ;
 if ($settings{'SPEED'} ne 'off') {
 print <<END
-    <script type="text/javascript" src="/include/jquery-1.9.1.min.js"></script>
+    <script type="text/javascript" src="/include/jquery.js"></script>
     <script type="text/javascript">
         var t_current;
         var t_last;
index 68dd61aa6997f1779b30fd63ccbe909017cf0b77..a894ba022a11365acc3fd1ea9231ce05fdb65cc4 100644 (file)
 'advproxy errmsg password length 1' => 'Passwort muss mindestens',
 'advproxy errmsg password length 2' => ' Zeichen enthalten',
 'advproxy errmsg passwords different' => 'Passwörter stimmen nicht Ã¼berein',
+'advproxy errmsg proxy ports equal' => 'Der Proxy-Port darf nicht identisch mit dem transparenten Port sein.',
 'advproxy errmsg radius port' => 'Ungültige RADIUS Portnummer',
 'advproxy errmsg radius secret' => 'Shared Secret erforderlich',
 'advproxy errmsg radius server' => 'Ungültige IP-Adresse für den RADIUS-Server',
 'advproxy on' => 'Proxy an',
 'advproxy privacy' => 'Datenschutz',
 'advproxy proxy port' => 'Proxy-Port',
+'advproxy proxy port transparent' => 'Transparenter Port',
 'advproxy ram cache size' => 'Cachegröße im Arbeitsspeicher (MB)',
 'advproxy redirector children' => 'Anzahl der Filterprozesse',
 'advproxy reset' => 'Zurücksetzen',
index b625a6cd941cffc094e20eaa4f6f28cbb605bde3..9eb9a832417cb43afa4225ff93fcf93f052791a1 100644 (file)
 'advproxy errmsg password length 1' => 'Password must have at least ',
 'advproxy errmsg password length 2' => ' characters',
 'advproxy errmsg passwords different' => 'Passwords don\'t match',
+'advproxy errmsg proxy ports equal' => 'The proxy port and the transparent port cannot be equal.',
 'advproxy errmsg radius port' => 'Invalid RADIUS port number',
 'advproxy errmsg radius secret' => 'RADIUS shared secret required',
 'advproxy errmsg radius server' => 'Invalid IP address for RADIUS Server',
 'advproxy on' => 'Proxy on',
 'advproxy privacy' => 'Privacy',
 'advproxy proxy port' => 'Proxy port',
+'advproxy proxy port transparent' => 'Transparent port',
 'advproxy ram cache size' => 'Memory cache size (MB)',
 'advproxy redirector children' => 'Number of filter processes',
 'advproxy reset' => 'Reset',
index c3d91560290eb02afdf3272d37899dbe0a63600f..f50332be97462207c12b22cd250cd6eb56e3d726 100644 (file)
@@ -98,6 +98,9 @@ ifeq "$(PASS)" "C"
        chmod -R 755 /srv/web/ipfire/cgi-bin
        chmod -R 644 /srv/web/ipfire/html
        chmod 755 /srv/web/ipfire/html /srv/web/ipfire/html/{index.cgi,redirect.cgi,dial.cgi,images,include,themes,themes/*,themes/*/*}
+
+       # Reset permissions of redirect templates directories
+       find /srv/web/ipfire/html/redirect-templates -type d | xargs chmod -v 755
 else
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && patch -Np1 -i $(DIR_DL)/httpd-2.2.2-config-1.patch
index ccbdb315881754bec78b90d4a58eae65b03c2bd0..9acbb111bbfa6c4d58a784e8138a51d318bcbbec 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -227,13 +227,37 @@ endif
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh795498.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh797094-1.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh797094-2.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh804630.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh804686.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh804689.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh806404.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh808337.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh808545.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh809602.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh833716.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh837026.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh809726.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh823909.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh826149.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh827362.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh830127.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh832516.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh832694.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh833717.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh837695.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh837918.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh841787.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh843673.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh846342.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh847932.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh848082.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh849203.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh849651.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh852445.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh861167.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh863453.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh864322.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh929388.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh970992.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh989558.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh989558-2.patch
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-resolv-stack_chk_fail.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-remove-ctors-dtors-output-sections.patch
diff --git a/lfs/jquery b/lfs/jquery
new file mode 100644 (file)
index 0000000..7856ce0
--- /dev/null
@@ -0,0 +1,76 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2013  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program 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 General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.10.2
+
+THISAPP    = jquery-$(VER)
+DL_FILE    = $(THISAPP).min.js
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 628072e7212db1e8cdacb22b21752cda
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+
+       -mkdir -pv /srv/web/ipfire/html/include
+       install -v -m 644 $(DIR_DL)/$(DL_FILE) /srv/web/ipfire/html/include/jquery.js
+
+       @$(POSTBUILD)
index 489a1def779dc3a39d8ec828f823602c4e5aa584..d6a8b1d112db85cf13bb6b913c7f3181b25bd2bc 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
 
 include Config
 
-VER        = 3.10.15
+VER        = 3.10.16
 
 RPI_PATCHES = linux-3.10.10-c1af7c6
-GRS_PATCHES = grsecurity-2.9.1-3.10.15-ipfire1.patch.xz
+GRS_PATCHES = grsecurity-2.9.1-3.10.16-ipfire1.patch.xz
 
 THISAPP    = linux-$(VER)
 DL_FILE    = linux-$(VER).tar.xz
@@ -74,9 +74,9 @@ $(DL_FILE)                            = $(URL_IPFIRE)/$(DL_FILE)
 rpi-patches-$(RPI_PATCHES).patch.xz    = $(URL_IPFIRE)/rpi-patches-$(RPI_PATCHES).patch.xz
 $(GRS_PATCHES)                         = $(URL_IPFIRE)/$(GRS_PATCHES)
 
-$(DL_FILE)_MD5                         = 3fe22263308674d92c6d106f633eca52
+$(DL_FILE)_MD5                         = 5e232365cbc0797b716b605a165703e1
 rpi-patches-$(RPI_PATCHES).patch.xz_MD5        = ef9274b3ff5d05daaaa4bdbe86ad00fc
-$(GRS_PATCHES)_MD5                     = a9a6c5009cef39cfb798da1466044e33
+$(GRS_PATCHES)_MD5                     = 826d8a90e7cdfc84ac871512c773d712
 
 install : $(TARGET)
 
@@ -191,21 +191,21 @@ else
        cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
 
 ifeq "$(KCFG)" "-kirkwood"
-       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage modules
        cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
 else
 ifeq "$(KCFG)" "-multi"
-       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage modules
        cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/zImage-$(VERSUFIX)
 else
 ifeq "$(KCFG)" "-rpi"
-       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage modules
        cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/kernel.img
 else
-       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage modules
        cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
        ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
 endif
@@ -214,7 +214,6 @@ endif
        cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
        cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
        ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
-       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
        cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
        cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
 
index 4a71b4da2007a0f6679f588f74b7b691641b74f8..bc0ef7162f8c5bd9b9d19788734b50bac9f331d4 100644 (file)
--- a/lfs/squid
+++ b/lfs/squid
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 3.3.8
+VER        = 3.3.9
 
 THISAPP    = squid-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 6a8fa0075f2fbdd899ac4c9d95fe67cb
+$(DL_FILE)_MD5 = 6c4ba0d63c3a6d94de2da689f361cdab
 
 install : $(TARGET)
 
@@ -114,7 +114,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
                --enable-cache-digests \
                --enable-forw-via-db \
                --enable-htcp \
-               --enable-ipf-transparent \
+               --enable-linux-netfilter \
                --enable-kill-parent-hack \
                --disable-wccpv2 \
                --enable-icap-client \
diff --git a/make.sh b/make.sh
index 9619ad33b562730b96b6c1ed38c88556f4705973..61308921c8e88cc78bc30517f7470b9fd7b787a6 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -493,6 +493,7 @@ buildipfire() {
   ipfiremake apache2
   ipfiremake php
   ipfiremake apache2                   PASS=C
+  ipfiremake jquery
   ipfiremake arping
   ipfiremake beep
   ipfiremake dvdrtools
index 62d5bea82bb06f18bd918dafa66911b13c1caae3..c641c7d37987ce7fa753e4fc0df2aacba71da6d7 100644 (file)
@@ -15,8 +15,8 @@ transparent() {
                eval $(/usr/local/bin/readhash /var/ipfire/proxy/settings)
 
                # If the proxy port is not set we set the default to 800.
-               if [ -z $PROXY_PORT ]; then
-                       PROXY_PORT=800
+               if [ -z "${TRANSPARENT_PORT}" ]; then
+                       TRANSPARENT_PORT=800
                fi
 
                LOCALIP=`cat /var/ipfire/red/local-ipaddress | tr -d \n`
@@ -43,7 +43,7 @@ transparent() {
                
                iptables -t nat -A SQUID -i $1 -p tcp -d $LOCALIP --dport 80 -j RETURN
                
-               iptables -t nat -A SQUID -i $1 -p tcp --dport 80 -j REDIRECT --to-port $PROXY_PORT
+               iptables -t nat -A SQUID -i $1 -p tcp --dport 80 -j REDIRECT --to-port "${TRANSPARENT_PORT}"
 }
 
 case "$1" in
index fb381936374091c5ba136a6efe3546a119cb8c74..fc166b221c57d4a2df44e6e6ffacdd3eef6a887b 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "langs.h"
 
-#define STRING_SIZE 1023
+#define STRING_SIZE 1024
 
 #define ADDRESS 0
 #define NETADDRESS 1
index 2941117b03db4d83acb3f26288a555453ec4847a..00c8d5b86e21a40a80ae2dd2051119417da07053 100644 (file)
 
 int main(int argc, char *argv[]) {
        int i;
-       char command[1024];
-       char add[STRING_SIZE];
-       
+       char command[STRING_SIZE] = "/var/ipfire/backup/bin/backup.pl";
+       char temp[STRING_SIZE];
+
        if (!(initsetuid()))
                exit(1);
 
-       snprintf(command, STRING_SIZE, "/var/ipfire/backup/bin/backup.pl");
-
        for (i = 1; i < argc; i++) {
-    if (strstr(argv[i], "&&")){
-             fprintf (stderr, "Bad Argument!\n");
-        exit (1);
-    }
-               else if (strstr(argv[i], "|")){
-                   fprintf (stderr, "Bad Argument!\n");
-                   exit (1);
-               }
-               else if (argc > 3){
-                   fprintf (stderr, "Too Many Arguments!\n");
-                   exit (1);
+               if (strstr(argv[i], "&&")){
+                       fprintf (stderr, "Bad Argument!\n");
+                       exit (1);
+
+               } else if (strstr(argv[i], "|")) {
+                       fprintf (stderr, "Bad Argument!\n");
+                       exit (1);
+
+               } else if (argc > 3) {
+                       fprintf (stderr, "Too Many Arguments!\n");
+                       exit (1);
+
+               } else {
+                       snprintf(temp, STRING_SIZE, "%s %s", command, argv[i]);
+                       snprintf(command, STRING_SIZE, "%s", temp);
                }
-               else{
-               sprintf(add, " %s", argv[i]);
-                   strcat(command, add);
-    }
        }
+
        return safe_system(command);
 }
index 963459a2a6172fe7542f9de5c0f050c4220aa7c8..a026ba09d709b23f38aaa5e3d11cf2efd3f6ce9c 100644 (file)
@@ -1,23 +1,23 @@
-/* IPFire helper program - fireinfoctrl\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) IPFire Team, 2011\r
- *\r
- * Simple program that calls "sendprofile" as the root user.\r
- * \r
- */\r
-         \r
-#include <stdlib.h>\r
-#include "setuid.h"\r
-\r
-int main(void)\r
-{\r
-       if (!(initsetuid()))\r
-               exit(1);\r
-                       \r
-       safe_system("/usr/bin/sendprofile");\r
-       \r
-       return 0;\r
-}\r
+/* IPFire helper program - fireinfoctrl
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) IPFire Team, 2011
+ *
+ * Simple program that calls "sendprofile" as the root user.
+ * 
+ */
+         
+#include <stdlib.h>
+#include "setuid.h"
+
+int main(void)
+{
+       if (!(initsetuid()))
+               exit(1);
+                       
+       safe_system("/usr/bin/sendprofile");
+       
+       return 0;
+}
index 674b211b5cc0bdeaaa3f65c8bd103fe1834b7712..78eb11ad85ec58558c290172a26c03006894bc6c 100644 (file)
@@ -1,31 +1,31 @@
-/* IPFire helper program - getconntracktable\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * The kernel's connection tracking table is not readable by\r
- * non-root users. So this helper will just read and output it.\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "setuid.h"\r
-\r
-int main(void) {\r
-       if (!(initsetuid()))\r
-               exit(1);\r
-\r
-       FILE *fp = fopen("/proc/net/nf_conntrack", "r");\r
-       if (fp == NULL) {\r
-               exit(1);\r
-       }\r
-\r
-       /* Read content line by line and write it to stdout. */\r
-       char linebuf[STRING_SIZE];\r
-       while (fgets(linebuf, STRING_SIZE, fp)) {\r
-               printf("%s", linebuf);\r
-       }\r
-\r
-       fclose(fp);\r
-       return 0;\r
-}\r
+/* IPFire helper program - getconntracktable
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * The kernel's connection tracking table is not readable by
+ * non-root users. So this helper will just read and output it.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "setuid.h"
+
+int main(void) {
+       if (!(initsetuid()))
+               exit(1);
+
+       FILE *fp = fopen("/proc/net/nf_conntrack", "r");
+       if (fp == NULL) {
+               exit(1);
+       }
+
+       /* Read content line by line and write it to stdout. */
+       char linebuf[STRING_SIZE];
+       while (fgets(linebuf, STRING_SIZE, fp)) {
+               printf("%s", linebuf);
+       }
+
+       fclose(fp);
+       return 0;
+}
index e56203e27faab22dd237ead67991a2502657e751..115ec2a06373359262a6b992b7a77f22d3370798 100644 (file)
@@ -1,44 +1,44 @@
-/* SmoothWall helper program - iowrap.\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Installer helper for redirecting stdout/stderr to a file/terminal.\r
- * init calls ash through this program to shove it on a tty.\r
- * \r
- * $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $\r
- * \r
- */\r
-\r
-#include <stdio.h>\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <fcntl.h>\r
-#include <unistd.h>\r
-\r
-int main(int argc, char *argv[])\r
-{\r
-       /* Prog takes one argument.  A device to run on (like a getty) */\r
-       if (argc >= 2)\r
-       {\r
-               int fd;\r
-               \r
-               if ((fd = open(argv[1], O_RDWR)) == -1)\r
-               {\r
-                       printf("Couldn't open device\n");\r
-                       return 0;\r
-               }\r
-               dup2(fd, 0);\r
-               dup2(fd, 1);\r
-               dup2(fd, 2);\r
-               /* Now its sending/reading on that device. */\r
-       }\r
-       \r
-       if (argc >= 3)  \r
-               execvp(argv[2], &argv[2]);\r
-       else\r
-               printf("No command\n");\r
-\r
-       return 0;\r
-}\r
+/* SmoothWall helper program - iowrap.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Installer helper for redirecting stdout/stderr to a file/terminal.
+ * init calls ash through this program to shove it on a tty.
+ * 
+ * $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $
+ * 
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+       /* Prog takes one argument.  A device to run on (like a getty) */
+       if (argc >= 2)
+       {
+               int fd;
+               
+               if ((fd = open(argv[1], O_RDWR)) == -1)
+               {
+                       printf("Couldn't open device\n");
+                       return 0;
+               }
+               dup2(fd, 0);
+               dup2(fd, 1);
+               dup2(fd, 2);
+               /* Now its sending/reading on that device. */
+       }
+       
+       if (argc >= 3)  
+               execvp(argv[2], &argv[2]);
+       else
+               printf("No command\n");
+
+       return 0;
+}
index 9115b4f8fdb418fd3e63f3f4904560465a6325f6..8a13fa60a8be4203383ed1a72742b7108b910791 100644 (file)
@@ -1,25 +1,25 @@
-/* SmoothWall helper program - smoothiedeath\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Simple program intended to be installed setuid(0) that can be used for\r
- * starting shutdown.\r
- * \r
- * $Id: ipcopdeath.c,v 1.2 2003/12/11 10:57:34 riddles Exp $\r
- * \r
- */\r
-         \r
-#include <stdlib.h>\r
-#include "setuid.h"\r
-\r
-int main(void)\r
-{\r
-       if (!(initsetuid()))\r
-               exit(1);\r
-       \r
-       safe_system("/sbin/shutdown -h now");\r
-       \r
-       return 0;\r
-}\r
+/* SmoothWall helper program - smoothiedeath
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Simple program intended to be installed setuid(0) that can be used for
+ * starting shutdown.
+ * 
+ * $Id: ipcopdeath.c,v 1.2 2003/12/11 10:57:34 riddles Exp $
+ * 
+ */
+         
+#include <stdlib.h>
+#include "setuid.h"
+
+int main(void)
+{
+       if (!(initsetuid()))
+               exit(1);
+       
+       safe_system("/sbin/shutdown -h now");
+       
+       return 0;
+}
index dd7988e1821205f2e772f57cf2c4ba15e1702961..10230c3e102429635ad1ca2d7f029bb35f9fce8e 100644 (file)
@@ -1,25 +1,25 @@
-/* SmoothWall helper program - smoothierebirth\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Simple program intended to be installed setuid(0) that can be used for\r
- * starting reboot.\r
- * \r
- * $Id: ipcoprebirth.c,v 1.2 2003/12/11 10:57:34 riddles Exp $\r
- * \r
- */\r
-         \r
-#include <stdlib.h>\r
-#include "setuid.h"\r
-\r
-int main(void)\r
-{\r
-       if (!(initsetuid()))\r
-               exit(1);\r
-                       \r
-       safe_system("/sbin/shutdown -r now");\r
-       \r
-       return 0;\r
-}\r
+/* SmoothWall helper program - smoothierebirth
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Simple program intended to be installed setuid(0) that can be used for
+ * starting reboot.
+ * 
+ * $Id: ipcoprebirth.c,v 1.2 2003/12/11 10:57:34 riddles Exp $
+ * 
+ */
+         
+#include <stdlib.h>
+#include "setuid.h"
+
+int main(void)
+{
+       if (!(initsetuid()))
+               exit(1);
+                       
+       safe_system("/sbin/shutdown -r now");
+       
+       return 0;
+}
index 05dddaf2404304c233d49f5d0f14f6cd9fd0af0c..5e758791cd4cc96e8d81454333f7b6c110d3d08a 100644 (file)
-/*\r
- * This file is part of the IPCop Firewall.\r
- *\r
- * IPCop is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * IPCop is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with IPCop; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
- *\r
- * Copyright (C) 2005-10-25 Franck Bourdonnec\r
- *\r
- * $Id: ipcopreboot.c,v 1.1.2.2 2005/10/24 23:05:50 franck78 Exp $\r
- *\r
- */\r
-\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include "setuid.h"\r
-\r
-\r
-/* define operations */\r
-#define OP_REBOOT        "boot"\r
-#define OP_REBOOT_FS     "bootfs" // add filesystem check option (not yet in GUI)\r
-#define OP_SHUTDOWN      "down"\r
-#define OP_SCHEDULE_ADD   "cron+"\r
-#define OP_SCHEDULE_REM   "cron-"\r
-#define OP_SCHEDULE_GET   "cron?"\r
-\r
-int main(int argc, char**argv)\r
-{\r
-\r
-       if (!(initsetuid()))\r
-           return 1;\r
-\r
-       // Check what command is asked\r
-       if (argc==1)\r
-       {           \r
-           fprintf (stderr, "Missing reboot command!\n");\r
-           return 1;\r
-       }\r
-\r
-       if (argc==2 && strcmp(argv[1], OP_SHUTDOWN)==0)\r
-       {\r
-           safe_system("/sbin/shutdown -h now");\r
-           return 0;\r
-       }\r
-\r
-       if (argc==2 && strcmp(argv[1], OP_REBOOT)==0)\r
-       {\r
-           safe_system("/sbin/shutdown -r now");\r
-           return 0;\r
-       }\r
-\r
-       if (argc==2 && strcmp(argv[1], OP_REBOOT_FS)==0)\r
-       {\r
-           safe_system("/sbin/shutdown -F -r now");\r
-           return 0;\r
-       }\r
-\r
-       // output schedule to stdout\r
-       if (argc==2 && strcmp(argv[1], OP_SCHEDULE_GET)==0)\r
-       {\r
-           safe_system("/bin/grep /sbin/shutdown /var/spool/cron/root.orig");\r
-           return 0;\r
-       }\r
-\r
-       if (argc==2 && strcmp(argv[1], OP_SCHEDULE_REM)==0)\r
-       {\r
-           safe_system("/usr/bin/perl -i -p -e 's/^.*\\/sbin\\/shutdown.*$//s' /var/spool/cron/root.orig");\r
-           safe_system("/usr/bin/fcrontab -u root -z");\r
-           return 0;\r
-       }\r
-\r
-       if (argc==6 && strcmp(argv[1], OP_SCHEDULE_ADD)==0)\r
-       {\r
-           // check args\r
-           if (!(  strlen(argv[2])<3 &&\r
-                   strspn(argv[2], "0123456789") == strlen (argv[2]) &&\r
-                   strlen(argv[3])<3 &&\r
-                   strspn(argv[3], "0123456789") == strlen (argv[3]) &&\r
-                   strlen(argv[4])<14 &&\r
-                   strspn(argv[4], "1234567,*") == strlen (argv[4])  &&\r
-                   ((strcmp(argv[5], "-r")==0) ||      //reboot\r
-                    (strcmp(argv[5], "-h")==0))  )     //hangup\r
-               ) {\r
-                       fprintf (stderr, "Bad cron+ parameters!\n");\r
-                       return 1;\r
-           }\r
-           \r
-           // remove old entry                               \r
-           safe_system("/usr/bin/perl -i -p -e 's/^.*\\/sbin\\/shutdown.*$//s' /var/spool/cron/root.orig");\r
-\r
-           // add new entry\r
-           FILE *fd = NULL;\r
-           if ((fd = fopen("/var/spool/cron/root.orig", "a")))\r
-           {\r
-               fprintf (fd,"%s %s * * %s /sbin/shutdown %s 1\n",argv[2],argv[3],argv[4],argv[5]);\r
-               fclose (fd);\r
-           }\r
-           \r
-           // inform cron\r
-           safe_system("/usr/bin/fcrontab -u root -z");\r
-           return 0;\r
-       }\r
-\r
-       fprintf (stderr, "Bad reboot command!\n");\r
-       return 1;\r
-}\r
+/*
+ * This file is part of the IPCop Firewall.
+ *
+ * IPCop is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * IPCop 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with IPCop; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) 2005-10-25 Franck Bourdonnec
+ *
+ * $Id: ipcopreboot.c,v 1.1.2.2 2005/10/24 23:05:50 franck78 Exp $
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "setuid.h"
+
+
+/* define operations */
+#define OP_REBOOT        "boot"
+#define OP_REBOOT_FS     "bootfs" // add filesystem check option (not yet in GUI)
+#define OP_SHUTDOWN      "down"
+#define OP_SCHEDULE_ADD   "cron+"
+#define OP_SCHEDULE_REM   "cron-"
+#define OP_SCHEDULE_GET   "cron?"
+
+int main(int argc, char**argv)
+{
+
+       if (!(initsetuid()))
+           return 1;
+
+       // Check what command is asked
+       if (argc==1)
+       {           
+           fprintf (stderr, "Missing reboot command!\n");
+           return 1;
+       }
+
+       if (argc==2 && strcmp(argv[1], OP_SHUTDOWN)==0)
+       {
+           safe_system("/sbin/shutdown -h now");
+           return 0;
+       }
+
+       if (argc==2 && strcmp(argv[1], OP_REBOOT)==0)
+       {
+           safe_system("/sbin/shutdown -r now");
+           return 0;
+       }
+
+       if (argc==2 && strcmp(argv[1], OP_REBOOT_FS)==0)
+       {
+           safe_system("/sbin/shutdown -F -r now");
+           return 0;
+       }
+
+       // output schedule to stdout
+       if (argc==2 && strcmp(argv[1], OP_SCHEDULE_GET)==0)
+       {
+           safe_system("/bin/grep /sbin/shutdown /var/spool/cron/root.orig");
+           return 0;
+       }
+
+       if (argc==2 && strcmp(argv[1], OP_SCHEDULE_REM)==0)
+       {
+           safe_system("/usr/bin/perl -i -p -e 's/^.*\\/sbin\\/shutdown.*$//s' /var/spool/cron/root.orig");
+           safe_system("/usr/bin/fcrontab -u root -z");
+           return 0;
+       }
+
+       if (argc==6 && strcmp(argv[1], OP_SCHEDULE_ADD)==0)
+       {
+           // check args
+           if (!(  strlen(argv[2])<3 &&
+                   strspn(argv[2], "0123456789") == strlen (argv[2]) &&
+                   strlen(argv[3])<3 &&
+                   strspn(argv[3], "0123456789") == strlen (argv[3]) &&
+                   strlen(argv[4])<14 &&
+                   strspn(argv[4], "1234567,*") == strlen (argv[4])  &&
+                   ((strcmp(argv[5], "-r")==0) ||      //reboot
+                    (strcmp(argv[5], "-h")==0))  )     //hangup
+               ) {
+                       fprintf (stderr, "Bad cron+ parameters!\n");
+                       return 1;
+           }
+           
+           // remove old entry                               
+           safe_system("/usr/bin/perl -i -p -e 's/^.*\\/sbin\\/shutdown.*$//s' /var/spool/cron/root.orig");
+
+           // add new entry
+           FILE *fd = NULL;
+           if ((fd = fopen("/var/spool/cron/root.orig", "a")))
+           {
+               fprintf (fd,"%s %s * * %s /sbin/shutdown %s 1\n",argv[2],argv[3],argv[4],argv[5]);
+               fclose (fd);
+           }
+           
+           // inform cron
+           safe_system("/usr/bin/fcrontab -u root -z");
+           return 0;
+       }
+
+       fprintf (stderr, "Bad reboot command!\n");
+       return 1;
+}
index 365807c9e4ab336a5f208a30592e3a8b70a208f7..570fdebab4583e3c10f6d8f2a56df42d3cfbed57 100644 (file)
@@ -13,7 +13,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
+
 #include "setuid.h"
+#include "netutil.h"
 
 /*
     This module is responsible for start stop of the vpn system.
diff --git a/src/misc-progs/netutil.h b/src/misc-progs/netutil.h
new file mode 100644 (file)
index 0000000..e96eb5d
--- /dev/null
@@ -0,0 +1,48 @@
+
+#ifndef NETUTIL_H
+#define NETUTIL_H 1
+
+#include <stdlib.h>
+
+#define LETTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define NUMBERS "0123456789"
+#define LETTERS_NUMBERS LETTERS NUMBERS
+#define IP_NUMBERS "./" NUMBERS
+#define PORT_NUMBERS ":-" NUMBERS
+#define VALID_FQDN LETTERS_NUMBERS ".-"
+
+#define VALID_IP(ip) (strlen(ip) > 6 \
+               && strlen(ip) < 16 \
+               && strspn(ip, NUMBERS ".") == strlen(ip))
+
+#define VALID_IP_AND_MASK(ip) (strlen(ip) > 6 \
+               && strlen(ip) < 32 \
+               && strspn(ip, IP_NUMBERS) == strlen(ip))
+
+#define VALID_PORT(port) (strlen(port) \
+               && strlen(port) < 6 \
+               && strspn(port, NUMBERS) == strlen(port))
+
+#define VALID_PORT_RANGE(port) (strlen(port) \
+               && strlen(port) < 12 \
+               && strspn(port, PORT_NUMBERS) == strlen(port))
+
+#define VALID_SHORT_MASK(ip) (strlen(ip) > 1 \
+               && strlen(ip) < 3 \
+               && strspn(ip, NUMBERS) == strlen(ip))
+
+/* Can't find any info on valid characters/length hopefully these are
+ * reasonable guesses */
+#define VALID_DEVICE(dev) (strlen(dev) \
+               && strlen(dev) < 16 \
+               && strspn(dev, LETTERS_NUMBERS ":.") == strlen(dev))
+
+/* Again, can't find any hard and fast rules for protocol names, these
+ * restrictions are based on the keywords currently listed in
+ * <http://www.iana.org/assignments/protocol-numbers>
+ * though currently the ipcop cgis will only pass tcp, udp or gre anyway */
+#define VALID_PROTOCOL(prot) (strlen(prot) \
+               &&  strlen(prot) <16 \
+               &&  strspn(prot, LETTERS_NUMBERS "-") == strlen(prot))
+
+#endif
index 4c1d1c3bbb30a9bee58e49f024949acd240ab870..257778892a1868bdb302614de2a1fcc970b3d619 100644 (file)
@@ -8,6 +8,7 @@
 #include <netinet/in.h>
 #include <fcntl.h>
 #include "setuid.h"
+#include "netutil.h"
 #include "libsmooth.h"
 
 #define noovpndebug
index 113216faa71dede918f35c49f740d25d74d9e0aa..fe6edfc32948c496df9f05ffa057bdcb427978ae 100644 (file)
 
 int main(int argc, char *argv[]) {
        int i;
-       char command[1024];
-       char add[STRING_SIZE];
-       
+       char command[STRING_SIZE] = "/opt/pakfire/pakfire";
+       char temp[STRING_SIZE];
+
        if (!(initsetuid()))
                exit(1);
 
-       snprintf(command, STRING_SIZE, "/opt/pakfire/pakfire");
-
        for (i = 1; i < argc; i++) {
-               sprintf(add, " %s", argv[i]);
-               strcat(command, add);
+               snprintf(temp, STRING_SIZE, "%s %s", command, argv[i]);
+               snprintf(command, STRING_SIZE, "%s", temp);
        }
-       
+
        return safe_system(command);
 }
index e831858819e18d98c5e11404953bad65580cf4b6..21c523600c75b5223106d6aeb284db40f30e9531 100644 (file)
@@ -19,7 +19,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
+
 #include "setuid.h"
+#include "netutil.h"
 
 FILE *fd = NULL;
 FILE *hosts = NULL;
index ea4bc11dbec4e3016ac6b0d64f77cbe0e5b4ce97..93af1cb0a4ecd1e7832aad8b6943c9d903695680 100644 (file)
@@ -13,8 +13,6 @@
  *
  */
 
-#include "libsmooth.h"
-#include "setuid.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include "libsmooth.h"
+#include "setuid.h"
+#include "netutil.h"
+
 struct keyvalue *kv = NULL;
 FILE *file = NULL;
 
index d7fabd494122a947307dc9f82c19e313c95405cd..e54b5d3abe7b66e20e76f6cc66cd91db1fab8ac8 100644 (file)
-/* This file is part of the IPCop Firewall.\r
- *\r
- * IPCop is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * IPCop is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with IPCop; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
- *\r
- * Copyright (C) 2003-04-22 Robert Kerr <rkerr@go.to>\r
- *\r
- * $Id: setuid.c,v 1.2.2.1 2005/11/18 14:51:43 franck78 Exp $\r
- *\r
- */\r
-\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <errno.h>\r
-#include <unistd.h>\r
-#include <stdlib.h>\r
-#include <sys/types.h>\r
-#include <limits.h>\r
-#include <sys/time.h>\r
-#include <sys/resource.h>\r
-#include <sys/stat.h>\r
-#include <fcntl.h>\r
-#include <grp.h>\r
-#include <signal.h>\r
-#include <sys/wait.h>\r
-#include <glob.h>\r
-#include "setuid.h"\r
-\r
-#ifndef OPEN_MAX\r
-#define OPEN_MAX 256\r
-#endif\r
-\r
-/* Trusted environment for executing commands */\r
-char * trusted_env[4]={\r
-       "PATH=/usr/bin:/usr/sbin:/sbin:/bin",\r
-       "SHELL=/bin/sh",\r
-       "TERM=dumb",\r
-       NULL};\r
-\r
-/* Spawns a child process that uses /bin/sh to interpret a command.\r
- * This is much the same in use and purpose as system(), yet as it uses execve\r
- * to pass a trusted environment it's immune to attacks based upon changing\r
- * IFS, ENV, BASH_ENV and other such variables.\r
- * Note this does NOT guard against any other attacks, inparticular you MUST\r
- * validate the command you are passing. If the command is formed from user\r
- * input be sure to check this input is what you expect. Nasty things can\r
- * happen if a user can inject ; or `` into your command for example */\r
-int safe_system(char* command)\r
-{\r
-       return system_core( command, 0, 0, "safe_system" );\r
-}\r
-\r
-/* Much like safe_system but lets you specify a non-root uid and gid to run\r
- * the command as */\r
-int unpriv_system(char* command, uid_t uid, gid_t gid)\r
-{\r
-       return system_core(command, uid, gid, "unpriv_system" );\r
-}\r
-\r
-int system_core(char* command, uid_t uid, gid_t gid, char *error)\r
-{\r
-       int pid, status;\r
-\r
-       if(!command)\r
-               return 1;\r
-\r
-       switch( pid = fork() )\r
-       {\r
-               case -1:\r
-                       return -1;\r
-               case 0: /* child */\r
-               {\r
-                       char * argv[4];\r
-                       if (gid && setgid(gid)) \r
-                       {\r
-                               fprintf(stderr, "%s: ", error);\r
-                               perror("Couldn't setgid");\r
-                               exit(127);\r
-                       }\r
-                       if (uid && setuid(uid))\r
-                       {\r
-                               fprintf(stderr, "%s: ", error);\r
-                               perror("Couldn't setuid");\r
-                               exit(127);\r
-                       }\r
-                       argv[0] = "sh";\r
-                       argv[1] = "-c";\r
-                       argv[2] = command;\r
-                       argv[3] = NULL;\r
-                       execve("/bin/sh", argv, trusted_env);\r
-                       fprintf(stderr, "%s: ", error);\r
-                       perror("execve failed");\r
-                       exit(127);\r
-               }\r
-               default: /* parent */\r
-                       do {\r
-                               if( waitpid(pid, &status, 0) == -1 ) {\r
-                                       if( errno != EINTR )\r
-                                               return -1;\r
-                                       } else\r
-                                               return status;\r
-                       } while (1);\r
-       }\r
-\r
-}\r
-\r
-/* BSD style safe strcat; from the secure programming cookbook */\r
-size_t strlcat(char *dst, const char *src, size_t len) {\r
-       char       *dstptr = dst;\r
-       size_t     dstlen, tocopy = len;\r
-       const char *srcptr = src;\r
-\r
-       while (tocopy-- && *dstptr) dstptr++;\r
-       dstlen = dstptr - dst;\r
-       if (!(tocopy = len - dstlen)) return (dstlen + strlen(src));\r
-       while (*srcptr) {\r
-               if (tocopy != 1) {\r
-                       *dstptr++ = *srcptr;\r
-                       tocopy--;\r
-               }\r
-               srcptr++;\r
-       }\r
-       *dstptr = 0;\r
-\r
-       return (dstlen + (srcptr - src));\r
-}\r
-\r
-/* General routine to initialise a setuid root program, and put the\r
- * environment in a known state. Returns 1 on success, if initsetuid() returns\r
- * 0 then you should exit(1) immediately, DON'T attempt to recover from the\r
- * error */\r
-int initsetuid(void)\r
-{\r
-       int fds,i;\r
-       struct stat st;\r
-       struct rlimit rlim;\r
-\r
-       /* Prevent signal tricks by ignoring all except SIGKILL and SIGCHILD */\r
-               for( i = 0; i < NSIG; i++ ) {\r
-                       if( i != SIGKILL && i != SIGCHLD )\r
-                               signal(i, SIG_IGN);\r
-       }\r
-\r
-       /* dump all non-standard file descriptors (a full descriptor table could\r
-        * lead to DoS by preventing us opening files) */\r
-       if ((fds = getdtablesize()) == -1) fds = OPEN_MAX;\r
-       for( i = 3; i < fds; i++ ) close(i);\r
-\r
-       /* check stdin, stdout & stderr are open before going any further */\r
-       for( i = 0; i < 3; i++ )\r
-               if( fstat(i, &st) == -1 && ((errno != EBADF) || (close(i), open("/dev/null", O_RDWR, 0)) != i ))\r
-                       return 0;\r
-\r
-       /* disable core dumps in case we're processing sensitive information */\r
-       rlim.rlim_cur = rlim.rlim_max = 0;\r
-       if(setrlimit(RLIMIT_CORE, &rlim))\r
-               { perror("Couldn't disable core dumps"); return 0; }\r
-\r
-       /* drop any supplementary groups, set uid & gid to root */\r
-       if (setgroups(0, NULL)) { perror("Couldn't clear group list"); return 0; }\r
-       if (setgid(0))          { perror("Couldn't setgid(0)");        return 0; }\r
-       if (setuid(0))          { perror("Couldn't setuid(0)");        return 0; }\r
-\r
-       return 1;\r
-}\r
-\r
-/* check whether a file exists */\r
-int file_exists(const char *fname) {\r
-       struct stat st;\r
-       stat(fname, &st);\r
-       return S_ISREG(st.st_mode) ? 1 : 0;\r
-}\r
-\r
-/* check whether a file exists. fname is wildcard eg: file_exists (/tmp/foo*) */\r
-int file_exists_w(const char *fname)\r
-{\r
-       /* do a quick check first */\r
-       struct stat st;\r
-       stat(fname, &st);\r
-       if (S_ISREG(st.st_mode))\r
-               return 1;\r
-\r
-       /* check for possible wild cards in name */\r
-       glob_t globbuf;\r
-       int retval=0;\r
-       if (glob(fname, GLOB_ERR, NULL, &globbuf)==0) {\r
-               if (globbuf.gl_pathc>0) {\r
-                       retval=1;\r
-               }\r
-       }\r
-       globfree(&globbuf);\r
-       return retval;\r
-}\r
+/* This file is part of the IPCop Firewall.
+ *
+ * IPCop is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * IPCop 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with IPCop; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) 2003-04-22 Robert Kerr <rkerr@go.to>
+ *
+ * $Id: setuid.c,v 1.2.2.1 2005/11/18 14:51:43 franck78 Exp $
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <limits.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <glob.h>
+#include "setuid.h"
+
+#ifndef OPEN_MAX
+#define OPEN_MAX 256
+#endif
+
+/* Trusted environment for executing commands */
+char * trusted_env[4] = {
+       "PATH=/usr/bin:/usr/sbin:/sbin:/bin",
+       "SHELL=/bin/sh",
+       "TERM=dumb",
+       NULL
+};
+
+/* Spawns a child process that uses /bin/sh to interpret a command.
+ * This is much the same in use and purpose as system(), yet as it uses execve
+ * to pass a trusted environment it's immune to attacks based upon changing
+ * IFS, ENV, BASH_ENV and other such variables.
+ * Note this does NOT guard against any other attacks, inparticular you MUST
+ * validate the command you are passing. If the command is formed from user
+ * input be sure to check this input is what you expect. Nasty things can
+ * happen if a user can inject ; or `` into your command for example */
+int safe_system(char* command) {
+       return system_core(command, 0, 0, "safe_system");
+}
+
+/* Much like safe_system but lets you specify a non-root uid and gid to run
+ * the command as */
+int unpriv_system(char* command, uid_t uid, gid_t gid) {
+       return system_core(command, uid, gid, "unpriv_system");
+}
+
+int system_core(char* command, uid_t uid, gid_t gid, char *error) {
+       int pid, status;
+
+       if(!command)
+               return 1;
+
+       switch(pid = fork()) {
+               case -1:
+                       return -1;
+
+               case 0: /* child */ {
+                       char *argv[4];
+
+                       if (gid && setgid(gid)) {
+                               fprintf(stderr, "%s: ", error);
+                               perror("Couldn't setgid");
+                               exit(127);
+                       }
+
+                       if (uid && setuid(uid)) {
+                               fprintf(stderr, "%s: ", error);
+                               perror("Couldn't setuid");
+                               exit(127);
+                       }
+
+                       argv[0] = "sh";
+                       argv[1] = "-c";
+                       argv[2] = command;
+                       argv[3] = NULL;
+                       execve("/bin/sh", argv, trusted_env);
+                       fprintf(stderr, "%s: ", error);
+                       perror("execve failed");
+                       exit(127);
+               }
+
+               default: /* parent */
+                       do {
+                               if (waitpid(pid, &status, 0) == -1) {
+                                       if (errno != EINTR)
+                                               return -1;
+                                       } else {
+                                               return status;
+                                       }
+                       } while (1);
+       }
+
+}
+
+/* General routine to initialise a setuid root program, and put the
+ * environment in a known state. Returns 1 on success, if initsetuid() returns
+ * 0 then you should exit(1) immediately, DON'T attempt to recover from the
+ * error */
+int initsetuid(void) {
+       int fds, i;
+       struct stat st;
+       struct rlimit rlim;
+
+       /* Prevent signal tricks by ignoring all except SIGKILL and SIGCHILD */
+       for (i = 0; i < NSIG; i++) {
+               if (i != SIGKILL && i != SIGCHLD)
+                       signal(i, SIG_IGN);
+       }
+
+       /* dump all non-standard file descriptors (a full descriptor table could
+        * lead to DoS by preventing us opening files) */
+       if ((fds = getdtablesize()) == -1)
+               fds = OPEN_MAX;
+       for (i = 3; i < fds; i++)
+               close(i);
+
+       /* check stdin, stdout & stderr are open before going any further */
+       for (i = 0; i < 3; i++)
+               if( fstat(i, &st) == -1 && ((errno != EBADF) || (close(i), open("/dev/null", O_RDWR, 0)) != i))
+                       return 0;
+
+       /* disable core dumps in case we're processing sensitive information */
+       rlim.rlim_cur = rlim.rlim_max = 0;
+       if (setrlimit(RLIMIT_CORE, &rlim)) {
+               perror("Couldn't disable core dumps");
+               return 0;
+       }
+
+       /* drop any supplementary groups, set uid & gid to root */
+       if (setgroups(0, NULL)) {
+               perror("Couldn't clear group list");
+               return 0;
+       }
+
+       if (setgid(0)) {
+               perror("Couldn't setgid(0)");
+               return 0;
+       }
+
+       if (setuid(0)) {
+               perror("Couldn't setuid(0)");
+               return 0;
+       }
+
+       return 1;
+}
index e253a765704b0cdb0154293d59ce854faac48ee4..2e90537a6db86bd4e1f0ffb4b4a6f238f948afa5 100644 (file)
 /* As nothing in setuid.c uses STRING_SIZE specifically there's no real reason
  * to redefine it if it already is set */
 #ifndef STRING_SIZE
-#define STRING_SIZE 256
+#define STRING_SIZE 1024
 #endif
-#define LETTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
-#define NUMBERS "0123456789"
-#define LETTERS_NUMBERS LETTERS NUMBERS
-#define IP_NUMBERS "./" NUMBERS
-#define PORT_NUMBERS ":-" NUMBERS
-#define VALID_FQDN LETTERS_NUMBERS ".-"
-
-
-#define VALID_IP(ip) (strlen(ip) > 6 \
-                   && strlen(ip) < 16 \
-                   && strspn(ip, NUMBERS ".") == strlen(ip))
-
-#define VALID_IP_AND_MASK(ip) (strlen(ip) > 6 \
-                            && strlen(ip) < 32 \
-                            && strspn(ip, IP_NUMBERS) == strlen(ip))
-
-#define VALID_PORT(port) (strlen(port) \
-                       && strlen(port) < 6 \
-                       && strspn(port, NUMBERS) == strlen(port))
-
-#define VALID_PORT_RANGE(port) (strlen(port) \
-                             && strlen(port) < 12 \
-                             && strspn(port, PORT_NUMBERS) == strlen(port))
-
-#define VALID_SHORT_MASK(ip) (strlen(ip) > 1 \
-                             && strlen(ip) < 3 \
-                             && strspn(ip, NUMBERS) == strlen(ip))
-
-/* Can't find any info on valid characters/length hopefully these are
- * reasonable guesses */
-#define VALID_DEVICE(dev) (strlen(dev) \
-                        && strlen(dev) < 16 \
-                        && strspn(dev, LETTERS_NUMBERS ":.") == strlen(dev))
-
-/* Again, can't find any hard and fast rules for protocol names, these
- * restrictions are based on the keywords currently listed in
- * <http://www.iana.org/assignments/protocol-numbers>
- * though currently the ipcop cgis will only pass tcp, udp or gre anyway */
-#define VALID_PROTOCOL(prot) (strlen(prot) \
-                          &&  strlen(prot) <16 \
-                          &&  strspn(prot, LETTERS_NUMBERS "-") == strlen(prot))
 
 extern char * trusted_env[4];
 
 int system_core(char* command, uid_t uid, gid_t gid, char *error);
 int safe_system(char* command);
 int unpriv_system(char* command, uid_t uid, gid_t gid);
-size_t strlcat(char *dst, const char *src, size_t len);
 int initsetuid(void);
 
-/* check whether a file exists */
-int file_exists(const char *fname);        
-int file_exists_w(const char *fname); //wildcard filename test
+/* Compatibility for the local copy of strlcat,
+ * which has been removed. */
+#define strlcat(src, dst, size) strncat(src, dst, size)
 
 #endif
index d9dd8463fb15c32196ad92a96b456337d264026f..c6451acba3a031baaa1f2ce2856a668395a88a92 100644 (file)
 #include <fcntl.h>
 #include "setuid.h"
 
-#define BUFFER_SIZE 1024
-
-char command[BUFFER_SIZE]; 
-
 int main(int argc, char *argv[]) {
-
         if (!(initsetuid()))
-                exit(1);
+               exit(1);
 
-        if (argc < 2) {
-                fprintf(stderr, "\nNo argument given.\n\nsmartctrl <device>\n\n");
-                exit(1);
-        }
+       if (argc < 2) {
+               fprintf(stderr, "\nNo argument given.\n\nsmartctrl <device>\n\n");
+               exit(1);
+       }
 
+       char command[STRING_SIZE];
+       snprintf(command, STRING_SIZE, "/var/run/hddshutdown-%s", argv[1]);
 
-        sprintf(command, "/var/run/hddshutdown-%s", argv[1]);
-        FILE *fp = fopen(command,"r");
-       if( fp ) {
+        FILE *fp = fopen(command, "r");
+       if (fp != NULL) {
                fclose(fp);
+
                printf("\nDisk %s is in Standby. Do nothing because we won't wakeup\n",argv[1]);
-                exit(1);
+               exit(1);
        }
 
-        sprintf(command, "smartctl -iHA /dev/%s", argv[1]);
-        safe_system(command);
+       snprintf(command, STRING_SIZE, "smartctl -iHA /dev/%s", argv[1]);
+       safe_system(command);
 
         return 0;
 }
index 993cc938d98357b7a6e3fc72e9db9fec974b9c63..8111c84c56ac696084ff7af046e8db866c16fa1c 100644 (file)
 #include <fcntl.h>
 #include <signal.h>
 #include <errno.h>
+
 #include "libsmooth.h"
 #include "setuid.h"
+#include "netutil.h"
 
 #define ERR_ANY 1
 #define ERR_SETTINGS 2    /* error in settings file */
index 8ca7a81ae77572aac6a522629857bb08203f1a1a..e3a1107c2bff927bb2aa6e6b4d49bcb0e51ff8db 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
-#include "setuid.h"
 #include <errno.h>
 
+#include "setuid.h"
+#include "netutil.h"
+
 FILE *fd = NULL;
 char blue_dev[STRING_SIZE] = "";
 char command[STRING_SIZE];
diff --git a/src/patches/glibc/glibc-rh804630.patch b/src/patches/glibc/glibc-rh804630.patch
deleted file mode 100644 (file)
index 75dbe94..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -rup c/resolv/res_send.c d/resolv/res_send.c
---- c/resolv/res_send.c        2012-01-01 05:16:32.000000000 -0700
-+++ d/resolv/res_send.c        2012-03-30 12:39:30.862467628 -0600
-@@ -409,6 +409,7 @@ __libc_res_nsend(res_state statp, const
-        */
-       if (EXT(statp).nsinit == 0) {
-               unsigned char map[MAXNS];
-+              unsigned int ext_total_nscount;
-               memset (map, MAXNS, sizeof (map));
-               for (n = 0; n < MAXNS; n++) {
-@@ -422,8 +423,9 @@ __libc_res_nsend(res_state statp, const
-                       }
-               }
-               n = statp->nscount;
--              if (statp->nscount > EXT(statp).nscount)
--                      for (n = EXT(statp).nscount, ns = 0;
-+              ext_total_nscount = EXT(statp).nscount + EXT(statp).nscount6;
-+              if (statp->nscount > ext_total_nscount)
-+                      for (n = ext_total_nscount, ns = 0;
-                            n < statp->nscount; n++) {
-                               while (ns < MAXNS
-                                      && EXT(statp).nsmap[ns] != MAXNS)
diff --git a/src/patches/glibc/glibc-rh804686.patch b/src/patches/glibc/glibc-rh804686.patch
new file mode 100644 (file)
index 0000000..292cd84
--- /dev/null
@@ -0,0 +1,87 @@
+--- a/resolv/res_query.c       2010-05-04 05:27:23.000000000 -0600
++++ a/resolv/res_query.c       2012-08-03 13:43:10.761506047 -0600
+@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp,
+                 int *resplen2)
+ {
+       HEADER *hp = (HEADER *) answer;
++      HEADER *hp2;
+       int n, use_malloc = 0;
+         u_int oflags = statp->_flags;
+@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp,
+         /* __libc_res_nsend might have reallocated the buffer.  */
+         hp = (HEADER *) *answerp;
+-      /* We simplify the following tests by assigning HP to HP2.  It
+-         is easy to verify that this is the same as ignoring all
+-         tests of HP2.  */
+-      HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp;
+-
+-      if (n < (int) sizeof (HEADER) && answerp2 != NULL
+-          && *resplen2 > (int) sizeof (HEADER))
++      /* We simplify the following tests by assigning HP to HP2 or
++         vice versa.  It is easy to verify that this is the same as
++         ignoring all tests of HP or HP2.  */
++      if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER))
+         {
+-          /* Special case of partial answer.  */
+-          assert (hp != hp2);
+-          hp = hp2;
++          hp2 = hp;
+         }
+-      else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER)
+-               && n > (int) sizeof (HEADER))
++      else
+         {
+-          /* Special case of partial answer.  */
+-          assert (hp != hp2);
+-          hp2 = hp;
++          hp2 = (HEADER *) *answerp2;
++          if (n < (int) sizeof (HEADER))
++            {
++              hp = hp2;
++            }
+         }
++      /* Make sure both hp and hp2 are defined */
++      assert((hp != NULL) && (hp2 != NULL));
++
+       if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0)
+           && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) {
+ #ifdef DEBUG
+--- a/resolv/res_send.c        2012-08-03 13:31:26.622168278 -0600
++++ a/resolv/res_send.c        2012-08-03 13:43:11.881501862 -0600
+@@ -549,7 +549,7 @@ __libc_res_nsend(res_state statp, const
+                                   ns, ansp, ansp2, nansp2, resplen2);
+                       if (n < 0)
+                               return (-1);
+-                      if (n == 0)
++                      if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+                               goto next_ns;
+               } else {
+                       /* Use datagrams. */
+@@ -559,7 +559,7 @@ __libc_res_nsend(res_state statp, const
+                                   ansp2, nansp2, resplen2);
+                       if (n < 0)
+                               return (-1);
+-                      if (n == 0)
++                      if (n == 0 && (buf2 == NULL || *resplen2 == 0))
+                               goto next_ns;
+                       if (v_circuit)
+                         // XXX Check whether both requests failed or
+@@ -1275,10 +1275,14 @@ send_dg(res_state statp,
+                               (*thisresplenp > *thisanssizp)
+                               ? *thisanssizp : *thisresplenp);
+-                      if (recvresp1 || (buf2 != NULL && recvresp2))
++                      if (recvresp1 || (buf2 != NULL && recvresp2)) {
++                        *resplen2 = 0;
+                         return resplen;
++                      }
+                       if (buf2 != NULL)
+                         {
++                          /* No data from the first reply.  */
++                          resplen = 0;
+                           /* We are waiting for a possible second reply.  */
+                           if (hp->id == anhp->id)
+                             recvresp1 = 1;
diff --git a/src/patches/glibc/glibc-rh806404.patch b/src/patches/glibc/glibc-rh806404.patch
new file mode 100644 (file)
index 0000000..b78b903
--- /dev/null
@@ -0,0 +1,12 @@
+diff -rup a/nss/getnssent.c b/nss/getnssent.c
+--- a/nss/getnssent.c  2004-12-13 14:48:34.000000000 -0700
++++ b/nss/getnssent.c  2012-03-23 13:46:54.639095121 -0600
+@@ -33,7 +33,7 @@ __nss_getent (getent_r_function func, vo
+       *buffer = malloc (*buffer_size);
+     }
+-  while (buffer != NULL
++  while (*buffer != NULL
+        && func (resbuf, *buffer, *buffer_size, &result, h_errnop) == ERANGE
+        && (h_errnop == NULL || *h_errnop == NETDB_INTERNAL))
+     {
diff --git a/src/patches/glibc/glibc-rh809726.patch b/src/patches/glibc/glibc-rh809726.patch
new file mode 100644 (file)
index 0000000..0f264c8
--- /dev/null
@@ -0,0 +1,89 @@
+diff -rup a/localedata/locales/fi_FI b/localedata/locales/fi_FI
+--- a/localedata/locales/fi_FI 2012-07-11 14:48:45.994749607 -0600
++++ b/localedata/locales/fi_FI 2012-07-11 14:50:20.003277477 -0600
+@@ -63,60 +63,65 @@ reorder-after <z>
+ <a-diaerisis>
+ <o-diaerisis>
+-reorder-after <U005A>
++reorder-after <U007A>
+ <U00E5> <a-ring>;<BAS>;<MIN>;IGNORE
+-<U00C5> <a-ring>;<BAS>;<CAP>;IGNORE
+ <U01FB> <a-ring>;<ACA>;<MIN>;IGNORE
+-<U01FA> <a-ring>;<ACA>;<CAP>;IGNORE
+ <U00E4> <a-diaerisis>;<BAS>;<MIN>;IGNORE
+-<U00C4> <a-diaerisis>;<BAS>;<CAP>;IGNORE
+ <U00E6> <a-diaerisis>;<REU>;<MIN>;IGNORE
+-<U00C6> <a-diaerisis>;<REU>;<CAP>;IGNORE
+ <U01FD> <a-diaerisis>;<U01FD>;<MIN>;IGNORE
+-<U01FC> <a-diaerisis>;<U01FD>;<CAP>;IGNORE
+ <U01E3> <a-diaerisis>;<MAC>;<MIN>;IGNORE
+-<U01E2> <a-diaerisis>;<MAC>;<CAP>;IGNORE
+ <U00F6> <o-diaerisis>;<BAS>;<MIN>;IGNORE
+-<U00D6> <o-diaerisis>;<BAS>;<CAP>;IGNORE
+ <U00F8> <o-diaerisis>;<U00D8>;<MIN>;IGNORE
+-<U00D8> <o-diaerisis>;<U00D8>;<CAP>;IGNORE
+ <U01FF> <o-diaerisis>;<U01FF>;<MIN>;IGNORE
+-<U01FE> <o-diaerisis>;<U01FF>;<CAP>;IGNORE
+ <U00F5> <o-diaerisis>;<TIL>;<MIN>;IGNORE
++reorder-after <U005A>
++<U00C5> <a-ring>;<BAS>;<CAP>;IGNORE
++<U01FA> <a-ring>;<ACA>;<CAP>;IGNORE
++<U00C4> <a-diaerisis>;<BAS>;<CAP>;IGNORE
++<U00C6> <a-diaerisis>;<REU>;<CAP>;IGNORE
++<U01FC> <a-diaerisis>;<U01FD>;<CAP>;IGNORE
++<U01E2> <a-diaerisis>;<MAC>;<CAP>;IGNORE
++<U00D6> <o-diaerisis>;<BAS>;<CAP>;IGNORE
++<U00D8> <o-diaerisis>;<U00D8>;<CAP>;IGNORE
++<U01FE> <o-diaerisis>;<U01FF>;<CAP>;IGNORE
+ <U00D5> <o-diaerisis>;<TIL>;<CAP>;IGNORE
+-reorder-after <U016A>
++reorder-after <U016B>
+ <U0076> <v>;<U0056>;<BAS>;<MIN>
+-<U0056> <v>;<U0056>;<BAS>;<CAP>
+ <U1E7D> <v>;<U0056>;<TIL>;<MIN>
+-<U1E7C> <v>;<U0056>;<TIL>;<CAP>
+ <U0077> <w>;<U0057>;<BAS>;<MIN>
+-<U0057> <w>;<U0057>;<BAS>;<CAP>
+ <U1E83> <w>;<U0057>;<ACA>;<MIN>
+-<U1E82> <w>;<U0057>;<ACA>;<CAP>
+ <U1E81> <w>;<U0057>;<GRA>;<MIN>
+-<U1E80> <w>;<U0057>;<GRA>;<CAP>
+ <U0175> <w>;<U0057>;<CIR>;<MIN>
+-<U0174> <w>;<U0057>;<CIR>;<CAP>
+ <U1E85> <w>;<U0057>;<REU>;<MIN>
+-<U1E84> <w>;<U0057>;<REU>;<CAP>
+ <U1E87> <w>;<U0057>;<PCT>;<MIN>
++reorder-after <U016A>
++<U0056> <v>;<U0056>;<BAS>;<CAP>
++<U1E7C> <v>;<U0056>;<TIL>;<CAP>
++<U0057> <w>;<U0057>;<BAS>;<CAP>
++<U1E82> <w>;<U0057>;<ACA>;<CAP>
++<U1E80> <w>;<U0057>;<GRA>;<CAP>
++<U0174> <w>;<U0057>;<CIR>;<CAP>
++<U1E84> <w>;<U0057>;<REU>;<CAP>
+ <U1E86> <w>;<U0057>;<PCT>;<CAP>
+ reorder-after <U00FF>
+ <U00FC> <y>;<DTT>;<MIN>;IGNORE
++reorder-after <U0178>
+ <U00DC> <y>;<DTT>;<CAP>;IGNORE
+ %  Present in iso14651_t1, but these definitions seem to have been
+ %  removed from latest iso14651 tables.
+-reorder-after <U0162>
++reorder-after <U0163>
+ <U00FE> "<t><h>";"<LIG><LIG>";"<MIN><MIN>";IGNORE
++reorder-after <U0162>
+ <U00DE> "<t><h>";"<LIG><LIG>";"<CAP><CAP>";IGNORE
+ reorder-after <U0064>
+ <U00F0> <d>;<PCL>;<MIN>;IGNORE
+-<U00D0> <d>;<PCL>;<CAP>;IGNORE
+ <U0111> <d>;<OBL>;<MIN>;IGNORE
++reorder-after <U0044>
++<U00D0> <d>;<PCL>;<CAP>;IGNORE
+ <U0110> <d>;<OBL>;<CAP>;IGNORE
+ reorder-end
diff --git a/src/patches/glibc/glibc-rh823909.patch b/src/patches/glibc/glibc-rh823909.patch
new file mode 100644 (file)
index 0000000..ed9c4c9
--- /dev/null
@@ -0,0 +1,25 @@
+diff --git a/iconvdata/ibm930.c b/iconvdata/ibm930.c
+index 25a9be0..6f758eb 100644
+--- a/iconvdata/ibm930.c
++++ b/iconvdata/ibm930.c
+@@ -162,7 +162,8 @@ enum
+       while (ch > rp2->end)                                                 \
+         ++rp2;                                                              \
+                                                                             \
+-      if (__builtin_expect (ch < rp2->start, 0)                             \
++      if (__builtin_expect (rp2->start == 0xffff, 0)                        \
++          || __builtin_expect (ch < rp2->start, 0)                          \
+           || (res = __ibm930db_to_ucs4[ch + rp2->idx],                      \
+               __builtin_expect (res, L'\1') == L'\0' && ch != '\0'))        \
+         {                                                                   \
+@@ -215,7 +216,8 @@ enum
+       while (ch > rp2->end)                                                 \
+         ++rp2;                                                              \
+                                                                             \
+-      if (__builtin_expect (ch < rp2->start, 0)                             \
++      if (__builtin_expect (rp2->start == 0xffff, 0)                        \
++          || __builtin_expect (ch < rp2->start, 0)                          \
+           || (cp = __ucs4_to_ibm930db[ch + rp2->idx],                       \
+               __builtin_expect (cp[0], L'\1')== L'\0' && ch != '\0'))       \
+         {                                                                   \
+
diff --git a/src/patches/glibc/glibc-rh826149.patch b/src/patches/glibc/glibc-rh826149.patch
new file mode 100644 (file)
index 0000000..805572b
--- /dev/null
@@ -0,0 +1,80 @@
+diff -Nrup a/posix/fnmatch.c b/posix/fnmatch.c
+--- a/posix/fnmatch.c  2012-05-25 12:37:26.566678872 -0400
++++ b/posix/fnmatch.c  2012-05-25 13:08:44.451972286 -0400
+@@ -333,6 +333,7 @@ fnmatch (pattern, string, flags)
+ # if HANDLE_MULTIBYTE
+   if (__builtin_expect (MB_CUR_MAX, 1) != 1)
+     {
++      const char *orig_pattern = pattern;
+       mbstate_t ps;
+       size_t n;
+       const char *p;
+@@ -356,10 +357,9 @@ fnmatch (pattern, string, flags)
+                                                alloca_used);
+         n = mbsrtowcs (wpattern, &p, n + 1, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+-          /* Something wrong.
+-             XXX Do we have to set `errno' to something which mbsrtows hasn't
+-             already done?  */
+-          return -1;
++          /* Something wrong: Fall back to single byte matching. */
++          goto try_singlebyte;
++
+         if (p)
+           {
+             memset (&ps, '\0', sizeof (ps));
+@@ -371,10 +371,8 @@ fnmatch (pattern, string, flags)
+       prepare_wpattern:
+         n = mbsrtowcs (NULL, &pattern, 0, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+-          /* Something wrong.
+-             XXX Do we have to set `errno' to something which mbsrtows hasn't
+-             already done?  */
+-          return -1;
++          /* Something wrong: Fall back to single byte matching. */
++          goto try_singlebyte;
+         if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
+           {
+             __set_errno (ENOMEM);
+@@ -401,14 +399,8 @@ fnmatch (pattern, string, flags)
+                                               alloca_used);
+         n = mbsrtowcs (wstring, &p, n + 1, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+-          {
+-            /* Something wrong.
+-               XXX Do we have to set `errno' to something which
+-               mbsrtows hasn't already done?  */
+-          free_return:
+-            free (wpattern_malloc);
+-            return -1;
+-          }
++          /* Something wrong: Fall back to single byte matching. */
++          goto free_and_try_singlebyte;
+         if (p)
+           {
+             memset (&ps, '\0', sizeof (ps));
+@@ -420,10 +412,8 @@ fnmatch (pattern, string, flags)
+       prepare_wstring:
+         n = mbsrtowcs (NULL, &string, 0, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+-          /* Something wrong.
+-             XXX Do we have to set `errno' to something which mbsrtows hasn't
+-             already done?  */
+-          goto free_return;
++          /* Something wrong: Fall back to single byte matching. */
++          goto free_and_try_singlebyte;
+         if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
+           {
+             free (wpattern_malloc);
+@@ -450,6 +440,11 @@ fnmatch (pattern, string, flags)
+       free (wpattern_malloc);
+       return res;
++
++      free_and_try_singlebyte:
++      free(wpattern_malloc);
++      try_singlebyte:
++      pattern = orig_pattern;
+     }
+ # endif  /* mbstate_t and mbsrtowcs or _LIBC.  */
diff --git a/src/patches/glibc/glibc-rh827362.patch b/src/patches/glibc/glibc-rh827362.patch
new file mode 100644 (file)
index 0000000..7e6d07e
--- /dev/null
@@ -0,0 +1,250 @@
+diff -pruN glibc-2.12-2-gc4ccff1/libio/Makefile glibc-2.12-2-gc4ccff1.fseek/libio/Makefile
+--- glibc-2.12-2-gc4ccff1/libio/Makefile       2010-05-04 16:57:23.000000000 +0530
++++ glibc-2.12-2-gc4ccff1.fseek/libio/Makefile 2012-09-05 17:28:08.699360413 +0530
+@@ -58,7 +58,7 @@ tests = tst_swprintf tst_wprintf tst_sws
+       tst-memstream1 tst-memstream2 \
+       tst-wmemstream1 tst-wmemstream2 \
+       bug-memstream1 bug-wmemstream1 \
+-      tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos
++      tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek
+ test-srcs = test-freopen
+ all: # Make this the default target; it will be defined in Rules.
+diff -pruN glibc-2.12-2-gc4ccff1/libio/tst-fseek.c glibc-2.12-2-gc4ccff1.fseek/libio/tst-fseek.c
+--- glibc-2.12-2-gc4ccff1/libio/tst-fseek.c    1970-01-01 05:30:00.000000000 +0530
++++ glibc-2.12-2-gc4ccff1.fseek/libio/tst-fseek.c      2012-09-05 17:27:33.606359692 +0530
+@@ -0,0 +1,153 @@
++/* Verify that fseek/ftell combination works for wide chars.
++
++   Copyright (C) 2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <locale.h>
++#include <errno.h>
++#include <wchar.h>
++#include <unistd.h>
++#include <string.h>
++
++/* Defined in test-skeleton.c.  */
++static int create_temp_file (const char *base, char **filename);
++
++
++static int
++do_seek_end (FILE *fp)
++{
++  long save;
++
++  if (fp == NULL)
++    {
++      printf ("do_seek_end: fopen: %s\n", strerror (errno));
++      return 1;
++    }
++
++  if (fputws (L"abc\n", fp) == -1)
++    {
++      printf ("do_seek_end: fputws: %s\n", strerror (errno));
++      return 1;
++    }
++
++  save = ftell (fp);
++  rewind (fp);
++
++  if (fseek (fp, 0, SEEK_END) == -1)
++    {
++      printf ("do_seek_end: fseek: %s\n", strerror (errno));
++      return 1;
++    }
++
++  if (save != ftell (fp))
++    {
++      printf ("save = %ld, ftell = %ld\n", save, ftell (fp));
++      return 1;
++    }
++
++  return 0;
++}
++
++int
++do_seek_set (FILE *fp)
++{
++  long save;
++
++  if (fputws (L"abc\n", fp) == -1)
++    {
++      printf ("seek_set: fputws: %s\n", strerror (errno));
++      return 1;
++    }
++
++  save = ftell (fp);
++
++  if (fputws (L"xyz\n", fp) == -1)
++    {
++      printf ("seek_set: fputws: %s\n", strerror (errno));
++      return 1;
++    }
++
++  if (fseek (fp, save, SEEK_SET) == -1)
++    {
++      printf ("seek_set: fseek: %s\n", strerror (errno));
++      return 1;
++    }
++
++  if (save != ftell (fp))
++    {
++      printf ("save = %ld, ftell = %ld\n", save, ftell (fp));
++      return 1;
++    }
++
++  return 0;
++}
++
++static int
++do_test (void)
++{
++  if (setlocale (LC_ALL, "en_US.utf8") == NULL)
++    {
++      printf ("Cannot set en_US.utf8 locale.\n");
++      exit (1);
++    }
++
++  int ret = 0;
++  char *filename;
++  int fd = create_temp_file ("tst-fseek.out", &filename);
++
++  if (fd == -1)
++    return 1;
++
++  FILE *fp = fdopen (fd, "w+");
++  if (fp == NULL)
++    {
++      printf ("seek_set: fopen: %s\n", strerror (errno));
++      close (fd);
++      return 1;
++    }
++
++  if (do_seek_set (fp))
++    {
++      printf ("SEEK_SET test failed\n");
++      ret = 1;
++    }
++
++  /* Reopen the file.  */
++  fclose (fp);
++  fp = fopen (filename, "w+");
++  if (fp == NULL)
++    {
++      printf ("seek_end: fopen: %s\n", strerror (errno));
++      return 1;
++    }
++
++  if (do_seek_end (fp))
++    {
++      printf ("SEEK_END test failed\n");
++      ret = 1;
++    }
++
++  fclose (fp);
++
++  return ret;
++}
++
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff -pruN glibc-2.12-2-gc4ccff1/libio/wfileops.c glibc-2.12-2-gc4ccff1.fseek/libio/wfileops.c
+--- glibc-2.12-2-gc4ccff1/libio/wfileops.c     2010-05-04 16:57:23.000000000 +0530
++++ glibc-2.12-2-gc4ccff1.fseek/libio/wfileops.c       2012-09-05 17:27:33.608359685 +0530
+@@ -547,6 +547,55 @@ _IO_wfile_sync (fp)
+ }
+ INTDEF(_IO_wfile_sync)
++/* Adjust the internal buffer pointers to reflect the state in the external
++   buffer.  The content between fp->_IO_read_base and fp->_IO_read_ptr is
++   assumed to be converted and available in the range
++   fp->_wide_data->_IO_read_base and fp->_wide_data->_IO_read_end.  */
++static inline int
++adjust_wide_data (_IO_FILE *fp, bool do_convert)
++{
++  struct _IO_codecvt *cv = fp->_codecvt;
++
++  int clen = (*cv->__codecvt_do_encoding) (cv);
++
++  /* Take the easy way out for constant length encodings if we don't need to
++     convert.  */
++  if (!do_convert && clen > 0)
++    {
++      fp->_wide_data->_IO_read_end += ((fp->_IO_read_ptr - fp->_IO_read_base)
++                                     / clen);
++      goto done;
++    }
++
++  enum __codecvt_result status;
++  const char *read_stop = (const char *) fp->_IO_read_base;
++  do
++    {
++
++      fp->_wide_data->_IO_last_state = fp->_wide_data->_IO_state;
++      status = (*cv->__codecvt_do_in) (cv, &fp->_wide_data->_IO_state,
++                                     fp->_IO_read_base, fp->_IO_read_ptr,
++                                     &read_stop,
++                                     fp->_wide_data->_IO_read_base,
++                                     fp->_wide_data->_IO_buf_end,
++                                     &fp->_wide_data->_IO_read_end);
++
++      /* Should we return EILSEQ?  */
++      if (__builtin_expect (status == __codecvt_error, 0))
++      {
++        fp->_flags |= _IO_ERR_SEEN;
++        return -1;
++      }
++    }
++  while (__builtin_expect (status == __codecvt_partial, 0));
++
++done:
++  /* Now seek to the end of the read buffer.  */
++  fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
++
++  return 0;
++}
++
+ _IO_off64_t
+ _IO_wfile_seekoff (fp, offset, dir, mode)
+      _IO_FILE *fp;
+@@ -695,6 +744,10 @@ _IO_wfile_seekoff (fp, offset, dir, mode
+                    fp->_wide_data->_IO_buf_base);
+         _IO_wsetp (fp, fp->_wide_data->_IO_buf_base,
+                    fp->_wide_data->_IO_buf_base);
++
++        if (adjust_wide_data (fp, false))
++          goto dumb;
++
+         _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
+         goto resync;
+       }
+@@ -735,6 +788,10 @@ _IO_wfile_seekoff (fp, offset, dir, mode
+   _IO_wsetg (fp, fp->_wide_data->_IO_buf_base,
+            fp->_wide_data->_IO_buf_base, fp->_wide_data->_IO_buf_base);
+   _IO_wsetp (fp, fp->_wide_data->_IO_buf_base, fp->_wide_data->_IO_buf_base);
++
++  if (adjust_wide_data (fp, true))
++    goto dumb;
++
+   fp->_offset = result + count;
+   _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
+   return offset;
diff --git a/src/patches/glibc/glibc-rh830127.patch b/src/patches/glibc/glibc-rh830127.patch
new file mode 100644 (file)
index 0000000..06dea73
--- /dev/null
@@ -0,0 +1,403 @@
+diff -Nrup a/stdio-common/bug22.c b/stdio-common/bug22.c
+--- a/stdio-common/bug22.c     2010-05-04 05:27:23.000000000 -0600
++++ b/stdio-common/bug22.c     2012-08-03 13:56:40.887829210 -0600
+@@ -1,12 +1,22 @@
+ /* BZ #5424 */
+ #include <stdio.h>
++#include <errno.h>
++/* INT_MAX + 1 */
+ #define N 2147483648
++/* (INT_MAX / 2) + 2 */
++#define N2 1073741825
++
++/* INT_MAX - 3 */
++#define N3 2147483644
++
+ #define STRINGIFY(S) #S
+ #define MAKE_STR(S) STRINGIFY(S)
+ #define SN MAKE_STR(N)
++#define SN2 MAKE_STR(N2)
++#define SN3 MAKE_STR(N3)
+ static int
+ do_test (void)
+@@ -20,13 +30,27 @@ do_test (void)
+       return 1;
+     }
+-  ret = fprintf (fp, "%" SN "d%" SN "d", 1, 1);
++  ret = fprintf (fp, "%" SN "d", 1);
++  printf ("ret = %d\n", ret);
++  if (ret != -1 || errno != EOVERFLOW)
++        return 1;
++
++  ret = fprintf (fp, "%." SN "d", 1);
++  printf ("ret = %d\n", ret);
++  if (ret != -1 || errno != EOVERFLOW)
++        return 1;
++
++  ret = fprintf (fp, "%." SN3 "d", 1);
++  printf ("ret = %d\n", ret);
++  if (ret != -1 || errno != EOVERFLOW)
++        return 1;
++  ret = fprintf (fp, "%" SN2 "d%" SN2 "d", 1, 1);
+   printf ("ret = %d\n", ret);
+-  return ret != -1;
++  return ret != -1 || errno != EOVERFLOW;
+ }
+-#define TIMEOUT 30
++#define TIMEOUT 60
+ #define TEST_FUNCTION do_test ()
+ #include "../test-skeleton.c"
+diff -Nrup a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
+--- a/stdio-common/printf-parse.h      2010-05-04 05:27:23.000000000 -0600
++++ b/stdio-common/printf-parse.h      2012-08-03 13:57:31.932638761 -0600
+@@ -14,9 +14,8 @@
+    Lesser General Public License for more details.
+    You should have received a copy of the GNU Lesser General Public
+-   License along with the GNU C Library; if not, write to the Free
+-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-   02111-1307 USA.  */
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
+ #include <printf.h>
+ #include <stdint.h>
+@@ -69,16 +68,27 @@ union printf_arg
+ #ifndef DONT_NEED_READ_INT
+ /* Read a simple integer from a string and update the string pointer.
+    It is assumed that the first character is a digit.  */
+-static unsigned int
++static int
+ read_int (const UCHAR_T * *pstr)
+ {
+-  unsigned int retval = **pstr - L_('0');
++  int retval = **pstr - L_('0');
+   while (ISDIGIT (*++(*pstr)))
+-    {
+-      retval *= 10;
+-      retval += **pstr - L_('0');
+-    }
++    if (retval >= 0)
++      {
++      if (INT_MAX / 10 < retval)
++        retval = -1;
++      else
++        {
++          int digit = **pstr - L_('0');
++
++          retval *= 10;
++          if (INT_MAX - digit < retval)
++            retval = -1;
++          else
++            retval += digit;
++        }
++      }
+   return retval;
+ }
+diff -Nrup a/stdio-common/printf-parsemb.c b/stdio-common/printf-parsemb.c
+--- a/stdio-common/printf-parsemb.c    2010-05-04 05:27:23.000000000 -0600
++++ b/stdio-common/printf-parsemb.c    2012-08-03 13:58:44.683366361 -0600
+@@ -13,9 +13,8 @@
+    Lesser General Public License for more details.
+    You should have received a copy of the GNU Lesser General Public
+-   License along with the GNU C Library; if not, write to the Free
+-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-   02111-1307 USA.  */
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
+ #include <ctype.h>
+ #include <limits.h>
+@@ -88,12 +87,15 @@ __parse_one_specmb (const UCHAR_T *forma
+       n = read_int (&format);
+-      if (n > 0 && *format == L_('$'))
++      if (n != 0 && *format == L_('$'))
+       /* Is positional parameter.  */
+       {
+         ++format;             /* Skip the '$'.  */
+-        spec->data_arg = n - 1;
+-        *max_ref_arg = MAX (*max_ref_arg, n);
++        if (n != -1)
++          {
++            spec->data_arg = n - 1;
++            *max_ref_arg = MAX (*max_ref_arg, n);
++          }
+       }
+       else
+       /* Oops; that was actually the width and/or 0 padding flag.
+@@ -161,10 +163,13 @@ __parse_one_specmb (const UCHAR_T *forma
+         /* The width argument might be found in a positional parameter.  */
+         n = read_int (&format);
+-        if (n > 0 && *format == L_('$'))
++        if (n != 0 && *format == L_('$'))
+           {
+-            spec->width_arg = n - 1;
+-            *max_ref_arg = MAX (*max_ref_arg, n);
++            if (n != -1)
++              {
++                spec->width_arg = n - 1;
++                *max_ref_arg = MAX (*max_ref_arg, n);
++              }
+             ++format;         /* Skip '$'.  */
+           }
+       }
+@@ -178,9 +183,13 @@ __parse_one_specmb (const UCHAR_T *forma
+       }
+     }
+   else if (ISDIGIT (*format))
+-    /* Constant width specification.  */
+-    spec->info.width = read_int (&format);
++    {
++      int n = read_int (&format);
++      /* Constant width specification.  */
++      if (n != -1)
++      spec->info.width = n;
++    }
+   /* Get the precision.  */
+   spec->prec_arg = -1;
+   /* -1 means none given; 0 means explicit 0.  */
+@@ -197,10 +206,13 @@ __parse_one_specmb (const UCHAR_T *forma
+           {
+             n = read_int (&format);
+-            if (n > 0 && *format == L_('$'))
++            if (n != 0 && *format == L_('$'))
+               {
+-                spec->prec_arg = n - 1;
+-                *max_ref_arg = MAX (*max_ref_arg, n);
++                if (n != -1)
++                  {
++                    spec->prec_arg = n - 1;
++                    *max_ref_arg = MAX (*max_ref_arg, n);
++                  }
+                 ++format;
+               }
+           }
+@@ -214,7 +226,12 @@ __parse_one_specmb (const UCHAR_T *forma
+           }
+       }
+       else if (ISDIGIT (*format))
+-      spec->info.prec = read_int (&format);
++      {
++        int n = read_int (&format);
++
++        if (n != -1)
++          spec->info.prec = n;
++      }
+       else
+       /* "%.?" is treated like "%.0?".  */
+       spec->info.prec = 0;
+@@ -295,9 +312,9 @@ __parse_one_specmb (const UCHAR_T *forma
+       /* We don't try to get the types for all arguments if the format
+        uses more than one.  The normal case is covered though.  If
+        the call returns -1 we continue with the normal specifiers.  */
+-      || (spec->ndata_args = (*__printf_arginfo_table[spec->info.spec])
+-        (&spec->info, 1, &spec->data_arg_type,
+-         &spec->size)) < 0)
++      || (int) (spec->ndata_args = (*__printf_arginfo_table[spec->info.spec])
++                                 (&spec->info, 1, &spec->data_arg_type,
++                                  &spec->size)) < 0)
+     {
+       /* Find the data argument types of a built-in spec.  */
+       spec->ndata_args = 1;
+diff -Nrup a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
+--- a/stdio-common/vfprintf.c  2012-08-03 13:31:26.605168350 -0600
++++ b/stdio-common/vfprintf.c  2012-08-03 14:09:26.836725512 -0600
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991-2008, 2009   Free Software Foundation, Inc.
++/* Copyright (C) 1991-2012   Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -12,9 +12,8 @@
+    Lesser General Public License for more details.
+    You should have received a copy of the GNU Lesser General Public
+-   License along with the GNU C Library; if not, write to the Free
+-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-   02111-1307 USA.  */
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
+ #include <ctype.h>
+ #include <limits.h>
+@@ -67,10 +66,10 @@
+   do {                                                                              \
+     unsigned int _val = val;                                                \
+     assert ((unsigned int) done < (unsigned int) INT_MAX);                  \
+-    if (__builtin_expect ((unsigned int) INT_MAX - (unsigned int) done              \
+-                        < _val, 0))                                         \
++    if (__builtin_expect (INT_MAX - done < _val, 0))                        \
+       {                                                                             \
+       done = -1;                                                            \
++       __set_errno (EOVERFLOW);                                             \
+       goto all_done;                                                        \
+       }                                                                             \
+     done += _val;                                                           \
+@@ -141,12 +140,17 @@
+   do                                                                        \
+     {                                                                       \
+       assert ((size_t) done <= (size_t) INT_MAX);                           \
+-      if ((size_t) PUT (s, (String), (Len)) != (size_t) (Len)               \
+-        || (size_t) INT_MAX - (size_t) done < (size_t) (Len))               \
++      if ((size_t) PUT (s, (String), (Len)) != (size_t) (Len))                      \
+       {                                                                     \
+         done = -1;                                                          \
+         goto all_done;                                                      \
+       }                                                                     \
++      if (__builtin_expect (INT_MAX - done < (Len), 0))                             \
++      {                                                                             \
++      done = -1;                                                            \
++       __set_errno (EOVERFLOW);                                             \
++      goto all_done;                                                        \
++      }                                                                             \
+       done += (Len);                                                        \
+     }                                                                       \
+   while (0)
+@@ -1435,10 +1439,21 @@ vfprintf (FILE *s, const CHAR_T *format,
+       const UCHAR_T *tmp;     /* Temporary value.  */
+       tmp = ++f;
+-      if (ISDIGIT (*tmp) && read_int (&tmp) && *tmp == L_('$'))
+-        /* The width comes from a positional parameter.  */
+-        goto do_positional;
++      if (ISDIGIT (*tmp))
++        {
++          int pos = read_int (&tmp);
++          if (pos == -1)
++            {
++              __set_errno (EOVERFLOW);
++              done = -1;
++              goto all_done;
++            }
++
++          if (pos && *tmp == L_('$'))
++            /* The width comes from a positional parameter.  */
++            goto do_positional;
++        }
+       width = va_arg (ap, int);
+       /* Negative width means left justified.  */
+@@ -1449,9 +1464,9 @@ vfprintf (FILE *s, const CHAR_T *format,
+           left = 1;
+         }
+-      if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
++      if (__builtin_expect (width >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+         {
+-          __set_errno (ERANGE);
++          __set_errno (EOVERFLOW);
+           done = -1;
+           goto all_done;
+         }
+@@ -1481,9 +1496,10 @@ vfprintf (FILE *s, const CHAR_T *format,
+     LABEL (width):
+       width = read_int (&f);
+-      if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
++      if (__builtin_expect (width == -1
++                          || width >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+       {
+-        __set_errno (ERANGE);
++        __set_errno (EOVERFLOW);
+         done = -1;
+         goto all_done;
+       }
+@@ -1518,10 +1534,21 @@ vfprintf (FILE *s, const CHAR_T *format,
+         const UCHAR_T *tmp;   /* Temporary value.  */
+         tmp = ++f;
+-        if (ISDIGIT (*tmp) && read_int (&tmp) > 0 && *tmp == L_('$'))
+-          /* The precision comes from a positional parameter.  */
+-          goto do_positional;
++        if (ISDIGIT (*tmp))
++          {
++            int pos = read_int (&tmp);
++
++            if (pos == -1)
++              {
++                __set_errno (EOVERFLOW);
++                done = -1;
++                goto all_done;
++              }
++            if (pos && *tmp == L_('$'))
++              /* The precision comes from a positional parameter.  */
++              goto do_positional;
++          }
+         prec = va_arg (ap, int);
+         /* If the precision is negative the precision is omitted.  */
+@@ -1529,15 +1556,26 @@ vfprintf (FILE *s, const CHAR_T *format,
+           prec = -1;
+       }
+       else if (ISDIGIT (*f))
+-      prec = read_int (&f);
++      {
++        prec = read_int (&f);
++
++        /* The precision was specified in this case as an extremely
++           large positive value.  */
++        if (prec == -1)
++          {
++            __set_errno (EOVERFLOW);
++            done = -1;
++            goto all_done;
++          }
++      }
+       else
+       prec = 0;
+       if (prec > width
+         && prec > sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
+       {
+-        if (__builtin_expect (prec >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
++        if (__builtin_expect (prec >= INT_MAX / sizeof (CHAR_T) - 32, 0))
+           {
+-            __set_errno (ERANGE);
++            __set_errno (EOVERFLOW);
+             done = -1;
+             goto all_done;
+           }
+@@ -1722,13 +1760,13 @@ do_positional:
+     nargs = MAX (nargs, max_ref_arg);
+     /* Calculate total size needed to represent a single argument across
+        all three argument-related arrays.  */
+-    bytes_per_arg = sizeof (*args_value) + sizeof (*args_size)
+-                    + sizeof (*args_type);
++    bytes_per_arg = (sizeof (*args_value) + sizeof (*args_size)
++                   + sizeof (*args_type));
+     /* Check for potential integer overflow.  */
+-    if (__builtin_expect (nargs > SIZE_MAX / bytes_per_arg, 0))
++    if (__builtin_expect (nargs > INT_MAX / bytes_per_arg, 0))
+       {
+-         __set_errno (ERANGE);
++       __set_errno (EOVERFLOW);
+          done = -1;
+          goto all_done;
+       }
+@@ -1746,6 +1784,8 @@ do_positional:
+           }
+       }
++    /* Set up the remaining two arrays to each point past the end of the
++       prior array, since space for all three has been allocated now.  */
+     args_size = &args_value[nargs].pa_int;
+     args_type = &args_size[nargs];
+     memset (args_type, s->_flags2 & _IO_FLAGS2_FORTIFY ? '\xff' : '\0',
diff --git a/src/patches/glibc/glibc-rh832516.patch b/src/patches/glibc/glibc-rh832516.patch
new file mode 100644 (file)
index 0000000..476af4b
--- /dev/null
@@ -0,0 +1,19 @@
+diff -Nrup a/locale/loadlocale.c b/locale/loadlocale.c
+--- a/locale/loadlocale.c      2010-05-04 07:27:23.000000000 -0400
++++ b/locale/loadlocale.c      2012-08-05 17:19:47.761384155 -0400
+@@ -170,7 +170,6 @@ _nl_load_locale (struct loaded_l10nfile 
+   int save_err;
+   int alloc = ld_mapped;
+-  file->decided = 1;
+   file->data = NULL;
+   fd = open_not_cancel_2 (file->filename, O_RDONLY);
+@@ -279,6 +278,7 @@ _nl_load_locale (struct loaded_l10nfile 
+   newdata->alloc = alloc;
+   file->data = newdata;
++  file->decided = 1;
+ }
+ void
diff --git a/src/patches/glibc/glibc-rh832694.patch b/src/patches/glibc/glibc-rh832694.patch
new file mode 100644 (file)
index 0000000..249afb5
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
+index e3d2faf..5437ff8 100644
+--- a/sysdeps/gnu/errlist.c
++++ b/sysdeps/gnu/errlist.c
+@@ -780,11 +780,12 @@ TRANS The user's disk quota was exceeded. */
+ #endif
+ #ifdef ESTALE
+ /*
+-TRANS Stale NFS file handle.  This indicates an internal confusion in the NFS
+-TRANS system which is due to file system rearrangements on the server host.
+-TRANS Repairing this condition usually requires unmounting and remounting
+-TRANS the NFS file system on the local host. */
+-    [ERR_REMAP (ESTALE)] = N_("Stale NFS file handle"),
++TRANS Stale file handle.  This indicates an internal confusion in the 
++TRANS file system which is due to file system rearrangements on the server host
++TRANS for NFS filesystems or corruption in other filesystems.
++TRANS Repairing this condition usually requires unmounting, possibly
++TRANS repairing and remounting the file system. */
++    [ERR_REMAP (ESTALE)] = N_("Stale file handle"),
+ # if ESTALE > ERR_MAX
+ # undef ERR_MAX
+ # define ERR_MAX ESTALE
diff --git a/src/patches/glibc/glibc-rh837026.patch b/src/patches/glibc/glibc-rh837026.patch
deleted file mode 100644 (file)
index 558ad4f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -rup a/resolv/res_send.c b/resolv/res_send.c
---- a/resolv/res_send.c        2012-06-28 11:55:38.361886650 -0600
-+++ b/resolv/res_send.c        2012-06-28 11:51:38.253963687 -0600
-@@ -424,17 +424,15 @@ __libc_res_nsend(res_state statp, const
-               }
-               n = statp->nscount;
-               ext_total_nscount = EXT(statp).nscount + EXT(statp).nscount6;
--              if (statp->nscount > ext_total_nscount)
--                      for (n = ext_total_nscount, ns = 0;
--                           n < statp->nscount; n++) {
--                              while (ns < MAXNS
--                                     && EXT(statp).nsmap[ns] != MAXNS)
--                                      ns++;
--                              if (ns == MAXNS)
--                                      break;
--                              EXT(statp).nsmap[ns] = n;
--                              map[n] = ns++;
--                      }
-+              for (n = 0, ns = 0; n < statp->nscount - ext_total_nscount; n++) {
-+                      while (ns < MAXNS
-+                             && EXT(statp).nsmap[ns] != MAXNS)
-+                              ns++;
-+                      if (ns == MAXNS)
-+                              break;
-+                      EXT(statp).nsmap[ns] = n;
-+                      map[n] = ns++;
-+              }
-               EXT(statp).nscount = n;
-               for (ns = 0; ns < EXT(statp).nscount; ns++) {
-                       n = map[ns];
diff --git a/src/patches/glibc/glibc-rh837695.patch b/src/patches/glibc/glibc-rh837695.patch
new file mode 100644 (file)
index 0000000..03e1e02
--- /dev/null
@@ -0,0 +1,54 @@
+diff -rup a/nss/nsswitch.h b/nss/nsswitch.h
+--- a/nss/nsswitch.h   2010-05-04 05:27:23.000000000 -0600
++++ b/nss/nsswitch.h   2012-07-05 11:28:15.316585117 -0600
+@@ -182,4 +182,8 @@ extern int __nss_hostname_digits_dots (c
+                                      int *h_errnop);
+ libc_hidden_proto (__nss_hostname_digits_dots)
++/* Maximum number of aliases we allow.  */
++#define MAX_NR_ALIASES  48
++#define MAX_NR_ADDRS    48
++
+ #endif        /* nsswitch.h */
+Only in b/nss: nsswitch.h.orig
+diff -rup a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
+--- a/resolv/nss_dns/dns-host.c        2012-07-05 11:27:39.298760961 -0600
++++ b/resolv/nss_dns/dns-host.c        2012-07-05 11:28:15.317585112 -0600
+@@ -89,10 +89,6 @@
+ #define RESOLVSORT
+-/* Maximum number of aliases we allow.  */
+-#define MAX_NR_ALIASES        48
+-#define MAX_NR_ADDRS  48
+-
+ #if PACKETSZ > 65536
+ # define MAXPACKET    PACKETSZ
+ #else
+Only in b/resolv/nss_dns: dns-host.c.orig
+diff -rup a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+--- a/sysdeps/posix/getaddrinfo.c      2012-07-05 11:27:39.284761028 -0600
++++ b/sysdeps/posix/getaddrinfo.c      2012-07-05 14:15:39.785546125 -0600
+@@ -565,7 +565,10 @@ gaih_inet (const char *name, const struc
+            IPv6 scope ids. */
+         if (req->ai_family == AF_INET)
+           {
+-            size_t tmpbuflen = 512;
++              /* Add room for struct host_data in resolv/nss_dns/dns-host.c */
++              size_t tmpbuflen = 512 + (MAX_NR_ALIASES+MAX_NR_ADDRS+1)*sizeof(char*)
++                                  + 16 * sizeof(char);
++
+             assert (tmpbuf == NULL);
+             tmpbuf = alloca_account (tmpbuflen, alloca_used);
+             int rc;
+@@ -807,7 +810,7 @@ gaih_inet (const char *name, const struc
+         old_res_options = _res.options;
+         _res.options &= ~RES_USE_INET6;
+-        size_t tmpbuflen = 1024;
++        size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple);
+         malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
+         assert (tmpbuf == NULL);
+         if (!malloc_tmpbuf)
+Only in b/sysdeps/posix: getaddrinfo.c.orig
+Only in b/sysdeps/posix: getaddrinfo.c.rej
diff --git a/src/patches/glibc/glibc-rh837918.patch b/src/patches/glibc/glibc-rh837918.patch
new file mode 100644 (file)
index 0000000..924d83d
--- /dev/null
@@ -0,0 +1,7183 @@
+diff -Nrup a/math/libm-test.inc b/math/libm-test.inc
+--- a/math/libm-test.inc       2010-05-04 05:27:23.000000000 -0600
++++ b/math/libm-test.inc       2012-08-06 09:54:00.821929695 -0600
+@@ -2018,6 +2018,142 @@ cos_test (void)
+ static void
++cos_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cos) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cos_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
++      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
++      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
++      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
++      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
++      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
++      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
++      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
++      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
++      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cos_tonearest);
++}
++
++
++static void
++cos_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cos) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cos_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
++      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
++      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
++      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
++      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
++      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
++      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
++      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
++      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
++      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cos_towardzero);
++}
++
++
++static void
++cos_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cos) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cos_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
++      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
++      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
++      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
++      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
++      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
++      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
++      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
++      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
++      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cos_downward);
++}
++
++
++static void
++cos_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cos) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cos_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
++      TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
++      TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
++      TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
++      TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
++      TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
++      TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
++      TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
++      TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
++      TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cos_upward);
++}
++
++
++static void
+ cosh_test (void)
+ {
+   errno = 0;
+@@ -2043,6 +2179,114 @@ cosh_test (void)
+ static void
++cosh_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cosh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cosh_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
++      TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
++      TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cosh_tonearest);
++}
++
++
++static void
++cosh_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cosh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cosh_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
++      TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
++      TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cosh_towardzero);
++}
++
++
++static void
++cosh_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cosh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cosh_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
++      TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
++      TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cosh_downward);
++}
++
++
++static void
++cosh_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(cosh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (cosh_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
++      TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
++      TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (cosh_upward);
++}
++
++
++static void
+ cpow_test (void)
+ {
+   errno = 0;
+@@ -2527,6 +2771,114 @@ exp_test (void)
+ static void
++exp_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (exp_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (exp, 1, M_El);
++      TEST_f_f (exp, 2, M_E2l);
++      TEST_f_f (exp, 3, M_E3l);
++    }
++
++  fesetround (save_round_mode);
++
++  END (exp_tonearest);
++}
++
++
++static void
++exp_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (exp_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (exp, 1, M_El);
++      TEST_f_f (exp, 2, M_E2l);
++      TEST_f_f (exp, 3, M_E3l);
++    }
++
++  fesetround (save_round_mode);
++
++  END (exp_towardzero);
++}
++
++
++static void
++exp_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (exp_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (exp, 1, M_El);
++      TEST_f_f (exp, 2, M_E2l);
++      TEST_f_f (exp, 3, M_E3l);
++    }
++
++  fesetround (save_round_mode);
++
++  END (exp_downward);
++}
++
++
++static void
++exp_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(exp) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (exp_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (exp, 1, M_El);
++      TEST_f_f (exp, 2, M_E2l);
++      TEST_f_f (exp, 3, M_E3l);
++    }
++
++  fesetround (save_round_mode);
++
++  END (exp_upward);
++}
++
++
++static void
+ exp10_test (void)
+ {
+   errno = 0;
+@@ -4848,22 +5200,127 @@ pow_test (void)
+   END (pow);
+ }
++
+ static void
+-remainder_test (void)
++pow_test_tonearest (void)
+ {
++  int save_round_mode;
+   errno = 0;
+-  FUNC(remainder) (1.625, 1.0);
++  FUNC(pow) (0, 0);
+   if (errno == ENOSYS)
+     /* Function not implemented.  */
+     return;
+-  START (remainder);
++  START (pow_tonearest);
+-  TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION);
+-  TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION);
+-  TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION);
+-  TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION);
+-  TEST_ff_f (remainder, nan_value, nan_value, nan_value);
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
++      TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (pow_tonearest);
++}
++
++
++static void
++pow_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(pow) (0, 0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (pow_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
++      TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (pow_towardzero);
++}
++
++
++static void
++pow_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(pow) (0, 0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (pow_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
++      TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (pow_downward);
++}
++
++
++static void
++pow_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(pow) (0, 0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (pow_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_ff_f (pow, 1.0625L, 1.125L, 1.070582293028761362162622578677070098674L);
++      TEST_ff_f (pow, 1.5L, 1.03125L, 1.519127098714743184071644334163037684948L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (pow_upward);
++}
++
++
++static void
++remainder_test (void)
++{
++  errno = 0;
++  FUNC(remainder) (1.625, 1.0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (remainder);
++
++  TEST_ff_f (remainder, 1, 0, nan_value, INVALID_EXCEPTION);
++  TEST_ff_f (remainder, 1, minus_zero, nan_value, INVALID_EXCEPTION);
++  TEST_ff_f (remainder, plus_infty, 1, nan_value, INVALID_EXCEPTION);
++  TEST_ff_f (remainder, minus_infty, 1, nan_value, INVALID_EXCEPTION);
++  TEST_ff_f (remainder, nan_value, nan_value, nan_value);
+   TEST_ff_f (remainder, 1.625, 1.0, -0.375);
+   TEST_ff_f (remainder, -1.625, 1.0, 0.375);
+@@ -5545,6 +6002,7 @@ sin_test (void)
+ #ifdef TEST_DOUBLE
+   TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
++  TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
+ #endif
+   END (sin);
+@@ -5553,6 +6011,142 @@ sin_test (void)
+ static void
++sin_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sin) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sin_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
++      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
++      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
++      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
++      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
++      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
++      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
++      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
++      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
++      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sin_tonearest);
++}
++
++
++static void
++sin_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sin) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sin_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
++      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
++      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
++      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
++      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
++      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
++      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
++      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
++      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
++      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sin_towardzero);
++}
++
++
++static void
++sin_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sin) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sin_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
++      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
++      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
++      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
++      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
++      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
++      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
++      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
++      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
++      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sin_downward);
++}
++
++
++static void
++sin_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sin) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sin_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (sin, 1, 0.8414709848078965066525023216302989996226L);
++      TEST_f_f (sin, 2, 0.9092974268256816953960198659117448427023L);
++      TEST_f_f (sin, 3, 0.1411200080598672221007448028081102798469L);
++      TEST_f_f (sin, 4, -0.7568024953079282513726390945118290941359L);
++      TEST_f_f (sin, 5, -0.9589242746631384688931544061559939733525L);
++      TEST_f_f (sin, 6, -0.2794154981989258728115554466118947596280L);
++      TEST_f_f (sin, 7, 0.6569865987187890903969990915936351779369L);
++      TEST_f_f (sin, 8, 0.9893582466233817778081235982452886721164L);
++      TEST_f_f (sin, 9, 0.4121184852417565697562725663524351793439L);
++      TEST_f_f (sin, 10, -0.5440211108893698134047476618513772816836L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sin_upward);
++}
++
++
++static void
+ sincos_test (void)
+ {
+   FLOAT sin_res, cos_res;
+@@ -5610,6 +6204,115 @@ sinh_test (void)
+   END (sinh);
+ }
++
++static void
++sinh_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sinh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sinh_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
++      TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
++      TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sinh_tonearest);
++}
++
++
++static void
++sinh_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sinh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sinh_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
++      TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
++      TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sinh_towardzero);
++}
++
++
++static void
++sinh_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sinh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sinh_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
++      TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
++      TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sinh_downward);
++}
++
++
++static void
++sinh_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(sinh) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (sinh_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (sinh, 22, 1792456423.065795780701106568345764104225L);
++      TEST_f_f (sinh, 23, 4872401723.124451299966006944252978187305L);
++      TEST_f_f (sinh, 24, 13244561064.92173614705070540368454568168L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (sinh_upward);
++}
++
++
+ static void
+ sqrt_test (void)
+ {
+@@ -5673,6 +6376,143 @@ tan_test (void)
+   END (tan);
+ }
++
++static void
++tan_test_tonearest (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(tan) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (tan_tonearest);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TONEAREST))
++    {
++      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
++      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
++      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
++      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
++      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
++      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
++      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
++      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
++      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
++      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (tan_tonearest);
++}
++
++
++static void
++tan_test_towardzero (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(tan) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (tan_towardzero);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_TOWARDZERO))
++    {
++      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
++      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
++      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
++      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
++      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
++      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
++      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
++      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
++      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
++      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (tan_towardzero);
++}
++
++
++static void
++tan_test_downward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(tan) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (tan_downward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_DOWNWARD))
++    {
++      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
++      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
++      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
++      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
++      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
++      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
++      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
++      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
++      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
++      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (tan_downward);
++}
++
++
++static void
++tan_test_upward (void)
++{
++  int save_round_mode;
++  errno = 0;
++  FUNC(tan) (0);
++  if (errno == ENOSYS)
++    /* Function not implemented.  */
++    return;
++
++  START (tan_upward);
++
++  save_round_mode = fegetround ();
++
++  if (!fesetround (FE_UPWARD))
++    {
++      TEST_f_f (tan, 1, 1.5574077246549022305069748074583601730873L);
++      TEST_f_f (tan, 2, -2.1850398632615189916433061023136825434320L);
++      TEST_f_f (tan, 3, -0.1425465430742778052956354105339134932261L);
++      TEST_f_f (tan, 4, 1.1578212823495775831373424182673239231198L);
++      TEST_f_f (tan, 5, -3.3805150062465856369827058794473439087096L);
++      TEST_f_f (tan, 6, -0.2910061913847491570536995888681755428312L);
++      TEST_f_f (tan, 7, 0.8714479827243187364564508896003135663222L);
++      TEST_f_f (tan, 8, -6.7997114552203786999252627596086333648814L);
++      TEST_f_f (tan, 9, -0.4523156594418098405903708757987855343087L);
++      TEST_f_f (tan, 10, 0.6483608274590866712591249330098086768169L);
++    }
++
++  fesetround (save_round_mode);
++
++  END (tan_upward);
++}
++
++
+ static void
+ tanh_test (void)
+ {
+@@ -6171,20 +7011,44 @@ main (int argc, char **argv)
+   atan_test ();
+   atan2_test ();
+   cos_test ();
++  cos_test_tonearest ();
++  cos_test_towardzero ();
++  cos_test_downward ();
++  cos_test_upward ();
+   sin_test ();
++  sin_test_tonearest ();
++  sin_test_towardzero ();
++  sin_test_downward ();
++  sin_test_upward ();
+   sincos_test ();
+   tan_test ();
++  tan_test_tonearest ();
++  tan_test_towardzero ();
++  tan_test_downward ();
++  tan_test_upward ();
+   /* Hyperbolic functions:  */
+   acosh_test ();
+   asinh_test ();
+   atanh_test ();
+   cosh_test ();
++  cosh_test_tonearest ();
++  cosh_test_towardzero ();
++  cosh_test_downward ();
++  cosh_test_upward ();
+   sinh_test ();
++  sinh_test_tonearest ();
++  sinh_test_towardzero ();
++  sinh_test_downward ();
++  sinh_test_upward ();
+   tanh_test ();
+   /* Exponential and logarithmic functions:  */
+   exp_test ();
++  exp_test_tonearest ();
++  exp_test_towardzero ();
++  exp_test_downward ();
++  exp_test_upward ();
+   exp10_test ();
+   exp2_test ();
+   expm1_test ();
+@@ -6207,6 +7071,10 @@ main (int argc, char **argv)
+   fabs_test ();
+   hypot_test ();
+   pow_test ();
++  pow_test_tonearest ();
++  pow_test_towardzero ();
++  pow_test_downward ();
++  pow_test_upward ();
+   sqrt_test ();
+   /* Error and gamma functions:  */
+diff -Nrup a/math/math_private.h b/math/math_private.h
+--- a/math/math_private.h      2010-05-04 05:27:23.000000000 -0600
++++ b/math/math_private.h      2012-08-06 09:54:00.821929695 -0600
+@@ -357,4 +357,41 @@ extern void __docos (double __x, double
+ #define math_force_eval(x) __asm __volatile ("" : : "m" (x))
+ #endif
++
++/* The standards only specify one variant of the fenv.h interfaces.
++   But at least for some architectures we can be more efficient if we
++   know what operations are going to be performed.  Therefore we
++   define additional interfaces.  By default they refer to the normal
++   interfaces.  */
++#define libc_fegetround() fegetround ()
++#define libc_fegetroundf() fegetround ()
++#define libc_fegetroundl() fegetround ()
++
++#define libc_fesetround(r) (void) fesetround (r)
++#define libc_fesetroundf(r) (void) fesetround (r)
++#define libc_fesetroundl(r) (void) fesetround (r)
++
++#define libc_feholdexcept(e) (void) feholdexcept (e)
++#define libc_feholdexceptf(e) (void) feholdexcept (e)
++#define libc_feholdexceptl(e) (void) feholdexcept (e)
++
++#define libc_feholdexcept_setround(e, r) \
++  do { feholdexcept (e); fesetround (r); } while (0)
++#define libc_feholdexcept_setroundf(e, r) \
++  do { feholdexcept (e); fesetround (r); } while (0)
++#define libc_feholdexcept_setroundl(e, r) \
++  do { feholdexcept (e); fesetround (r); } while (0)
++
++#define libc_fetestexcept(e) fetestexcept (e)
++#define libc_fetestexceptf(e) fetestexcept (e)
++#define libc_fetestexceptl(e) fetestexcept (e)
++
++#define libc_fesetenv(e) (void) fesetenv (e)
++#define libc_fesetenvf(e) (void) fesetenv (e)
++#define libc_fesetenvl(e) (void) fesetenv (e)
++
++#define libc_feupdateenv(e) (void) feupdateenv (e)
++#define libc_feupdateenvf(e) (void) feupdateenv (e)
++#define libc_feupdateenvl(e) (void) feupdateenv (e)
++
+ #endif /* _MATH_PRIVATE_H_ */
+diff -Nrup a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
+--- a/sysdeps/i386/fpu/libm-test-ulps  2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/i386/fpu/libm-test-ulps  2012-08-06 11:29:16.370874961 -0600
+@@ -9,18 +9,12 @@ ldouble: 1
+ Test "asin (-0.5) == -pi/6":
+ ildouble: 1
+ ldouble: 1
+-Test "asin (-1.0) == -pi/2":
+-ildouble: 1
+-ldouble: 1
+ Test "asin (0.5) == pi/6":
+ ildouble: 1
+ ldouble: 1
+ Test "asin (0.75) == 0.848062078981481008052944338998418080":
+ ildouble: 1
+ ldouble: 1
+-Test "asin (1.0) == pi/2":
+-ildouble: 1
+-ldouble: 1
+ # atanh
+ Test "atanh (0.75) == 0.972955074527656652552676371721589865":
+@@ -35,20 +29,6 @@ ildouble: 2
+ ldouble: 2
+ # cacosh
+-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 9
+-idouble: 1
+-ifloat: 9
+-ildouble: 6
+-ldouble: 6
+-Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 4
+-idouble: 1
+-ifloat: 4
+-ildouble: 1
+-ldouble: 1
+ Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i":
+ ildouble: 1
+ ldouble: 1
+@@ -124,8 +104,6 @@ ldouble: 1
+ Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ float: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+ double: 1
+ idouble: 1
+@@ -149,9 +127,7 @@ float: 1
+ idouble: 1
+ ifloat: 1
+ Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ # cexp
+@@ -186,8 +162,6 @@ ifloat: 1
+ Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ double: 1
+ idouble: 1
+-ildouble: 1
+-ldouble: 1
+ Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+ double: 1
+ float: 1
+@@ -262,27 +236,175 @@ ifloat: 1
+ # cos
+ Test "cos (M_PI_6l * 2.0) == 0.5":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ Test "cos (M_PI_6l * 4.0) == -0.5":
+ double: 2
+ float: 1
+ idouble: 2
+ ifloat: 1
++
++# cos_downward
++Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
++double: 1
++idouble: 1
++Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
++ildouble: 1
++ldouble: 1
++Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# cos_tonearest
++Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
++ildouble: 1
++ldouble: 1
++Test "cos_tonearest (9) == -0.9111302618846769883682947111811653112463":
++ildouble: 1
++ldouble: 1
++
++# cos_towardzero
++Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
+ ildouble: 1
+ ldouble: 1
+-Test "cos (pi/2) == 0":
++Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
++double: 1
++idouble: 1
++Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+-# cosh
+-Test "cosh (0.75) == 1.29468328467684468784170818539018176":
++# cos_upward
++Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
++float: 1
++ifloat: 1
++Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (2) == -0.4161468365471423869975682295007621897660":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
++double: 1
++idouble: 1
++Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+ ildouble: 1
++ldouble: 1
++Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
++double: 1
++idouble: 1
++Test "cos_upward (8) == -0.1455000338086135258688413818311946826093":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
++# cosh_downward
++Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
++double: 1
++float: 1
++ldouble: 2
++Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
++double: 1
++float: 1
++ldouble: 1
++Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ldouble: 1
++
++# cosh_tonearest
++Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
++ldouble: 1
++
++# cosh_towardzero
++Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
++double: 1
++float: 1
++ldouble: 2
++Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
++double: 1
++float: 1
++ldouble: 1
++Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ldouble: 1
++
++# cosh_upward
++Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
++ldouble: 1
++Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
++double: 1
+ # cpow
+ Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+@@ -353,12 +475,8 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+ Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -370,40 +488,36 @@ ifloat: 1
+ Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ double: 1
+ idouble: 1
+-ildouble: 439
+-ldouble: 439
++ildouble: 1
++ldouble: 1
+ Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+ float: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
++ildouble: 1
++ldouble: 1
+ Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 3
+ ldouble: 3
+ # ctanh
+ Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+-ildouble: 5
+-ldouble: 5
++ildouble: 3
++ldouble: 3
+ Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+ float: 1
+ ifloat: 1
+-ildouble: 25
+-ldouble: 25
++ildouble: 1
++ldouble: 1
+ Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
+ float: 1
+ ifloat: 1
+ Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
+ double: 1
+@@ -419,9 +533,6 @@ double: 1
+ idouble: 1
+ # erfc
+-Test "erfc (0.75) == 0.288844366346484868401062165408589223":
+-float: 1
+-ifloat: 1
+ Test "erfc (1.25) == 0.0770998717435417698634765188027188596":
+ ildouble: 1
+ ldouble: 1
+@@ -434,14 +545,6 @@ idouble: 1
+ ildouble: 1
+ ldouble: 1
+-# exp
+-Test "exp (0.75) == 2.11700001661267466854536981983709561":
+-ildouble: 1
+-Test "exp (1000.0) == 0.197007111401704699388887935224332313e435":
+-ildouble: 754
+-Test "exp (50.0) == 5184705528587072464087.45332293348538":
+-ildouble: 16
+-
+ # exp10
+ Test "exp10 (-1) == 0.1":
+ ildouble: 1
+@@ -453,6 +556,51 @@ Test "exp10 (3) == 1000":
+ ildouble: 8
+ ldouble: 8
++# exp_downward
++Test "exp_downward (1) == e":
++ildouble: 1
++ldouble: 1
++Test "exp_downward (2) == e^2":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "exp_downward (3) == e^3":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_towardzero
++Test "exp_towardzero (1) == e":
++ildouble: 1
++ldouble: 1
++Test "exp_towardzero (2) == e^2":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "exp_towardzero (3) == e^3":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_upward
++Test "exp_upward (1) == e":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
+ # expm1
+ Test "expm1 (1) == M_El - 1.0":
+ ildouble: 1
+@@ -485,26 +633,24 @@ float: 1
+ # j0
+ Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "j0 (10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 1
+ float: 1
+-idouble: 3
++idouble: 1
+ ifloat: 1
+ Test "j0 (2.0) == 0.223890779141235668051827454649948626":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "j0 (8.0) == 0.171650807137553906090869407851972001":
+@@ -512,13 +658,8 @@ float: 1
+ ifloat: 1
+ # j1
+-Test "j1 (0.75) == 0.349243602174862192523281016426251335":
+-double: 1
+-idouble: 1
+ Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -526,9 +667,7 @@ Test "j1 (2.0) == 0.57672480775687338720
+ double: 1
+ idouble: 1
+ Test "j1 (8.0) == 0.234636346853914624381276651590454612":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -536,38 +675,31 @@ ldouble: 1
+ # jn
+ Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 1
+ float: 1
+-idouble: 3
++idouble: 1
+ ifloat: 1
+ Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
+ float: 1
+ ifloat: 1
+-Test "jn (1, 0.75) == 0.349243602174862192523281016426251335":
+-double: 1
+-idouble: 1
+ Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -575,9 +707,7 @@ Test "jn (1, 2.0) == 0.57672480775687338
+ double: 1
+ idouble: 1
+ Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -589,9 +719,7 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
+ float: 1
+@@ -606,38 +734,32 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
+-double: 5
+-float: 2
+-idouble: 5
+-ifloat: 2
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+-double: 2
+-idouble: 2
+ ildouble: 1
+ ldouble: 1
+ Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
+ ildouble: 1
+ ldouble: 1
+ Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083":
+ ildouble: 1
+ ldouble: 1
+ Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
+-double: 5
+-float: 2
+-idouble: 5
+-ifloat: 2
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
+-double: 1
+-idouble: 1
+ ildouble: 1
+ ldouble: 1
+@@ -648,9 +770,7 @@ idouble: 1
+ ildouble: 1
+ ldouble: 1
+ Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
+ double: 1
+@@ -660,11 +780,6 @@ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+-# log
+-Test "log (e) == 1":
+-float: 1
+-ifloat: 1
+-
+ # log10
+ Test "log10 (0.75) == -0.124938736608299953132449886193870744":
+ ildouble: 1
+@@ -675,20 +790,179 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-# sincos
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
++# pow_downward
++Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
+ double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# pow_towardzero
++Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
++double: 1
+ idouble: 1
++ildouble: 1
++ldouble: 1
++Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
++float: 1
+ ifloat: 1
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
++ildouble: 1
++ldouble: 1
++
++# pow_upward
++Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++
++# sin_downward
++Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
++double: 1
++idouble: 1
++Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
++Test "sin_downward (7) == 0.6569865987187890903969990915936351779369":
+ ildouble: 1
+ ldouble: 1
+-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
++Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (9) == 0.4121184852417565697562725663524351793439":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# sin_tonearest
++Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
++ildouble: 1
++ldouble: 1
++
++# sin_towardzero
++Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
++float: 1
++ifloat: 1
++Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
++double: 1
++idouble: 1
++Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# sin_upward
++Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
++float: 1
++ifloat: 1
++Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_upward (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (7) == 0.6569865987187890903969990915936351779369":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "sin_upward (8) == 0.9893582466233817778081235982452886721164":
++float: 1
++ifloat: 1
++
++# sincos
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
++double: 1
++idouble: 1
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+ double: 1
+ float: 1
+ idouble: 1
+@@ -698,66 +972,237 @@ ldouble: 1
+ # sinh
+ Test "sinh (0.75) == 0.822316731935829980703661634446913849":
+-double: 1
+ ildouble: 1
+-# tan
+-Test "tan (pi/4) == 1":
++# sinh_downward
++Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
+ double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ldouble: 4
++Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
++double: 1
++float: 1
+ idouble: 1
++ifloat: 1
++Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ldouble: 5
+-# tgamma
+-Test "tgamma (-0.5) == -2 sqrt (pi)":
+-double: 2
++# sinh_tonearest
++Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
++ldouble: 3
++Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
++ldouble: 1
++Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
++ldouble: 6
++
++# sinh_towardzero
++Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ldouble: 4
++Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ldouble: 5
++
++# sinh_upward
++Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
++ldouble: 16
++Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
++ldouble: 27
++Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
++double: 1
++idouble: 1
++ldouble: 7
++
++# tan_downward
++Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "tan_downward (3) == -0.1425465430742778052956354105339134932261":
++double: 1
++idouble: 1
++Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
+ float: 1
+-idouble: 2
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "tgamma (0.5) == sqrt (pi)":
++Test "tan_downward (5) == -3.3805150062465856369827058794473439087096":
++ildouble: 1
++ldouble: 1
++Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
++double: 1
+ float: 1
++idouble: 1
+ ifloat: 1
+-Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
++Test "tan_downward (7) == 0.8714479827243187364564508896003135663222":
++double: 1
++idouble: 1
++Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++
++# tan_tonearest
++Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (8) == -6.7997114552203786999252627596086333648814":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (9) == -0.4523156594418098405903708757987855343087":
++ildouble: 1
++ldouble: 1
++
++# tan_towardzero
++Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "tgamma (4) == 6":
++Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222":
++double: 1
++idouble: 1
++Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814":
++double: 1
++idouble: 1
++ildouble: 2
++ldouble: 2
++Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
++double: 1
++idouble: 1
+ ildouble: 1
+ ldouble: 1
+-# y0
+-Test "y0 (0.125) == -1.38968062514384052915582277745018693":
++# tan_upward
++Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (0.75) == -0.137172769385772397522814379396581855":
++Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (4) == 1.1578212823495775831373424182673239231198":
++double: 1
++idouble: 1
++Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
++Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (8) == -6.7997114552203786999252627596086333648814":
++double: 1
++idouble: 1
++ildouble: 2
++ldouble: 2
++Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++
++# tgamma
++Test "tgamma (-0.5) == -2 sqrt (pi)":
+ double: 2
+ float: 1
+ idouble: 2
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (1.5) == 0.382448923797758843955068554978089862":
++Test "tgamma (0.5) == sqrt (pi)":
++float: 1
++ifloat: 1
++Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
++
++# y0
++Test "y0 (0.125) == -1.38968062514384052915582277745018693":
++ildouble: 1
++ldouble: 1
++Test "y0 (0.75) == -0.137172769385772397522814379396581855":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
++Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
++ildouble: 1
++ldouble: 1
++Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "y0 (8.0) == 0.223521489387566220527323400498620359":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -766,9 +1211,6 @@ ldouble: 1
+ Test "y1 (0.125) == -5.19993611253477499595928744876579921":
+ ildouble: 1
+ ldouble: 1
+-Test "y1 (1.0) == -0.781212821300288716547150000047964821":
+-double: 1
+-idouble: 1
+ Test "y1 (10.0) == 0.249015424206953883923283474663222803":
+ double: 2
+ float: 2
+@@ -782,9 +1224,7 @@ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+ Test "y1 (8.0) == -0.158060461731247494255555266187483550":
+-double: 1
+ float: 2
+-idouble: 1
+ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+@@ -799,37 +1239,21 @@ float: 1
+ idouble: 1
+ ifloat: 1
+ Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
+-double: 2
+-float: 1
+-idouble: 2
+-ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
+-double: 1
+-float: 1
+-idouble: 1
+-ifloat: 1
+ Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
+ ildouble: 1
+ ldouble: 1
+-Test "yn (1, 1.0) == -0.781212821300288716547150000047964821":
+-double: 1
+-idouble: 1
+ Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
+ double: 2
+ float: 2
+@@ -843,17 +1267,13 @@ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+ Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
+-double: 1
+ float: 2
+-idouble: 1
+ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+ Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
+@@ -862,28 +1282,22 @@ ifloat: 1
+ ildouble: 4
+ ldouble: 4
+ Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
+-double: 1
+ float: 2
+-idouble: 1
+ ifloat: 2
+ Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
+ double: 1
+-float: 3
++float: 1
+ idouble: 1
+-ifloat: 3
++ifloat: 1
+ Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
+-double: 2
+ float: 3
+-idouble: 2
+ ifloat: 3
+ Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
+ ildouble: 1
+ ldouble: 1
+ Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
+@@ -892,15 +1306,13 @@ float: 1
+ idouble: 1
+ ifloat: 1
+ Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ # Maximal error of functions:
+ Function: "acos":
+-ildouble: 622
+-ldouble: 622
++ildouble: 1
++ldouble: 1
+ Function: "asin":
+ ildouble: 1
+@@ -917,18 +1329,6 @@ ildouble: 2
+ ldouble: 2
+ Function: Real part of "cacosh":
+-double: 1
+-float: 9
+-idouble: 1
+-ifloat: 9
+-ildouble: 6
+-ldouble: 6
+-
+-Function: Imaginary part of "cacosh":
+-double: 1
+-float: 4
+-idouble: 1
+-ifloat: 4
+ ildouble: 1
+ ldouble: 1
+@@ -1033,8 +1433,6 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ Function: "cos":
+ double: 2
+@@ -1044,16 +1442,58 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Function: "cosh":
++Function: "cos_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_tonearest":
+ ildouble: 1
++ldouble: 1
++
++Function: "cos_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_upward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_downward":
++double: 1
++float: 1
++ldouble: 2
++
++Function: "cosh_tonearest":
++ldouble: 1
++
++Function: "cosh_towardzero":
++double: 1
++float: 1
++ldouble: 2
++
++Function: "cosh_upward":
++double: 1
++ldouble: 1
+ Function: Real part of "cpow":
+ double: 1
+ float: 4
+ idouble: 1
+ ifloat: 4
+-ildouble: 763
+-ldouble: 763
++ildouble: 6
++ldouble: 6
+ Function: Imaginary part of "cpow":
+ double: 2
+@@ -1086,38 +1526,32 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+ Function: Real part of "ctan":
+ double: 1
+ idouble: 1
+-ildouble: 439
+-ldouble: 439
++ildouble: 1
++ldouble: 1
+ Function: Imaginary part of "ctan":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 3
+ ldouble: 3
+ Function: Real part of "ctanh":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+-ildouble: 5
+-ldouble: 5
++ildouble: 3
++ldouble: 3
+ Function: Imaginary part of "ctanh":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 25
+-ldouble: 25
++ildouble: 1
++ldouble: 1
+ Function: "erf":
+ double: 1
+@@ -1125,19 +1559,36 @@ idouble: 1
+ Function: "erfc":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Function: "exp":
+-ildouble: 754
+-
+ Function: "exp10":
+ ildouble: 8
+ ldouble: 8
++Function: "exp_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "exp_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "exp_upward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++
+ Function: "expm1":
+ ildouble: 1
+@@ -1151,10 +1602,10 @@ Function: "hypot":
+ float: 1
+ Function: "j0":
+-double: 3
+-float: 2
+-idouble: 3
+-ifloat: 2
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1167,10 +1618,10 @@ ildouble: 1
+ ldouble: 1
+ Function: "jn":
+-double: 5
+-float: 2
+-idouble: 5
+-ifloat: 2
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -1192,6 +1643,58 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "pow_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_upward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "sin_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_upward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ Function: "sincos":
+ double: 1
+ float: 1
+@@ -1201,13 +1704,62 @@ ildouble: 1
+ ldouble: 1
+ Function: "sinh":
+-double: 1
+ ildouble: 1
++Function: "sinh_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ldouble: 5
++
++Function: "sinh_tonearest":
++ldouble: 6
++
++Function: "sinh_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ldouble: 5
++
++Function: "sinh_upward":
++double: 1
++idouble: 1
++ldouble: 27
++
+ Function: "tan":
+ double: 1
+ idouble: 1
++Function: "tan_downward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "tan_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "tan_towardzero":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "tan_upward":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
+ Function: "tgamma":
+ double: 2
+ float: 1
+@@ -1217,9 +1769,9 @@ ildouble: 1
+ ldouble: 1
+ Function: "y0":
+-double: 2
++double: 1
+ float: 1
+-idouble: 2
++idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+diff -Nrup a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c
+--- a/sysdeps/ieee754/dbl-64/e_exp.c   2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/e_exp.c   2012-08-06 09:54:00.823929687 -0600
+@@ -1,7 +1,7 @@
+ /*
+  * IBM Accurate Mathematical Library
+  * written by International Business Machines Corp.
+- * Copyright (C) 2001 Free Software Foundation
++ * Copyright (C) 2001-2012 Free Software Foundation
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU Lesser General Public License as published by
+@@ -39,6 +39,7 @@
+ #include "MathLib.h"
+ #include "uexp.tbl"
+ #include "math_private.h"
++#include <fenv.h>
+ double __slowexp(double);
+@@ -53,6 +54,10 @@ double __ieee754_exp(double x) {
+   int4 k;
+ #endif
+   int4 i,j,m,n,ex;
++  fenv_t env;
++  double retval;
++
++  libc_feholdexcept_setround (&env, FE_TONEAREST);
+   junk1.x = x;
+   m = junk1.i[HIGH_HALF];
+@@ -85,18 +90,19 @@ double __ieee754_exp(double x) {
+     rem=(bet + bet*eps)+al*eps;
+     res = al + rem;
+     cor = (al - res) + rem;
+-    if  (res == (res+cor*err_0)) return res*binexp.x;
+-    else return __slowexp(x); /*if error is over bound */
++    if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
++    else { retval = __slowexp(x); goto ret; } /*if error is over bound */
+   }
+-  if (n <= smallint) return 1.0;
++  if (n <= smallint) { retval = 1.0; goto ret; }
+   if (n >= badint) {
+-    if (n > infint) return(x+x);               /* x is NaN */
+-    if (n < infint) return ( (x>0) ? (hhuge*hhuge) : (tiny*tiny) );
++    if (n > infint) { retval = x+x; goto ret; }               /* x is NaN */
++    if (n < infint) { retval = (x>0) ? (hhuge*hhuge) : (tiny*tiny); goto ret; }
+     /* x is finite,  cause either overflow or underflow  */
+-    if (junk1.i[LOW_HALF] != 0)  return (x+x);                /*  x is NaN  */
+-    return ((x>0)?inf.x:zero );             /* |x| = inf;  return either inf or 0 */
++    if (junk1.i[LOW_HALF] != 0) { retval = x+x; goto ret; } /*  x is NaN  */
++    retval = (x>0)?inf.x:zero;             /* |x| = inf;  return either inf or 0 */
++    goto ret;
+   }
+   y = x*log2e.x + three51.x;
+@@ -121,8 +127,8 @@ double __ieee754_exp(double x) {
+     if (res < 1.0) {res+=res; cor+=cor; ex-=1;}
+     if (ex >=-1022) {
+       binexp.i[HIGH_HALF] = (1023+ex)<<20;
+-      if  (res == (res+cor*err_0)) return res*binexp.x;
+-      else return __slowexp(x); /*if error is over bound */
++      if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
++      else { retval = __slowexp(x); goto ret; } /*if error is over bound */
+     }
+     ex = -(1022+ex);
+     binexp.i[HIGH_HALF] = (1023-ex)<<20;
+@@ -135,15 +141,19 @@ double __ieee754_exp(double x) {
+     cor = (t-res)+y;
+     if (res == (res + eps*cor))
+     { binexp.i[HIGH_HALF] = 0x00100000;
+-      return (res-1.0)*binexp.x;
++      retval = (res-1.0)*binexp.x;
++      goto ret;
+     }
+-    else return __slowexp(x); /*   if error is over bound    */
++    else { retval = __slowexp(x); goto ret; } /*   if error is over bound    */
+   }
+   else {
+     binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+767)<<20;
+-    if  (res == (res+cor*err_0)) return res*binexp.x*t256.x;
+-    else return __slowexp(x);
++    if (res == (res+cor*err_0)) { retval = res*binexp.x*t256.x; goto ret; }
++    else { retval = __slowexp(x); goto ret; }
+   }
++ ret:
++  libc_feupdateenv (&env);
++  return retval;
+ }
+ /************************************************************************/
+diff -Nrup a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
+--- a/sysdeps/ieee754/dbl-64/e_exp2.c  2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/e_exp2.c  2012-08-06 09:54:00.824929683 -0600
+@@ -24,9 +24,6 @@
+    17 (1), March 1991, pp. 26-45.
+    It has been slightly modified to compute 2^x instead of e^x.
+    */
+-#ifndef _GNU_SOURCE
+-#define _GNU_SOURCE
+-#endif
+ #include <stdlib.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -37,13 +34,8 @@
+ #include "t_exp2.h"
+-/* XXX I know the assembler generates a warning about incorrect section
+-   attributes. But without the attribute here the compiler places the
+-   constants in the .data section.  Ideally the constant is placed in
+-   .rodata.cst8 so that it can be merged, but gcc sucks, it ICEs when
+-   we try to force this section on it.  --drepper  */
+-static const volatile double TWO1023 = 8.988465674311579539e+307;
+-static const volatile double TWOM1000 = 9.3326361850321887899e-302;
++static const double TWO1023 = 8.988465674311579539e+307;
++static const double TWOM1000 = 9.3326361850321887899e-302;
+ double
+ __ieee754_exp2 (double x)
+@@ -60,11 +52,7 @@ __ieee754_exp2 (double x)
+       union ieee754_double ex2_u, scale_u;
+       fenv_t oldenv;
+-      feholdexcept (&oldenv);
+-#ifdef FE_TONEAREST
+-      /* If we don't have this, it's too bad.  */
+-      fesetround (FE_TONEAREST);
+-#endif
++      libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
+       /* 1. Argument reduction.
+        Choose integers ex, -256 <= t < 256, and some real
+@@ -108,9 +96,10 @@ __ieee754_exp2 (double x)
+              * x + .055504110254308625)
+             * x + .240226506959100583)
+            * x + .69314718055994495) * ex2_u.d;
++      math_opt_barrier (x22);
+       /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex).  */
+-      fesetenv (&oldenv);
++      libc_fesetenv (&oldenv);
+       result = x22 * x + ex2_u.d;
+diff -Nrup a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+--- a/sysdeps/ieee754/dbl-64/e_pow.c   2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/e_pow.c   2012-08-06 09:54:00.824929683 -0600
+@@ -42,6 +42,7 @@
+ #include "MathLib.h"
+ #include "upow.tbl"
+ #include "math_private.h"
++#include <fenv.h>
+ double __exp1(double x, double xx, double error);
+@@ -79,6 +80,11 @@ double __ieee754_pow(double x, double y)
+        (u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0))  &&
+                                       /*   2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
+       (v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) {              /* if y<-1 or y>1   */
++    fenv_t env;
++    double retval;
++
++    libc_feholdexcept_setround (&env, FE_TONEAREST);
++
+     z = log1(x,&aa,&error);                                 /* x^y  =e^(y log (X)) */
+     t = y*134217729.0;
+     y1 = t - (t-y);
+@@ -92,7 +98,10 @@ double __ieee754_pow(double x, double y)
+     a2 = (a-a1)+aa;
+     error = error*ABS(y);
+     t = __exp1(a1,a2,1.9e16*error);     /* return -10 or 0 if wasn't computed exactly */
+-    return (t>0)?t:power1(x,y);
++    retval = (t>0)?t:power1(x,y);
++
++    libc_feupdateenv (&env);
++    return retval;
+   }
+   if (x == 0) {
+diff -Nrup a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
+--- a/sysdeps/ieee754/dbl-64/s_sin.c   2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/s_sin.c   2012-08-06 09:54:00.827929671 -0600
+@@ -55,6 +55,7 @@
+ #include "MathLib.h"
+ #include "sincos.tbl"
+ #include "math_private.h"
++#include <fenv.h>
+ static const double
+           sn3 = -1.66666666666664880952546298448555E-01,
+@@ -97,12 +98,16 @@ double __sin(double x){
+ #if 0
+       int4 nn;
+ #endif
++      fenv_t env;
++      double retval = 0;
++
++      libc_feholdexcept_setround (&env, FE_TONEAREST);
+       u.x = x;
+       m = u.i[HIGH_HALF];
+       k = 0x7fffffff&m;              /* no sign           */
+       if (k < 0x3e500000)            /* if x->0 =>sin(x)=x */
+-       return x;
++        { retval = x; goto ret; }
+  /*---------------------------- 2^-26 < |x|< 0.25 ----------------------*/
+       else  if (k < 0x3fd00000){
+         xx = x*x;
+@@ -110,7 +115,8 @@ double __sin(double x){
+         t = ((((s5.x*xx + s4.x)*xx + s3.x)*xx + s2.x)*xx + s1.x)*(xx*x);
+         res = x+t;
+         cor = (x-res)+t;
+-        return (res == res + 1.07*cor)? res : slow(x);
++        retval = (res == res + 1.07*cor)? res : slow(x);
++        goto ret;
+       }    /*  else  if (k < 0x3fd00000)    */
+ /*---------------------------- 0.25<|x|< 0.855469---------------------- */
+       else if (k < 0x3feb6000)  {
+@@ -127,7 +133,8 @@ double __sin(double x){
+         cor=(ssn+s*ccs-sn*c)+cs*s;
+         res=sn+cor;
+         cor=(sn-res)+cor;
+-        return (res==res+1.025*cor)? res : slow1(x);
++        retval = (res==res+1.096*cor)? res : slow1(x);
++        goto ret;
+       }    /*   else  if (k < 0x3feb6000)    */
+ /*----------------------- 0.855469  <|x|<2.426265  ----------------------*/
+@@ -153,7 +160,8 @@ double __sin(double x){
+         cor=(ccs-s*ssn-cs*c)-sn*s;
+         res=cs+cor;
+         cor=(cs-res)+cor;
+-        return (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
++        retval = (res==res+1.020*cor)? ((m>0)?res:-res) : slow2(x);
++        goto ret;
+       } /*   else  if (k < 0x400368fd)    */
+ /*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
+@@ -179,7 +187,8 @@ double __sin(double x){
+             res = a+t;
+             cor = (a-res)+t;
+             cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
+-            return (res == res + cor)? res : sloww(a,da,x);
++            retval = (res == res + cor)? res : sloww(a,da,x);
++            goto ret;
+           }
+           else  {
+             if (a>0)
+@@ -200,7 +209,8 @@ double __sin(double x){
+             res=sn+cor;
+             cor=(sn-res)+cor;
+             cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
+-            return (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
++            retval = (res==res+cor)? ((m)?res:-res) : sloww1(a,da,x);
++            goto ret;
+           }
+           break;
+@@ -222,7 +232,8 @@ double __sin(double x){
+           res=cs+cor;
+           cor=(cs-res)+cor;
+           cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
+-          return (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
++          retval = (res==res+cor)? ((n&2)?-res:res) : sloww2(a,da,x,n);
++          goto ret;
+           break;
+@@ -258,7 +269,8 @@ double __sin(double x){
+             res = a+t;
+             cor = (a-res)+t;
+             cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
+-            return (res == res + cor)? res : bsloww(a,da,x,n);
++            retval = (res == res + cor)? res : bsloww(a,da,x,n);
++            goto ret;
+           }
+           else  {
+             if (a>0) {m=1;t=a;db=da;}
+@@ -277,7 +289,8 @@ double __sin(double x){
+             res=sn+cor;
+             cor=(sn-res)+cor;
+             cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
+-            return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
++            retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
++            goto ret;
+                  }
+           break;
+@@ -299,7 +312,8 @@ double __sin(double x){
+           res=cs+cor;
+           cor=(cs-res)+cor;
+           cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
+-          return (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
++          retval = (res==res+cor)? ((n&2)?-res:res) : bsloww2(a,da,x,n);
++          goto ret;
+           break;
+@@ -313,17 +327,20 @@ double __sin(double x){
+         n = __branred(x,&a,&da);
+         switch (n) {
+         case 0:
+-          if (a*a < 0.01588) return bsloww(a,da,x,n);
+-          else return bsloww1(a,da,x,n);
++          if (a*a < 0.01588) retval = bsloww(a,da,x,n);
++          else retval = bsloww1(a,da,x,n);
++          goto ret;
+           break;
+         case 2:
+-          if (a*a < 0.01588) return bsloww(-a,-da,x,n);
+-          else return bsloww1(-a,-da,x,n);
++          if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
++          else retval = bsloww1(-a,-da,x,n);
++          goto ret;
+           break;
+         case 1:
+         case 3:
+-          return  bsloww2(a,da,x,n);
++          retval = bsloww2(a,da,x,n);
++          goto ret;
+           break;
+         }
+@@ -333,9 +350,13 @@ double __sin(double x){
+       else {
+         if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
+           __set_errno (EDOM);
+-        return x / x;
++        retval = x / x;
++        goto ret;
+       }
+-      return 0;         /* unreachable */
++
++ ret:
++      libc_feupdateenv (&env);
++      return retval;
+ }
+@@ -350,11 +371,16 @@ double __cos(double x)
+   mynumber u,v;
+   int4 k,m,n;
++  fenv_t env;
++  double retval = 0;
++
++  libc_feholdexcept_setround (&env, FE_TONEAREST);
++
+   u.x = x;
+   m = u.i[HIGH_HALF];
+   k = 0x7fffffff&m;
+-  if (k < 0x3e400000 ) return 1.0; /* |x|<2^-27 => cos(x)=1 */
++  if (k < 0x3e400000 ) { retval = 1.0; goto ret; } /* |x|<2^-27 => cos(x)=1 */
+   else if (k < 0x3feb6000 ) {/* 2^-27 < |x| < 0.855469 */
+     y=ABS(x);
+@@ -371,7 +397,8 @@ double __cos(double x)
+     cor=(ccs-s*ssn-cs*c)-sn*s;
+     res=cs+cor;
+     cor=(cs-res)+cor;
+-    return (res==res+1.020*cor)? res : cslow2(x);
++    retval = (res==res+1.020*cor)? res : cslow2(x);
++    goto ret;
+ }    /*   else  if (k < 0x3feb6000)    */
+@@ -385,7 +412,8 @@ double __cos(double x)
+       res = a+t;
+       cor = (a-res)+t;
+       cor = (cor>0)? 1.02*cor+1.0e-31 : 1.02*cor -1.0e-31;
+-      return (res == res + cor)? res : csloww(a,da,x);
++      retval = (res == res + cor)? res : csloww(a,da,x);
++      goto ret;
+     }
+     else  {
+       if (a>0) {m=1;t=a;db=da;}
+@@ -404,7 +432,8 @@ double __cos(double x)
+       res=sn+cor;
+       cor=(sn-res)+cor;
+       cor = (cor>0)? 1.035*cor+1.0e-31 : 1.035*cor-1.0e-31;
+-      return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
++      retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
++      goto ret;
+ }
+ }    /*   else  if (k < 0x400368fd)    */
+@@ -431,7 +460,8 @@ double __cos(double x)
+       res = a+t;
+       cor = (a-res)+t;
+       cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
+-      return (res == res + cor)? res : csloww(a,da,x);
++      retval = (res == res + cor)? res : csloww(a,da,x);
++      goto ret;
+       }
+       else  {
+       if (a>0) {m=1;t=a;db=da;}
+@@ -450,7 +480,8 @@ double __cos(double x)
+       res=sn+cor;
+       cor=(sn-res)+cor;
+       cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
+-      return (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
++      retval = (res==res+cor)? ((m)?res:-res) : csloww1(a,da,x);
++      goto ret;
+       }
+       break;
+@@ -471,7 +502,8 @@ double __cos(double x)
+       res=cs+cor;
+       cor=(cs-res)+cor;
+       cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
+-      return (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
++      retval = (res==res+cor)? ((n)?-res:res) : csloww2(a,da,x,n);
++      goto ret;
+            break;
+@@ -506,7 +538,8 @@ double __cos(double x)
+       res = a+t;
+       cor = (a-res)+t;
+       cor = (cor>0)? 1.02*cor+eps : 1.02*cor -eps;
+-      return (res == res + cor)? res : bsloww(a,da,x,n);
++      retval = (res == res + cor)? res : bsloww(a,da,x,n);
++      goto ret;
+       }
+       else  {
+       if (a>0) {m=1;t=a;db=da;}
+@@ -525,7 +558,8 @@ double __cos(double x)
+       res=sn+cor;
+       cor=(sn-res)+cor;
+       cor = (cor>0)? 1.035*cor+eps : 1.035*cor-eps;
+-      return (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
++      retval = (res==res+cor)? ((m)?res:-res) : bsloww1(a,da,x,n);
++      goto ret;
+       }
+       break;
+@@ -546,7 +580,8 @@ double __cos(double x)
+       res=cs+cor;
+       cor=(cs-res)+cor;
+       cor = (cor>0)? 1.025*cor+eps : 1.025*cor-eps;
+-      return (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
++      retval = (res==res+cor)? ((n)?-res:res) : bsloww2(a,da,x,n);
++      goto ret;
+       break;
+     }
+@@ -558,17 +593,20 @@ double __cos(double x)
+     n = __branred(x,&a,&da);
+     switch (n) {
+     case 1:
+-      if (a*a < 0.01588) return bsloww(-a,-da,x,n);
+-      else return bsloww1(-a,-da,x,n);
++      if (a*a < 0.01588) retval = bsloww(-a,-da,x,n);
++      else retval = bsloww1(-a,-da,x,n);
++      goto ret;
+       break;
+               case 3:
+-                if (a*a < 0.01588) return bsloww(a,da,x,n);
+-                else return bsloww1(a,da,x,n);
++                if (a*a < 0.01588) retval = bsloww(a,da,x,n);
++                else retval = bsloww1(a,da,x,n);
++                goto ret;
+                 break;
+     case 0:
+     case 2:
+-      return  bsloww2(a,da,x,n);
++      retval = bsloww2(a,da,x,n);
++      goto ret;
+       break;
+     }
+@@ -580,10 +618,13 @@ double __cos(double x)
+   else {
+     if (k == 0x7ff00000 && u.i[LOW_HALF] == 0)
+       __set_errno (EDOM);
+-    return x / x; /* |x| > 2^1024 */
++    retval = x / x; /* |x| > 2^1024 */
++    goto ret;
+   }
+-  return 0;
++ ret:
++  libc_feupdateenv (&env);
++  return retval;
+ }
+ /************************************************************************/
+diff -Nrup a/sysdeps/ieee754/dbl-64/s_tan.c b/sysdeps/ieee754/dbl-64/s_tan.c
+--- a/sysdeps/ieee754/dbl-64/s_tan.c   2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/s_tan.c   2012-08-06 09:54:00.828929666 -0600
+@@ -40,6 +40,8 @@
+ #include "mpa.h"
+ #include "MathLib.h"
+ #include "math.h"
++#include "math_private.h"
++#include <fenv.h>
+ static double tanMp(double);
+ void __mptan(double, mp_no *, int);
+@@ -58,21 +60,27 @@ double tan(double x) {
+   mp_no mpy;
+ #endif
++  fenv_t env;
++  double retval;
++
+   int __branred(double, double *, double *);
+   int __mpranred(double, mp_no *, int);
++  libc_feholdexcept_setround (&env, FE_TONEAREST);
++
+   /* x=+-INF, x=NaN */
+   num.d = x;  ux = num.i[HIGH_HALF];
+   if ((ux&0x7ff00000)==0x7ff00000) {
+     if ((ux&0x7fffffff)==0x7ff00000)
+       __set_errno (EDOM);
+-    return x-x;
++    retval = x-x;
++    goto ret;
+   }
+   w=(x<ZERO) ? -x : x;
+   /* (I) The case abs(x) <= 1.259e-8 */
+-  if (w<=g1.d)  return x;
++  if (w<=g1.d) { retval = x; goto ret; }
+   /* (II) The case 1.259e-8 < abs(x) <= 0.0608 */
+   if (w<=g2.d) {
+@@ -80,7 +88,7 @@ double tan(double x) {
+     /* First stage */
+     x2 = x*x;
+     t2 = x*x2*(d3.d+x2*(d5.d+x2*(d7.d+x2*(d9.d+x2*d11.d))));
+-    if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2))  return y;
++    if ((y=x+(t2-u1.d*t2)) == x+(t2+u1.d*t2)) { retval = y; goto ret; }
+     /* Second stage */
+     c1 = x2*(a15.d+x2*(a17.d+x2*(a19.d+x2*(a21.d+x2*(a23.d+x2*(a25.d+
+@@ -100,8 +108,9 @@ double tan(double x) {
+     MUL2(x2,xx2,c2,cc2,c1,cc1,t1,t2,t3,t4,t5,t6,t7,t8)
+     MUL2(x ,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8)
+     ADD2(x    ,zero.d,c2,cc2,c1,cc1,t1,t2)
+-    if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1))  return y;
+-    return tanMp(x);
++    if ((y=c1+(cc1-u2.d*c1)) == c1+(cc1+u2.d*c1)) { retval = y; goto ret; }
++    retval = tanMp(x);
++    goto ret;
+   }
+   /* (III) The case 0.0608 < abs(x) <= 0.787 */
+@@ -112,10 +121,10 @@ double tan(double x) {
+     z = w-xfg[i][0].d;  z2 = z*z;   s = (x<ZERO) ? MONE : ONE;
+     pz = z+z*z2*(e0.d+z2*e1.d);
+     fi = xfg[i][1].d;   gi = xfg[i][2].d;   t2 = pz*(gi+fi)/(gi-pz);
+-    if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d))  return (s*y);
++    if ((y=fi+(t2-fi*u3.d))==fi+(t2+fi*u3.d)) { retval = (s*y); goto ret; }
+     t3 = (t2<ZERO) ? -t2 : t2;
+     t4 = fi*ua3.d+t3*ub3.d;
+-    if ((y=fi+(t2-t4))==fi+(t2+t4))  return (s*y);
++    if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (s*y); goto ret; }
+     /* Second stage */
+     ffi = xfg[i][3].d;
+@@ -133,8 +142,9 @@ double tan(double x) {
+     SUB2(one.d,zero.d,c3,cc3,c1,cc1,t1,t2)
+     DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-    if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3))  return (s*y);
+-    return tanMp(x);
++      if ((y=c3+(cc3-u4.d*c3))==c3+(cc3+u4.d*c3)) { retval = (s*y); goto ret; }
++    retval = tanMp(x);
++    goto ret;
+   }
+   /* (---) The case 0.787 < abs(x) <= 25 */
+@@ -152,7 +162,7 @@ double tan(double x) {
+     else         {ya= a;  yya= da;  sy= ONE;}
+     /* (IV),(V) The case 0.787 < abs(x) <= 25,    abs(y) <= 1e-7 */
+-    if (ya<=gy1.d)  return tanMp(x);
++    if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
+     /* (VI) The case 0.787 < abs(x) <= 25,    1e-7 < abs(y) <= 0.0608 */
+     if (ya<=gy2.d) {
+@@ -162,10 +172,10 @@ double tan(double x) {
+         /* First stage -cot */
+         EADD(a,t2,b,db)
+         DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-        if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c))  return (-y); }
++      if ((y=c+(dc-u6.d*c))==c+(dc+u6.d*c)) { retval = (-y); goto ret; } }
+       else {
+         /* First stage tan */
+-        if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a))  return y; }
++      if ((y=a+(t2-u5.d*a))==a+(t2+u5.d*a)) { retval = y; goto ret; } }
+       /* Second stage */
+       /* Range reduction by algorithm ii */
+       t = (x*hpinv.d + toint.d);
+@@ -203,11 +213,12 @@ double tan(double x) {
+       if (n) {
+         /* Second stage -cot */
+         DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-        if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2))  return (-y); }
++      if ((y=c2+(cc2-u8.d*c2)) == c2+(cc2+u8.d*c2)) { retval = (-y); goto ret; } }
+       else {
+         /* Second stage tan */
+-        if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1))  return y; }
+-      return tanMp(x);
++      if ((y=c1+(cc1-u7.d*c1)) == c1+(cc1+u7.d*c1)) { retval = y; goto ret; } }
++      retval = tanMp(x);
++      goto ret;
+     }
+     /* (VII) The case 0.787 < abs(x) <= 25,    0.0608 < abs(y) <= 0.787 */
+@@ -221,17 +232,17 @@ double tan(double x) {
+     if (n) {
+       /* -cot */
+       t2 = pz*(fi+gi)/(fi+pz);
+-      if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d))  return (-sy*y);
++      if ((y=gi-(t2-gi*u10.d))==gi-(t2+gi*u10.d)) { retval = (-sy*y); goto ret; }
+       t3 = (t2<ZERO) ? -t2 : t2;
+       t4 = gi*ua10.d+t3*ub10.d;
+-      if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
++      if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
+     else   {
+       /* tan */
+       t2 = pz*(gi+fi)/(gi-pz);
+-      if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d))  return (sy*y);
++      if ((y=fi+(t2-fi*u9.d))==fi+(t2+fi*u9.d)) { retval = (sy*y); goto ret; }
+       t3 = (t2<ZERO) ? -t2 : t2;
+       t4 = fi*ua9.d+t3*ub9.d;
+-      if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
++      if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
+     /* Second stage */
+     ffi = xfg[i][3].d;
+@@ -252,13 +263,14 @@ double tan(double x) {
+     if (n) {
+       /* -cot */
+       DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3))  return (-sy*y); }
++      if ((y=c3+(cc3-u12.d*c3))==c3+(cc3+u12.d*c3)) { retval = (-sy*y); goto ret; } }
+     else {
+       /* tan */
+       DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3))  return (sy*y); }
++      if ((y=c3+(cc3-u11.d*c3))==c3+(cc3+u11.d*c3)) { retval = (sy*y); goto ret; } }
+-    return tanMp(x);
++    retval = tanMp(x);
++    goto ret;
+   }
+   /* (---) The case 25 < abs(x) <= 1e8 */
+@@ -280,7 +292,7 @@ double tan(double x) {
+     else         {ya= a;  yya= da;  sy= ONE;}
+     /* (+++) The case 25 < abs(x) <= 1e8,    abs(y) <= 1e-7 */
+-    if (ya<=gy1.d)  return tanMp(x);
++    if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
+     /* (VIII) The case 25 < abs(x) <= 1e8,    1e-7 < abs(y) <= 0.0608 */
+     if (ya<=gy2.d) {
+@@ -290,10 +302,10 @@ double tan(double x) {
+         /* First stage -cot */
+         EADD(a,t2,b,db)
+         DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-        if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c))  return (-y); }
++      if ((y=c+(dc-u14.d*c))==c+(dc+u14.d*c)) { retval = (-y); goto ret; } }
+       else {
+         /* First stage tan */
+-        if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a))  return y; }
++      if ((y=a+(t2-u13.d*a))==a+(t2+u13.d*a)) { retval = y; goto ret; } }
+       /* Second stage */
+       MUL2(a,da,a,da,x2,xx2,t1,t2,t3,t4,t5,t6,t7,t8)
+@@ -317,11 +329,12 @@ double tan(double x) {
+       if (n) {
+         /* Second stage -cot */
+         DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-        if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2))  return (-y); }
++      if ((y=c2+(cc2-u16.d*c2)) == c2+(cc2+u16.d*c2)) { retval = (-y); goto ret; } }
+       else {
+         /* Second stage tan */
+-        if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1))  return (y); }
+-      return tanMp(x);
++      if ((y=c1+(cc1-u15.d*c1)) == c1+(cc1+u15.d*c1)) { retval = (y); goto ret; } }
++      retval = tanMp(x);
++      goto ret;
+     }
+     /* (IX) The case 25 < abs(x) <= 1e8,    0.0608 < abs(y) <= 0.787 */
+@@ -334,17 +347,17 @@ double tan(double x) {
+     if (n) {
+       /* -cot */
+       t2 = pz*(fi+gi)/(fi+pz);
+-      if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d))  return (-sy*y);
++      if ((y=gi-(t2-gi*u18.d))==gi-(t2+gi*u18.d)) { retval = (-sy*y); goto ret; }
+       t3 = (t2<ZERO) ? -t2 : t2;
+       t4 = gi*ua18.d+t3*ub18.d;
+-      if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
++      if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
+     else   {
+       /* tan */
+       t2 = pz*(gi+fi)/(gi-pz);
+-      if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d))  return (sy*y);
++      if ((y=fi+(t2-fi*u17.d))==fi+(t2+fi*u17.d)) { retval = (sy*y); goto ret; }
+       t3 = (t2<ZERO) ? -t2 : t2;
+       t4 = fi*ua17.d+t3*ub17.d;
+-      if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
++      if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
+     /* Second stage */
+     ffi = xfg[i][3].d;
+@@ -365,12 +378,13 @@ double tan(double x) {
+     if (n) {
+       /* -cot */
+       DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3))  return (-sy*y); }
++      if ((y=c3+(cc3-u20.d*c3))==c3+(cc3+u20.d*c3)) { retval = (-sy*y); goto ret; } }
+     else {
+       /* tan */
+       DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3))  return (sy*y); }
+-    return tanMp(x);
++      if ((y=c3+(cc3-u19.d*c3))==c3+(cc3+u19.d*c3)) { retval = (sy*y); goto ret; } }
++    retval = tanMp(x);
++    goto ret;
+   }
+   /* (---) The case 1e8 < abs(x) < 2**1024 */
+@@ -381,7 +395,7 @@ double tan(double x) {
+   else         {ya= a;  yya= da;  sy= ONE;}
+   /* (+++) The case 1e8 < abs(x) < 2**1024,    abs(y) <= 1e-7 */
+-  if (ya<=gy1.d)  return tanMp(x);
++  if (ya<=gy1.d) { retval = tanMp(x); goto ret; }
+   /* (X) The case 1e8 < abs(x) < 2**1024,    1e-7 < abs(y) <= 0.0608 */
+   if (ya<=gy2.d) {
+@@ -391,10 +405,10 @@ double tan(double x) {
+       /* First stage -cot */
+       EADD(a,t2,b,db)
+       DIV2(one.d,zero.d,b,db,c,dc,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c))  return (-y); }
++      if ((y=c+(dc-u22.d*c))==c+(dc+u22.d*c)) { retval = (-y); goto ret; } }
+     else {
+       /* First stage tan */
+-      if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a))  return y; }
++      if ((y=a+(t2-u21.d*a))==a+(t2+u21.d*a)) { retval = y; goto ret; } }
+     /* Second stage */
+     /* Reduction by algorithm iv */
+@@ -423,11 +437,12 @@ double tan(double x) {
+     if (n) {
+       /* Second stage -cot */
+       DIV2(one.d,zero.d,c1,cc1,c2,cc2,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-      if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2))  return (-y); }
++      if ((y=c2+(cc2-u24.d*c2)) == c2+(cc2+u24.d*c2)) { retval = (-y); goto ret; } }
+     else {
+       /* Second stage tan */
+-      if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1))  return y; }
+-    return tanMp(x);
++      if ((y=c1+(cc1-u23.d*c1)) == c1+(cc1+u23.d*c1)) { retval = y; goto ret; } }
++    retval = tanMp(x);
++    goto ret;
+   }
+   /* (XI) The case 1e8 < abs(x) < 2**1024,    0.0608 < abs(y) <= 0.787 */
+@@ -440,17 +455,17 @@ double tan(double x) {
+   if (n) {
+     /* -cot */
+     t2 = pz*(fi+gi)/(fi+pz);
+-    if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d))  return (-sy*y);
++    if ((y=gi-(t2-gi*u26.d))==gi-(t2+gi*u26.d)) { retval = (-sy*y); goto ret; }
+     t3 = (t2<ZERO) ? -t2 : t2;
+     t4 = gi*ua26.d+t3*ub26.d;
+-    if ((y=gi-(t2-t4))==gi-(t2+t4))  return (-sy*y); }
++    if ((y=gi-(t2-t4))==gi-(t2+t4)) { retval = (-sy*y); goto ret; } }
+   else   {
+     /* tan */
+     t2 = pz*(gi+fi)/(gi-pz);
+-    if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d))  return (sy*y);
++    if ((y=fi+(t2-fi*u25.d))==fi+(t2+fi*u25.d)) { retval = (sy*y); goto ret; }
+     t3 = (t2<ZERO) ? -t2 : t2;
+     t4 = fi*ua25.d+t3*ub25.d;
+-    if ((y=fi+(t2-t4))==fi+(t2+t4))  return (sy*y); }
++    if ((y=fi+(t2-t4))==fi+(t2+t4)) { retval = (sy*y); goto ret; } }
+   /* Second stage */
+   ffi = xfg[i][3].d;
+@@ -471,15 +486,19 @@ double tan(double x) {
+   if (n) {
+     /* -cot */
+     DIV2(c1,cc1,c2,cc2,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-    if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3))  return (-sy*y); }
++    if ((y=c3+(cc3-u28.d*c3))==c3+(cc3+u28.d*c3)) { retval = (-sy*y); goto ret; } }
+   else {
+     /* tan */
+     DIV2(c2,cc2,c1,cc1,c3,cc3,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10)
+-    if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3))  return (sy*y); }
+-  return tanMp(x);
++    if ((y=c3+(cc3-u27.d*c3))==c3+(cc3+u27.d*c3)) { retval = (sy*y); goto ret; } }
++  retval = tanMp(x);
++  goto ret;
++
++ ret:
++  libc_feupdateenv (&env);
++  return retval;
+ }
+-
+ /* multiple precision stage                                              */
+ /* Convert x to multi precision number,compute tan(x) by mptan() routine */
+ /* and converts result back to double                                    */
+diff -Nrup a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c 2012-08-06 09:54:00.828929666 -0600
+@@ -24,22 +24,14 @@
+ #include "math.h"
+ #include "math_private.h"
+-#ifdef __STDC__
+ static const double
+-#else
+-static double
+-#endif
+ TWO52[2]={
+   4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
+  -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
+ };
+-#ifdef __STDC__
+-      double __nearbyint(double x)
+-#else
+-      double __nearbyint(x)
+-      double x;
+-#endif
++double
++__nearbyint(double x)
+ {
+       fenv_t env;
+       int64_t i0,sx;
+@@ -47,20 +39,19 @@ TWO52[2]={
+       EXTRACT_WORDS64(i0,x);
+       sx = (i0>>63)&1;
+       j0 = ((i0>>52)&0x7ff)-0x3ff;
+-      if(j0<52) {
++      if(__builtin_expect(j0<52, 1)) {
+           if(j0<0) {
+             if((i0&UINT64_C(0x7fffffffffffffff))==0) return x;
+               uint64_t i = i0 & UINT64_C(0xfffffffffffff);
+               i0 &= UINT64_C(0xfffe000000000000);
+               i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
+               INSERT_WORDS64(x,i0);
+-              feholdexcept (&env);
++              libc_feholdexcept (&env);
+               double w = TWO52[sx]+x;
+               double t =  w-TWO52[sx];
+-              fesetenv (&env);
+-              EXTRACT_WORDS64(i0,t);
+-              INSERT_WORDS64(t,(i0&UINT64_C(0x7fffffffffffffff))|(sx<<63));
+-              return t;
++              math_opt_barrier(t);
++              libc_fesetenv (&env);
++              return copysign(t, x);
+           } else {
+               uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
+               if((i0&i)==0) return x; /* x is integral */
+@@ -73,10 +64,11 @@ TWO52[2]={
+           else return x;              /* x is integral */
+       }
+       INSERT_WORDS64(x,i0);
+-      feholdexcept (&env);
++      libc_feholdexcept (&env);
+       double w = TWO52[sx]+x;
+       double t = w-TWO52[sx];
+-      fesetenv (&env);
++      math_opt_barrier (t);
++      libc_fesetenv (&env);
+       return t;
+ }
+ weak_alias (__nearbyint, nearbyint)
+diff -Nrup a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
+--- a/sysdeps/ieee754/flt-32/e_exp2f.c 2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/flt-32/e_exp2f.c 2012-08-06 09:54:00.829929661 -0600
+@@ -56,11 +56,7 @@ __ieee754_exp2f (float x)
+       union ieee754_float ex2_u, scale_u;
+       fenv_t oldenv;
+-      feholdexcept (&oldenv);
+-#ifdef FE_TONEAREST
+-      /* If we don't have this, it's too bad.  */
+-      fesetround (FE_TONEAREST);
+-#endif
++      libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
+       /* 1. Argument reduction.
+        Choose integers ex, -128 <= t < 128, and some real
+@@ -103,7 +99,7 @@ __ieee754_exp2f (float x)
+       x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
+       /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex).  */
+-      fesetenv (&oldenv);
++      libc_fesetenv (&oldenv);
+       result = x22 * x + ex2_u.f;
+diff -Nrup a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
+--- a/sysdeps/ieee754/flt-32/e_expf.c  2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/flt-32/e_expf.c  2012-08-06 09:54:00.829929661 -0600
+@@ -47,9 +47,6 @@
+    to perform an 'accurate table method' expf, because of the range reduction
+    overhead (compare exp2f).
+    */
+-#ifndef _GNU_SOURCE
+-#define _GNU_SOURCE
+-#endif
+ #include <float.h>
+ #include <ieee754.h>
+ #include <math.h>
+@@ -60,8 +57,8 @@
+ extern const float __exp_deltatable[178];
+ extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
+-static const volatile float TWOM100 = 7.88860905e-31;
+-static const volatile float TWO127 = 1.7014118346e+38;
++static const float TWOM100 = 7.88860905e-31;
++static const float TWO127 = 1.7014118346e+38;
+ float
+ __ieee754_expf (float x)
+@@ -86,10 +83,7 @@ __ieee754_expf (float x)
+       union ieee754_double ex2_u;
+       fenv_t oldenv;
+-      feholdexcept (&oldenv);
+-#ifdef FE_TONEAREST
+-      fesetround (FE_TONEAREST);
+-#endif
++      libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST);
+       /* Calculate n.  */
+       n = x * M_1_LN2 + THREEp22;
+@@ -119,7 +113,7 @@ __ieee754_expf (float x)
+       x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
+       /* Return result.  */
+-      fesetenv (&oldenv);
++      libc_fesetenvf (&oldenv);
+       result = x22 * ex2_u.d + ex2_u.d;
+       return (float) result;
+diff -Nrup a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
+--- a/sysdeps/ieee754/flt-32/s_nearbyintf.c    2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c    2012-08-06 09:54:00.891929402 -0600
+@@ -19,22 +19,14 @@
+ #include "math.h"
+ #include "math_private.h"
+-#ifdef __STDC__
+ static const float
+-#else
+-static float
+-#endif
+ TWO23[2]={
+   8.3886080000e+06, /* 0x4b000000 */
+  -8.3886080000e+06, /* 0xcb000000 */
+ };
+-#ifdef __STDC__
+-      float __nearbyintf(float x)
+-#else
+-      float __nearbyintf(x)
+-      float x;
+-#endif
++float
++__nearbyintf(float x)
+ {
+       fenv_t env;
+       int32_t i0,j0,sx;
+@@ -50,13 +42,13 @@ TWO23[2]={
+               i0 &= 0xfff00000;
+               i0 |= ((i1|-i1)>>9)&0x400000;
+               SET_FLOAT_WORD(x,i0);
+-              feholdexcept (&env);
+-              w = TWO23[sx]+x;
+-              t =  w-TWO23[sx];
+-              fesetenv (&env);
++              libc_feholdexceptf (&env);
++              w = TWO23[sx]+x;
++              t =  w-TWO23[sx];
++              libc_fesetenvf (&env);
+               GET_FLOAT_WORD(i0,t);
+               SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
+-              return t;
++              return t;
+           } else {
+               i = (0x007fffff)>>j0;
+               if((i0&i)==0) return x; /* x is integral */
+@@ -64,14 +56,14 @@ TWO23[2]={
+               if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
+           }
+       } else {
+-          if(j0==0x80) return x+x;    /* inf or NaN */
++          if(__builtin_expect(j0==0x80, 0)) return x+x;       /* inf or NaN */
+           else return x;              /* x is integral */
+       }
+       SET_FLOAT_WORD(x,i0);
+-      feholdexcept (&env);
++      libc_feholdexceptf (&env);
+       w = TWO23[sx]+x;
+       t = w-TWO23[sx];
+-      fesetenv (&env);
++      libc_fesetenvf (&env);
+       return t;
+ }
+ weak_alias (__nearbyintf, nearbyintf)
+diff -Nrup a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
+--- a/sysdeps/powerpc/fpu/libm-test-ulps       2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/powerpc/fpu/libm-test-ulps       2012-08-06 10:03:24.424569052 -0600
+@@ -37,16 +37,9 @@ ildouble: 1
+ ldouble: 1
+ # cacosh
+-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+ Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
++float: 1
++ifloat: 1
+ # casin
+ Test "Real part of: casin (-2 - 3 i) == -0.57065278432109940071028387968566963 - 1.9833870299165354323470769028940395 i":
+@@ -84,8 +77,6 @@ ifloat: 1
+ # catan
+ Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+-float: 3
+-ifloat: 3
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+@@ -93,23 +84,14 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+-float: 4
+-ifloat: 4
+ # catanh
+ Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+ double: 4
+ idouble: 4
+-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+-float: 4
+-ifloat: 4
+ Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+ double: 1
+ idouble: 1
+-Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+-float: 6
+-ifloat: 6
+ # cbrt
+ Test "cbrt (-27.0) == -3.0":
+@@ -167,8 +149,6 @@ ldouble: 1
+ # clog
+ Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
+-float: 3
+-ifloat: 3
+ ildouble: 1
+ ldouble: 1
+ Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+@@ -197,9 +177,7 @@ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ double: 1
+-float: 5
+ idouble: 1
+-ifloat: 5
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+@@ -298,23 +276,165 @@ ldouble: 1
+ # cos
+ Test "cos (M_PI_6l * 2.0) == 0.5":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ Test "cos (M_PI_6l * 4.0) == -0.5":
+ double: 2
+ float: 1
+ idouble: 2
+ ifloat: 1
+-Test "cos (pi/2) == 0":
+-double: 1
++
++# cos_downward
++Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
++float: 1
++ifloat: 1
++ildouble: 4
++ldouble: 4
++Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
++float: 1
++ifloat: 1
++Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_downward (6) == 0.9601702866503660205456522979229244054519":
++ildouble: 1
++ldouble: 1
++Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
++ildouble: 1
++ldouble: 1
++
++# cos_tonearest
++Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++
++# cos_towardzero
++Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
++ildouble: 2
++ldouble: 2
++Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "cos (16.0) == -0.9576594803233846418996372326511034717803"
+ ildouble: 2
+ ldouble: 2
++# cos_upward
++Test "cos_upward (1) == 0.5403023058681397174009366074429766037323":
++ildouble: 2
++ldouble: 2
++Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (4) == -0.6536436208636119146391681830977503814241":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
++float: 1
++ifloat: 1
++Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
++float: 2
++ifloat: 2
++
++# cosh_downward
++Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 5269156250720
++ldouble: 5269156250720
++Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 484603564240
++ldouble: 484603564240
++Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ifloat: 1
++ildouble: 89137844202
++ldouble: 89137844202
++
++# cosh_tonearest
++Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
++ildouble: 5269156250719
++ldouble: 5269156250719
++Test "cosh_tonearest (23) == 4872401723.124451300068625740569997090344":
++ildouble: 484603564240
++ldouble: 484603564240
++Test "cosh_tonearest (24) == 13244561064.92173614708845674912733665919":
++ildouble: 89137844202
++ldouble: 89137844202
++
++# cosh_towardzero
++Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 5269156250720
++ldouble: 5269156250720
++Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 484603564240
++ldouble: 484603564240
++Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ifloat: 1
++ildouble: 89137844202
++ldouble: 89137844202
++
++# cosh_upward
++Test "cosh_upward (22) == 1792456423.065795780980053377632656584997":
++ildouble: 5269156250719
++ldouble: 5269156250719
++Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
++ildouble: 484603564240
++ldouble: 484603564240
++Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
++ildouble: 89137844200
++ldouble: 89137844200
++
+ # cpow
+ Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+ float: 1
+@@ -386,12 +506,6 @@ float: 1
+ ifloat: 1
+ # ctan
+-Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+-double: 1
+-idouble: 1
+-Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+-ildouble: 1
+-ldouble: 1
+ Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+ double: 1
+ idouble: 1
+@@ -463,6 +577,33 @@ Test "exp2 (10) == 1024":
+ ildouble: 2
+ ldouble: 2
++# exp_downward
++Test "exp_downward (2) == e^2":
++float: 1
++ifloat: 1
++Test "exp_downward (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_towardzero
++Test "exp_towardzero (2) == e^2":
++float: 1
++ifloat: 1
++Test "exp_towardzero (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_upward
++Test "exp_upward (1) == e":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ # expm1
+ Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
+ double: 1
+@@ -505,40 +646,27 @@ ifloat: 1
+ # j0
+ Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
+-ildouble: 1
+-ldouble: 1
++ifloat: 1
+ Test "j0 (10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 2
+ float: 1
+-idouble: 3
++idouble: 2
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+-Test "j0 (2.0) == 0.223890779141235668051827454649948626":
+-float: 2
+-ifloat: 2
+ Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
+-ildouble: 1
+-ldouble: 1
++ifloat: 1
+ Test "j0 (8.0) == 0.171650807137553906090869407851972001":
+ float: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ # j1
+ Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
+ float: 2
+ ifloat: 2
+-ildouble: 1
+-ldouble: 1
+ Test "j1 (2.0) == 0.576724807756873387202448242269137087":
+ double: 1
+ idouble: 1
+@@ -551,38 +679,25 @@ ldouble: 1
+ # jn
+ Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
+-ildouble: 1
+-ldouble: 1
++ifloat: 1
+ Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 2
+ float: 1
+-idouble: 3
++idouble: 2
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+-Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
+-float: 2
+-ifloat: 2
+ Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
+-ildouble: 1
+-ldouble: 1
++ifloat: 1
+ Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
+ float: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
+ float: 2
+ ifloat: 2
+-ildouble: 1
+-ldouble: 1
+ Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
+ double: 1
+ idouble: 1
+@@ -615,11 +730,8 @@ ifloat: 1
+ ildouble: 4
+ ldouble: 4
+ Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+-float: 4
+-ifloat: 4
+-Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
+-ildouble: 1
+-ldouble: 1
++float: 3
++ifloat: 3
+ Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
+ double: 1
+ float: 1
+@@ -628,21 +740,18 @@ ifloat: 1
+ Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
+ double: 1
+ idouble: 1
+-Test "jn (3, 1.0) == 0.0195633539826684059189053216217515083":
+-ildouble: 1
+-ldouble: 1
+ Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
+ double: 3
+-float: 2
++float: 1
+ idouble: 3
+-ifloat: 2
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -675,115 +784,350 @@ Test "log1p (-0.25) == -0.28768207245178
+ float: 1
+ ifloat: 1
+-# log2
+-Test "log2 (e) == M_LOG2El":
++# pow_downward
++Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
+ ildouble: 1
+ ldouble: 1
+-
+-# sin
+-Test "sin (16.0) == -0.2879033166650652947844562482186175296207"
+-ildouble: 2
+-ldouble: 2
+-
+-# sincos
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
+-double: 1
+-float: 1
+-idouble: 1
+-ifloat: 1
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+-double: 1
++Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
+-double: 1
++
++# pow_towardzero
++Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
++ildouble: 1
++ldouble: 1
++Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++
++# pow_upward
++Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
+ float: 1
+ ifloat: 1
+-
+-# sinh
+-Test "sinh (0.75) == 0.822316731935829980703661634446913849":
++Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ ildouble: 1
+ ldouble: 1
+-# tan
+-Test "tan (pi/4) == 1":
+-double: 1
+-idouble: 1
++# sin_downward
++Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
++ildouble: 4
++ldouble: 4
++Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
++float: 1
++ifloat: 1
++Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
+ ildouble: 1
+ ldouble: 1
+-
+-# tanh
+-Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
++Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
+ ildouble: 1
+ ldouble: 1
+-Test "tanh (0.75) == 0.635148952387287319214434357312496495":
++Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
+ ildouble: 1
+ ldouble: 1
+-# tgamma
+-Test "tgamma (-0.5) == -2 sqrt (pi)":
+-double: 1
++# sin_tonearest
++Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "tgamma (0.5) == sqrt (pi)":
++
++# sin_towardzero
++Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
+ float: 1
+ ifloat: 1
+-Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
+-double: 1
++ildouble: 2
++ldouble: 2
++Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-
+-# y0
+-Test "y0 (0.125) == -1.38968062514384052915582277745018693":
++Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (0.75) == -0.137172769385772397522814379396581855":
++Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
+-double: 2
++Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
+ float: 1
+-idouble: 2
+ ifloat: 1
++Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (1.5) == 0.382448923797758843955068554978089862":
+-double: 2
++Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
+ float: 1
+-idouble: 2
+ ifloat: 1
+-Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
++ildouble: 1
++ldouble: 1
++
++# sin_upward
++Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
++float: 2
++ifloat: 2
++Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
++float: 1
++ifloat: 1
++
++# sincos
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
++double: 1
++idouble: 1
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
++Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++float: 1
++ifloat: 1
++
++# sinh
++Test "sinh (0.75) == 0.822316731935829980703661634446913849":
+ ildouble: 1
+ ldouble: 1
+-Test "y0 (2.0) == 0.510375672649745119596606592727157873":
++
++# sinh_downward
++Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 5269156250718
++ldouble: 5269156250718
++Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++ildouble: 484603564240
++ldouble: 484603564240
++Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ildouble: 89137844201
++ldouble: 89137844201
++
++# sinh_tonearest
++Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
++ildouble: 5269156250719
++ldouble: 5269156250719
++Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
++ildouble: 484603564241
++ldouble: 484603564241
++Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
++ildouble: 89137844201
++ldouble: 89137844201
++
++# sinh_towardzero
++Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 5269156250718
++ldouble: 5269156250718
++Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++ildouble: 484603564240
++ldouble: 484603564240
++Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ildouble: 89137844201
++ldouble: 89137844201
++
++# sinh_upward
++Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
++ildouble: 5269156250719
++ldouble: 5269156250719
++Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
++ildouble: 484603564241
++ldouble: 484603564241
++Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
++ildouble: 89137844202
++ldouble: 89137844202
++
++# tan
++Test "tan (pi/4) == 1":
++ildouble: 1
++ldouble: 1
++
++# tan_downward
++Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
++float: 1
++ifloat: 1
++Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# tan_tonearest
++Test "tan_tonearest (10) == 0.6483608274590866712591249330098086768169":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (4) == 1.1578212823495775831373424182673239231198":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (7) == 0.8714479827243187364564508896003135663222":
++ildouble: 1
++ldouble: 1
++
++# tan_towardzero
++Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 3
++ldouble: 3
++Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (7) == 0.8714479827243187364564508896003135663222":
++ildouble: 2
++ldouble: 2
++Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# tan_upward
++Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 3
++ldouble: 3
++Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
++ildouble: 1
++ldouble: 1
++
++# tanh
++Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
++ildouble: 1
++ldouble: 1
++Test "tanh (0.75) == 0.635148952387287319214434357312496495":
++ildouble: 1
++ldouble: 1
++
++# tgamma
++Test "tgamma (-0.5) == -2 sqrt (pi)":
+ double: 1
++float: 1
+ idouble: 1
+-Test "y0 (8.0) == 0.223521489387566220527323400498620359":
++ifloat: 1
++Test "tgamma (0.5) == sqrt (pi)":
++float: 1
++ifloat: 1
++Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
++
++# y0
++Test "y0 (0.125) == -1.38968062514384052915582277745018693":
+ ildouble: 1
+ ldouble: 1
+-
+-# y1
+-Test "y1 (0.125) == -5.19993611253477499595928744876579921":
++Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "y0 (1.5) == 0.382448923797758843955068554978089862":
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
++Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "y0 (2.0) == 0.510375672649745119596606592727157873":
+ double: 1
+ idouble: 1
+-Test "y1 (1.5) == -0.412308626973911295952829820633445323":
++Test "y0 (8.0) == 0.223521489387566220527323400498620359":
++double: 1
+ float: 1
++idouble: 1
+ ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# y1
+ Test "y1 (10.0) == 0.249015424206953883923283474663222803":
+ double: 3
+ float: 1
+@@ -794,30 +1138,27 @@ ldouble: 2
+ Test "y1 (2.0) == -0.107032431540937546888370772277476637":
+ double: 1
+ float: 1
+-idouble: 2
+-ifloat: 2
++idouble: 1
++ifloat: 1
+ Test "y1 (8.0) == -0.158060461731247494255555266187483550":
+ double: 1
+ float: 2
+ idouble: 1
+ ifloat: 2
+-ildouble: 2
+-ldouble: 2
++ildouble: 1
++ldouble: 1
+ # yn
+ Test "yn (0, 0.125) == -1.38968062514384052915582277745018693":
+ ildouble: 1
+ ldouble: 1
+-Test "yn (0, 0.75) == -0.137172769385772397522814379396581855":
+-ildouble: 1
+-ldouble: 1
+ Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
+ double: 2
+ float: 1
+ idouble: 2
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
++ildouble: 1
++ldouble: 1
+ Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
+ double: 2
+ float: 1
+@@ -828,8 +1169,6 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+ Test "yn (0, 2.0) == 0.510375672649745119596606592727157873":
+ double: 1
+ idouble: 1
+@@ -838,14 +1177,8 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+-Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
+-double: 1
+-idouble: 1
+-Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
+-float: 2
+-ifloat: 2
++ildouble: 1
++ldouble: 1
+ Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
+ double: 3
+ float: 1
+@@ -863,14 +1196,8 @@ double: 1
+ float: 2
+ idouble: 1
+ ifloat: 2
+-ildouble: 2
+-ldouble: 2
+-Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
+-double: 1
+-idouble: 1
+-Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
+-double: 1
+-idouble: 1
++ildouble: 1
++ldouble: 1
+ Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
+ double: 1
+ float: 2
+@@ -881,21 +1208,14 @@ float: 2
+ ifloat: 2
+ Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
+ double: 2
+-float: 2
+ idouble: 2
+-ifloat: 2
+-ildouble: 2
+-ldouble: 2
+ Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
+ double: 3
+ float: 1
+ idouble: 3
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+-Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
+-double: 1
+-idouble: 1
++ildouble: 1
++ldouble: 1
+ Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
+ float: 1
+ ifloat: 1
+@@ -904,8 +1224,8 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
++ildouble: 1
++ldouble: 1
+ Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
+ double: 1
+ idouble: 1
+@@ -950,18 +1270,12 @@ ildouble: 1
+ ldouble: 1
+ Function: Real part of "cacosh":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+ ildouble: 1
+ ldouble: 1
+ Function: Imaginary part of "cacosh":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
++float: 1
++ifloat: 1
+ Function: Real part of "casin":
+ double: 1
+@@ -992,8 +1306,6 @@ ildouble: 1
+ ldouble: 1
+ Function: Real part of "catan":
+-float: 4
+-ifloat: 4
+ ildouble: 1
+ ldouble: 1
+@@ -1009,10 +1321,6 @@ Function: Real part of "catanh":
+ double: 4
+ idouble: 4
+-Function: Imaginary part of "catanh":
+-float: 6
+-ifloat: 6
+-
+ Function: "cbrt":
+ double: 1
+ idouble: 1
+@@ -1066,8 +1374,6 @@ ildouble: 2
+ ldouble: 2
+ Function: Imaginary part of "clog":
+-float: 3
+-ifloat: 3
+ ildouble: 1
+ ldouble: 1
+@@ -1079,9 +1385,9 @@ ldouble: 3
+ Function: Imaginary part of "clog10":
+ double: 1
+-float: 5
++float: 1
+ idouble: 1
+-ifloat: 5
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1093,10 +1399,54 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "cos_downward":
++float: 1
++ifloat: 1
++ildouble: 4
++ldouble: 4
++
++Function: "cos_tonearest":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "cos_upward":
++float: 2
++ifloat: 2
++ildouble: 2
++ldouble: 2
++
+ Function: "cosh":
+ ildouble: 1
+ ldouble: 1
++Function: "cosh_downward":
++float: 1
++ifloat: 1
++ildouble: 5269156250720
++ldouble: 5269156250720
++
++Function: "cosh_tonearest":
++ildouble: 5269156250719
++ldouble: 5269156250719
++
++Function: "cosh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 5269156250720
++ldouble: 5269156250720
++
++Function: "cosh_upward":
++ildouble: 5269156250719
++ldouble: 5269156250719
++
+ Function: Real part of "cpow":
+ double: 2
+ float: 5
+@@ -1113,10 +1463,6 @@ ifloat: 2
+ ildouble: 2
+ ldouble: 2
+-Function: Imaginary part of "cproj":
+-ildouble: 1
+-ldouble: 1
+-
+ Function: Real part of "csin":
+ ildouble: 1
+ ldouble: 1
+@@ -1146,8 +1492,6 @@ ildouble: 1
+ ldouble: 1
+ Function: Real part of "ctan":
+-double: 1
+-idouble: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1201,6 +1545,28 @@ Function: "exp2":
+ ildouble: 2
+ ldouble: 2
++Function: "exp_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "exp_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "exp_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "exp_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ Function: "expm1":
+ double: 1
+ float: 1
+@@ -1218,10 +1584,10 @@ ildouble: 1
+ ldouble: 1
+ Function: "j0":
+-double: 3
+-float: 2
+-idouble: 3
+-ifloat: 2
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1235,9 +1601,9 @@ ldouble: 1
+ Function: "jn":
+ double: 3
+-float: 4
++float: 3
+ idouble: 3
+-ifloat: 4
++ifloat: 3
+ ildouble: 4
+ ldouble: 4
+@@ -1264,8 +1630,6 @@ ldouble: 1
+ Function: "log1p":
+ float: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ Function: "log2":
+ ildouble: 1
+@@ -1275,10 +1639,52 @@ Function: "pow":
+ ildouble: 1
+ ldouble: 1
++Function: "pow_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ Function: "sin":
+ ildouble: 1
+ ldouble: 1
++Function: "sin_downward":
++float: 1
++ifloat: 1
++ildouble: 4
++ldouble: 4
++
++Function: "sin_tonearest":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "sin_upward":
++float: 2
++ifloat: 2
++ildouble: 2
++ldouble: 2
++
+ Function: "sincos":
+ double: 1
+ float: 1
+@@ -1291,12 +1697,54 @@ Function: "sinh":
+ ildouble: 1
+ ldouble: 1
++Function: "sinh_downward":
++float: 1
++ifloat: 1
++ildouble: 5269156250718
++ldouble: 5269156250718
++
++Function: "sinh_tonearest":
++ildouble: 5269156250719
++ldouble: 5269156250719
++
++Function: "sinh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 5269156250718
++ldouble: 5269156250718
++
++Function: "sinh_upward":
++ildouble: 5269156250719
++ldouble: 5269156250719
++
+ Function: "tan":
+ double: 1
+ idouble: 1
+ ildouble: 1
+ ldouble: 1
++Function: "tan_downward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "tan_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "tan_towardzero":
++float: 1
++ifloat: 1
++ildouble: 3
++ldouble: 3
++
++Function: "tan_upward":
++float: 1
++ifloat: 1
++ildouble: 3
++ldouble: 3
++
+ Function: "tanh":
+ ildouble: 1
+ ldouble: 1
+diff -Nrup a/sysdeps/s390/fpu/libm-test-ulps b/sysdeps/s390/fpu/libm-test-ulps
+--- a/sysdeps/s390/fpu/libm-test-ulps  2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/s390/fpu/libm-test-ulps  2012-08-06 09:54:38.324772546 -0600
+@@ -31,16 +31,9 @@ ildouble: 1
+ ldouble: 1
+ # cacosh
+-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+ Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -83,17 +76,11 @@ ildouble: 1
+ ldouble: 1
+ # catan
+-Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+-float: 3
+-ifloat: 3
+ Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+-float: 4
+-ifloat: 4
+ Test "Imaginary part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+ ildouble: 1
+ ldouble: 1
+@@ -102,17 +89,12 @@ ldouble: 1
+ Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+ double: 4
+ idouble: 4
+-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+-float: 4
+-ifloat: 4
+ Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+ double: 1
+ idouble: 1
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+-float: 6
+-ifloat: 6
+ ildouble: 1
+ ldouble: 1
+@@ -185,9 +167,6 @@ ildouble: 1
+ ldouble: 1
+ # clog
+-Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
+-float: 3
+-ifloat: 3
+ Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+ float: 1
+ ifloat: 1
+@@ -210,9 +189,7 @@ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ double: 1
+-float: 5
+ idouble: 1
+-ifloat: 5
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+@@ -288,9 +265,7 @@ ifloat: 1
+ # cos
+ Test "cos (M_PI_6l * 2.0) == 0.5":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "cos (M_PI_6l * 4.0) == -0.5":
+@@ -300,11 +275,159 @@ idouble: 2
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "cos (pi/2) == 0":
+-double: 1
++
++# cos_downward
++Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (6) == 0.9601702866503660205456522979229244054519":
++ildouble: 1
++ldouble: 1
++Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++# cos_tonearest
++Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++
++# cos_towardzero
++Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (4) == -0.6536436208636119146391681830977503814241":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (6) == 0.9601702866503660205456522979229244054519":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++# cos_upward
++Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
++float: 1
++ifloat: 1
++Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
++float: 1
++ifloat: 1
++Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++
++# cosh_downward
++Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# cosh_tonearest
++Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
++ildouble: 1
++ldouble: 1
++
++# cosh_towardzero
++Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
+ float: 1
+-idouble: 1
+ ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# cosh_upward
++Test "cosh_upward (22) == 1792456423.065795780980053377632656584997":
++ildouble: 1
++ldouble: 1
++Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
++ildouble: 1
++ldouble: 1
++Test "cosh_upward (24) == 13244561064.92173614708845674912733665919":
++ildouble: 1
++ldouble: 1
+ # cpow
+ Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+@@ -393,8 +516,6 @@ ldouble: 1
+ # ctan
+ Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+-double: 1
+-idouble: 1
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+@@ -467,6 +588,37 @@ Test "exp2 (10) == 1024":
+ ildouble: 2
+ ldouble: 2
++# exp_downward
++Test "exp_downward (2) == e^2":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "exp_downward (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_towardzero
++Test "exp_towardzero (2) == e^2":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "exp_towardzero (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_upward
++Test "exp_upward (1) == e":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ # expm1
+ Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
+ double: 1
+@@ -513,29 +665,27 @@ ifloat: 1
+ # j0
+ Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ Test "j0 (0.75) == 0.864242275166648623555731103820923211":
+ float: 1
+ ifloat: 1
+ Test "j0 (10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 2
+ float: 1
+-idouble: 3
++idouble: 2
+ ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "j0 (2.0) == 0.223890779141235668051827454649948626":
+-float: 2
+-ifloat: 2
+ ildouble: 2
+ ldouble: 2
+ Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ Test "j0 (8.0) == 0.171650807137553906090869407851972001":
+ float: 1
+ ifloat: 1
+@@ -569,29 +719,27 @@ ldouble: 4
+ # jn
+ Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
+ float: 1
+ ifloat: 1
+ Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
+-double: 3
++double: 2
+ float: 1
+-idouble: 3
++idouble: 2
+ ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
+-float: 2
+-ifloat: 2
+ ildouble: 2
+ ldouble: 2
+ Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
+ float: 1
+ ifloat: 1
+@@ -640,15 +788,13 @@ Test "jn (10, 1.0) == 0.2630615123687453
+ ildouble: 1
+ ldouble: 1
+ Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
+-double: 4
+-float: 3
+-idouble: 4
+-ifloat: 3
++float: 1
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
+-float: 4
+-ifloat: 4
++float: 3
++ifloat: 3
+ Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
+ double: 1
+ float: 1
+@@ -661,16 +807,16 @@ idouble: 1
+ ifloat: 1
+ Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
+ double: 3
+-float: 2
++float: 1
+ idouble: 3
+-ifloat: 2
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
+ double: 1
+-float: 2
++float: 1
+ idouble: 1
+-ifloat: 2
++ifloat: 1
+ # lgamma
+ Test "lgamma (-0.5) == log(2*sqrt(pi))":
+@@ -713,71 +859,315 @@ Test "log2 (0.75) == -.41503749927884381
+ ildouble: 1
+ ldouble: 1
+-# sincos
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
+-double: 1
++# pow_downward
++Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+-double: 1
++
++# pow_towardzero
++Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
++float: 1
++ifloat: 1
++
++# pow_upward
++Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
+-double: 1
++
++# sin_downward
++Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
+ float: 1
+ ifloat: 1
+-
+-# sqrt
+-Test "sqrt (2) == M_SQRT2l":
+ ildouble: 1
+ ldouble: 1
+-
+-# tan
+-Test "tan (pi/4) == 1":
+-double: 1
+-idouble: 1
+-
+-# tanh
+-Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
++Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
+ ildouble: 1
+ ldouble: 1
+-Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
++Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "tanh (0.75) == 0.635148952387287319214434357312496495":
++Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
++Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
+ ildouble: 1
+ ldouble: 1
+-# tgamma
+-Test "tgamma (-0.5) == -2 sqrt (pi)":
+-double: 1
++# sin_tonearest
++Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "tgamma (0.5) == sqrt (pi)":
++Test "sin_tonearest (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
++ildouble: 1
++ldouble: 1
++
++# sin_towardzero
++Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
+ float: 1
+ ifloat: 1
+-Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
+-double: 1
++Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
+ float: 1
+-idouble: 1
+ ifloat: 1
+-Test "tgamma (4) == 6":
++Test "sin_towardzero (2) == 0.9092974268256816953960198659117448427023":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++# sin_upward
++Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_upward (10) == -0.5440211108893698134047476618513772816836":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
++float: 2
++ifloat: 2
++Test "sin_upward (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_upward (7) == 0.6569865987187890903969990915936351779369":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# sincos
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
++double: 1
++idouble: 1
++ildouble: 1
++ldouble: 1
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++float: 1
++ifloat: 1
++
++# sinh_downward
++Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# sinh_towardzero
++Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++
++# sinh_upward
++Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
++ildouble: 1
++ldouble: 1
++Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
++ildouble: 1
++ldouble: 1
++Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
++ildouble: 1
++ldouble: 1
++
++# sqrt
++Test "sqrt (2) == M_SQRT2l":
++ildouble: 1
++ldouble: 1
++
++# tan_downward
++Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
++float: 1
++ifloat: 1
++Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++
++# tan_towardzero
++Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# tan_upward
++Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
++float: 1
++ifloat: 1
++Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (4) == 1.1578212823495775831373424182673239231198":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
++ildouble: 1
++ldouble: 1
++
++# tanh
++Test "tanh (-0.75) == -0.635148952387287319214434357312496495":
++ildouble: 1
++ldouble: 1
++Test "tanh (-1.0) == -0.7615941559557648881194582826047935904":
++ildouble: 1
++ldouble: 1
++Test "tanh (0.75) == 0.635148952387287319214434357312496495":
++ildouble: 1
++ldouble: 1
++Test "tanh (1.0) == 0.7615941559557648881194582826047935904":
++ildouble: 1
++ldouble: 1
++
++# tgamma
++Test "tgamma (-0.5) == -2 sqrt (pi)":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tgamma (0.5) == sqrt (pi)":
++float: 1
++ifloat: 1
++Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
++double: 1
++float: 1
++idouble: 1
++ifloat: 1
++Test "tgamma (4) == 6":
+ ildouble: 1
+ ldouble: 1
+@@ -917,17 +1307,13 @@ ifloat: 2
+ ildouble: 5
+ ldouble: 5
+ Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
+-double: 1
+ float: 2
+-idouble: 1
+ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+ Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
+ double: 2
+-float: 2
+ idouble: 2
+-ifloat: 2
+ ildouble: 2
+ ldouble: 2
+ Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
+@@ -941,9 +1327,7 @@ Test "yn (3, 0.125) == -2612.69757350066
+ double: 1
+ idouble: 1
+ Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -973,17 +1357,9 @@ Function: Imaginary part of "cacos":
+ ildouble: 1
+ ldouble: 1
+-Function: Real part of "cacosh":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+-
+ Function: Imaginary part of "cacosh":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1013,10 +1389,6 @@ ifloat: 6
+ ildouble: 2
+ ldouble: 2
+-Function: Real part of "catan":
+-float: 4
+-ifloat: 4
+-
+ Function: Imaginary part of "catan":
+ double: 1
+ float: 1
+@@ -1032,8 +1404,6 @@ ildouble: 1
+ ldouble: 1
+ Function: Imaginary part of "catanh":
+-float: 6
+-ifloat: 6
+ ildouble: 1
+ ldouble: 1
+@@ -1089,10 +1459,6 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Function: Imaginary part of "clog":
+-float: 3
+-ifloat: 3
+-
+ Function: Real part of "clog10":
+ float: 1
+ ifloat: 1
+@@ -1101,9 +1467,9 @@ ldouble: 1
+ Function: Imaginary part of "clog10":
+ double: 1
+-float: 5
++float: 1
+ idouble: 1
+-ifloat: 5
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1115,6 +1481,48 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "cos_downward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "cos_tonearest":
++float: 1
++ifloat: 1
++
++Function: "cos_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "cos_upward":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_upward":
++ildouble: 1
++ldouble: 1
++
+ Function: Real part of "cpow":
+ double: 2
+ float: 4
+@@ -1162,8 +1570,6 @@ ildouble: 1
+ ldouble: 1
+ Function: Real part of "ctan":
+-double: 1
+-idouble: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1211,6 +1617,24 @@ Function: "exp2":
+ ildouble: 2
+ ldouble: 2
++Function: "exp_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "exp_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "exp_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ Function: "expm1":
+ double: 1
+ float: 1
+@@ -1228,10 +1652,10 @@ float: 1
+ ifloat: 1
+ Function: "j0":
+-double: 3
+-float: 2
+-idouble: 3
+-ifloat: 2
++double: 2
++float: 1
++idouble: 2
++ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -1244,10 +1668,10 @@ ildouble: 4
+ ldouble: 4
+ Function: "jn":
+-double: 4
+-float: 4
+-idouble: 4
+-ifloat: 4
++double: 3
++float: 3
++idouble: 3
++ifloat: 3
+ ildouble: 4
+ ldouble: 4
+@@ -1277,6 +1701,44 @@ Function: "log2":
+ ildouble: 1
+ ldouble: 1
++Function: "pow_downward":
++float: 1
++ifloat: 1
++
++Function: "pow_towardzero":
++float: 1
++ifloat: 1
++
++Function: "pow_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_tonearest":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "sin_upward":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++
+ Function: "sincos":
+ double: 1
+ float: 1
+@@ -1285,6 +1747,22 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "sinh_downward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "sinh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "sinh_upward":
++ildouble: 1
++ldouble: 1
++
+ Function: "sqrt":
+ ildouble: 1
+ ldouble: 1
+@@ -1293,6 +1771,24 @@ Function: "tan":
+ double: 1
+ idouble: 1
++Function: "tan_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "tan_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "tan_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
+ Function: "tanh":
+ ildouble: 1
+ ldouble: 1
+diff -Nrup a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
+--- a/sysdeps/x86_64/fpu/libm-test-ulps        2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/x86_64/fpu/libm-test-ulps        2012-08-06 11:02:14.602759422 -0600
+@@ -42,26 +42,13 @@ ldouble: 1
+ # cacos
+ Test "Imaginary part of: cacos (0.75 + 1.25 i) == 1.11752014915610270578240049553777969 - 1.13239363160530819522266333696834467 i":
+-float: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ # cacosh
+-Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+-ildouble: 6
+-ldouble: 6
+ Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
+-ildouble: 1
+-ldouble: 1
++float: 1
++ifloat: 1
+ Test "Real part of: cacosh (0.75 + 1.25 i) == 1.13239363160530819522266333696834467 + 1.11752014915610270578240049553777969 i":
+ ildouble: 1
+ ldouble: 1
+@@ -75,8 +62,6 @@ ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Test "Imaginary part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
+-float: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -103,21 +88,15 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ldouble: 1
+ ildouble: 1
++ldouble: 1
+ # catan
+-Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+-float: 3
+-ifloat: 3
+ Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
+ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
+-float: 4
+-ifloat: 4
+ # catanh
+ Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+@@ -125,15 +104,9 @@ double: 4
+ idouble: 4
+ ildouble: 1
+ ldouble: 1
+-Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
+-float: 4
+-ifloat: 4
+ Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+ double: 1
+ idouble: 1
+-Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
+-float: 6
+-ifloat: 6
+ # cbrt
+ Test "cbrt (-0.001) == -0.1":
+@@ -152,14 +125,9 @@ ildouble: 1
+ ldouble: 1
+ # ccos
+-Test "Real part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+-double: 1
+-idouble: 1
+ Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
+ float: 1
+ ifloat: 1
+-ildouble: 1
+-ldouble: 1
+ Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+ double: 1
+ float: 1
+@@ -168,19 +136,17 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
+-ildouble: 1
+-ldouble: 1
+ float: 1
+ ifloat: 1
++ildouble: 1
++ldouble: 1
+ # ccosh
+ Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
+ float: 1
+ ifloat: 1
+ Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -205,9 +171,6 @@ ildouble: 1
+ ldouble: 1
+ # clog
+-Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
+-float: 3
+-ifloat: 3
+ Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
+ float: 1
+ ifloat: 1
+@@ -227,11 +190,7 @@ idouble: 1
+ ifloat: 1
+ Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
+ double: 1
+-float: 5
+ idouble: 1
+-ifloat: 5
+-ildouble: 1
+-ldouble: 1
+ Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
+ double: 1
+ float: 1
+@@ -276,9 +235,7 @@ float: 1
+ idouble: 1
+ ifloat: 1
+ Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -306,33 +263,164 @@ ifloat: 1
+ # cos
+ Test "cos (M_PI_6l * 2.0) == 0.5":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ Test "cos (M_PI_6l * 4.0) == -0.5":
+ double: 2
+ float: 1
+ idouble: 2
+ ifloat: 1
++
++# cos_downward
++Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
++float: 1
++ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "cos (pi/2) == 0":
+-double: 1
++Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++Test "cos_downward (4) == -0.6536436208636119146391681830977503814241":
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "cos (0.80190127184058835) == 0.69534156199418473":
+-double: 1
+-idouble: 1
++Test "cos_downward (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_downward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
++ildouble: 1
++ldouble: 1
++
++# cos_tonearest
++Test "cos_tonearest (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
++ildouble: 1
++ldouble: 1
++Test "cos_tonearest (9) == -0.9111302618846769883682947111811653112463":
++ildouble: 1
++ldouble: 1
++
++# cos_towardzero
++Test "cos_towardzero (1) == 0.5403023058681397174009366074429766037323":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (10) == -0.8390715290764524522588639478240648345199":
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (2) == -0.4161468365471423869975682295007621897660":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (3) == -0.9899924966004454572715727947312613023937":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (5) == 0.2836621854632262644666391715135573083344":
++float: 1
++ifloat: 1
++Test "cos_towardzero (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_towardzero (8) == -0.1455000338086135258688413818311946826093":
++float: 1
++ifloat: 1
++
++# cos_upward
++Test "cos_upward (10) == -0.8390715290764524522588639478240648345199":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (2) == -0.4161468365471423869975682295007621897660":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (3) == -0.9899924966004454572715727947312613023937":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (5) == 0.2836621854632262644666391715135573083344":
++ildouble: 1
++ldouble: 1
++Test "cos_upward (6) == 0.9601702866503660205456522979229244054519":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cos_upward (7) == 0.7539022543433046381411975217191820122183":
++float: 1
++ifloat: 1
++Test "cos_upward (9) == -0.9111302618846769883682947111811653112463":
++float: 2
++ifloat: 2
++
++# cosh_downward
++Test "cosh_downward (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "cosh_downward (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_downward (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# cosh_tonearest
++Test "cosh_tonearest (22) == 1792456423.065795780980053377632656584997":
++ildouble: 1
++ldouble: 1
++
++# cosh_towardzero
++Test "cosh_towardzero (22) == 1792456423.065795780980053377632656584997":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "cosh_towardzero (23) == 4872401723.124451300068625740569997090344":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "cosh_towardzero (24) == 13244561064.92173614708845674912733665919":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# cosh_upward
++Test "cosh_upward (23) == 4872401723.124451300068625740569997090344":
++ildouble: 1
++ldouble: 1
+ # cpow
+ Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+ float: 1
+ ifloat: 1
+-ldouble: 1
+ ildouble: 1
++ldouble: 1
+ Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
+ float: 1
+ ifloat: 1
+@@ -363,9 +451,9 @@ ildouble: 1
+ ldouble: 1
+ Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
+ double: 1
+-float: 5
++float: 4
+ idouble: 1
+-ifloat: 5
++ifloat: 4
+ Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
+ float: 2
+ ifloat: 2
+@@ -383,22 +471,11 @@ ldouble: 1
+ Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+ ildouble: 1
+ ldouble: 1
+-Test "Imaginary part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
+-float: 1
+-ifloat: 1
+-Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+-double: 1
+-idouble: 1
+ # csinh
+-Test "Real part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+-double: 1
+-idouble: 1
+ Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
+ double: 1
+ idouble: 1
+-ildouble: 2
+-ldouble: 2
+ Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
+ float: 1
+ ifloat: 1
+@@ -418,37 +495,31 @@ ifloat: 1
+ # ctan
+ Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+-double: 1
+-idouble: 1
+-ildouble: 439
+-ldouble: 439
++ildouble: 1
++ldouble: 1
+ Test "Imaginary part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
+-float: 1
+-ifloat: 1
+-ildouble: 2
+-ldouble: 2
++ildouble: 1
++ldouble: 1
+ Test "Real part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+ ildouble: 1
+ ldouble: 1
+ Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 3
+ ldouble: 3
+ # ctanh
+ Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+-float: 2
+-ifloat: 2
+-ildouble: 5
+-ldouble: 5
+ double: 1
++float: 2
+ idouble: 1
++ifloat: 2
++ildouble: 3
++ldouble: 3
+ Test "Imaginary part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
+-ildouble: 25
+-ldouble: 25
++ildouble: 1
++ldouble: 1
+ Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
+ float: 1
+ ifloat: 1
+@@ -456,10 +527,10 @@ Test "Real part of: ctanh (0.75 + 1.25 i
+ double: 1
+ idouble: 1
+ Test "Imaginary part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
+-ildouble: 1
+-ldouble: 1
+ double: 1
+ idouble: 1
++ildouble: 1
++ldouble: 1
+ # erf
+ Test "erf (1.25) == 0.922900128256458230136523481197281140":
+@@ -481,26 +552,61 @@ ldouble: 1
+ # exp10
+ Test "exp10 (-1) == 0.1":
+-ildouble: 1
+-ldouble: 1
+-float: 1
+-ifloat: 1
+ double: 2
+-idouble: 2
+-Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
+-ildouble: 2
+-ldouble: 2
+ float: 1
++idouble: 2
+ ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
+ double: 1
++float: 1
+ idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
+ Test "exp10 (3) == 1000":
+-ildouble: 8
+-ldouble: 8
+-float: 2
+-ifloat: 2
+ double: 6
++float: 2
+ idouble: 6
++ifloat: 2
++ildouble: 3
++ldouble: 3
++
++# exp_downward
++Test "exp_downward (1) == e":
++ildouble: 1
++ldouble: 1
++Test "exp_downward (2) == e^2":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "exp_downward (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_towardzero
++Test "exp_towardzero (1) == e":
++ildouble: 1
++ldouble: 1
++Test "exp_towardzero (2) == e^2":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++Test "exp_towardzero (3) == e^3":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# exp_upward
++Test "exp_upward (1) == e":
++float: 1
++ifloat: 1
+ # expm1
+ Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
+@@ -570,9 +676,7 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "j0 (8.0) == 0.171650807137553906090869407851972001":
+-double: 2
+ float: 1
+-idouble: 2
+ ifloat: 1
+ # j1
+@@ -617,9 +721,7 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
+-double: 2
+ float: 1
+-idouble: 2
+ ifloat: 1
+ Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
+ float: 2
+@@ -714,12 +816,12 @@ ldouble: 1
+ # log10
+ Test "log10 (0.75) == -0.124938736608299953132449886193870744":
+-ildouble: 1
+-ldouble: 1
+-float: 2
+-ifloat: 2
+ double: 1
++float: 2
+ idouble: 1
++ifloat: 2
++ildouble: 1
++ldouble: 1
+ Test "log10 (e) == log10(e)":
+ float: 1
+ ifloat: 1
+@@ -731,37 +833,309 @@ Test "log1p (-0.25) == -0.28768207245178
+ float: 1
+ ifloat: 1
+-# sincos
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
+-double: 1
+-float: 1
+-idouble: 1
+-ifloat: 1
+-Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+-double: 1
+-float: 1
+-idouble: 1
+-ifloat: 1
++# pow_downward
++Test "pow_downward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
+ ildouble: 1
+ ldouble: 1
+-Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
+-double: 1
++Test "pow_downward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++
++# pow_towardzero
++Test "pow_towardzero (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
++ildouble: 1
++ldouble: 1
++Test "pow_towardzero (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# pow_upward
++Test "pow_upward (1.0625, 1.125) == 1.070582293028761362162622578677070098674":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "pow_upward (1.5, 1.03125) == 1.519127098714743184071644334163037684948":
++ildouble: 1
++ldouble: 1
++
++# sin_downward
++Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sin_downward (6) == -0.2794154981989258728115554466118947596280":
++float: 1
++ifloat: 1
++Test "sin_downward (7) == 0.6569865987187890903969990915936351779369":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (8) == 0.9893582466233817778081235982452886721164":
++ildouble: 1
++ldouble: 1
++Test "sin_downward (9) == 0.4121184852417565697562725663524351793439":
++ildouble: 1
++ldouble: 1
++
++# sin_tonearest
++Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
++float: 1
++ifloat: 1
++Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (4) == -0.7568024953079282513726390945118290941359":
++ildouble: 1
++ldouble: 1
++Test "sin_tonearest (9) == 0.4121184852417565697562725663524351793439":
++ildouble: 1
++ldouble: 1
++
++# sin_towardzero
++Test "sin_towardzero (1) == 0.8414709848078965066525023216302989996226":
+ float: 1
+ ifloat: 1
+-Test "sincos (0.80190127184058835, &sin_res, &cos_res) puts 0.69534156199418473 in cos_res":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (10) == -0.5440211108893698134047476618513772816836":
++float: 1
++ifloat: 1
++Test "sin_towardzero (3) == 0.1411200080598672221007448028081102798469":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_towardzero (5) == -0.9589242746631384688931544061559939733525":
++float: 1
++ifloat: 1
++Test "sin_towardzero (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (7) == 0.6569865987187890903969990915936351779369":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (8) == 0.9893582466233817778081235982452886721164":
++ildouble: 1
++ldouble: 1
++Test "sin_towardzero (9) == 0.4121184852417565697562725663524351793439":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# sin_upward
++Test "sin_upward (1) == 0.8414709848078965066525023216302989996226":
++float: 1
++ifloat: 1
++Test "sin_upward (2) == 0.9092974268256816953960198659117448427023":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++Test "sin_upward (4) == -0.7568024953079282513726390945118290941359":
++float: 1
++ifloat: 1
++Test "sin_upward (6) == -0.2794154981989258728115554466118947596280":
++ildouble: 1
++ldouble: 1
++Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
++float: 1
++ifloat: 1
++
++# sincos
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
+ double: 1
+ idouble: 1
+-
+-# tan
+-Test "tan (pi/4) == 1":
++Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
+ double: 1
++float: 1
+ idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
++float: 1
++ifloat: 1
++
++# sinh_downward
++Test "sinh_downward (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 4
++ldouble: 4
++Test "sinh_downward (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++Test "sinh_downward (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ildouble: 5
++ldouble: 5
++
++# sinh_tonearest
++Test "sinh_tonearest (22) == 1792456423.065795780701106568345764104225":
++ildouble: 3
++ldouble: 3
++Test "sinh_tonearest (23) == 4872401723.124451299966006944252978187305":
++ildouble: 1
++ldouble: 1
++Test "sinh_tonearest (24) == 13244561064.92173614705070540368454568168":
++ildouble: 6
++ldouble: 6
++
++# sinh_towardzero
++Test "sinh_towardzero (22) == 1792456423.065795780701106568345764104225":
++float: 1
++ifloat: 1
++ildouble: 4
++ldouble: 4
++Test "sinh_towardzero (23) == 4872401723.124451299966006944252978187305":
++float: 1
++ifloat: 1
++Test "sinh_towardzero (24) == 13244561064.92173614705070540368454568168":
++float: 1
++ifloat: 1
++ildouble: 5
++ldouble: 5
++
++# sinh_upward
++Test "sinh_upward (22) == 1792456423.065795780701106568345764104225":
++ildouble: 16
++ldouble: 16
++Test "sinh_upward (23) == 4872401723.124451299966006944252978187305":
++ildouble: 27
++ldouble: 27
++Test "sinh_upward (24) == 13244561064.92173614705070540368454568168":
++ildouble: 7
++ldouble: 7
++
++# tan_downward
++Test "tan_downward (1) == 1.5574077246549022305069748074583601730873":
++float: 1
++ifloat: 1
++Test "tan_downward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_downward (2) == -2.1850398632615189916433061023136825434320":
++float: 1
++ifloat: 1
++Test "tan_downward (4) == 1.1578212823495775831373424182673239231198":
++ildouble: 1
++ldouble: 1
++Test "tan_downward (5) == -3.3805150062465856369827058794473439087096":
++ildouble: 1
++ldouble: 1
++Test "tan_downward (6) == -0.2910061913847491570536995888681755428312":
++float: 1
++ifloat: 1
++Test "tan_downward (8) == -6.7997114552203786999252627596086333648814":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_downward (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++
++# tan_tonearest
++Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (8) == -6.7997114552203786999252627596086333648814":
++ildouble: 1
++ldouble: 1
++Test "tan_tonearest (9) == -0.4523156594418098405903708757987855343087":
++ildouble: 1
++ldouble: 1
++
++# tan_towardzero
++Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (4) == 1.1578212823495775831373424182673239231198":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++Test "tan_towardzero (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_towardzero (8) == -6.7997114552203786999252627596086333648814":
++ildouble: 2
++ldouble: 2
++Test "tan_towardzero (9) == -0.4523156594418098405903708757987855343087":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++# tan_upward
++Test "tan_upward (1) == 1.5574077246549022305069748074583601730873":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (10) == 0.6483608274590866712591249330098086768169":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (2) == -2.1850398632615189916433061023136825434320":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (3) == -0.1425465430742778052956354105339134932261":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++Test "tan_upward (5) == -3.3805150062465856369827058794473439087096":
++float: 1
++ifloat: 1
++Test "tan_upward (6) == -0.2910061913847491570536995888681755428312":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (7) == 0.8714479827243187364564508896003135663222":
++ildouble: 1
++ldouble: 1
++Test "tan_upward (8) == -6.7997114552203786999252627596086333648814":
++ildouble: 2
++ldouble: 2
++Test "tan_upward (9) == -0.4523156594418098405903708757987855343087":
++ildouble: 1
++ldouble: 1
+ # tgamma
+ Test "tgamma (-0.5) == -2 sqrt (pi)":
+@@ -779,9 +1153,6 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-Test "tgamma (4) == 6":
+-ildouble: 1
+-ldouble: 1
+ # y0
+ Test "y0 (0.125) == -1.38968062514384052915582277745018693":
+@@ -960,27 +1331,17 @@ ildouble: 1
+ ldouble: 1
+ Function: Imaginary part of "cacos":
+-float: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+ Function: Real part of "cacosh":
+-double: 1
+-float: 7
+-idouble: 1
+-ifloat: 7
+-ildouble: 6
+-ldouble: 6
+-
+-Function: Imaginary part of "cacosh":
+-double: 1
+-float: 3
+-idouble: 1
+-ifloat: 3
+ ildouble: 1
+ ldouble: 1
++Function: Imaginary part of "cacosh":
++float: 1
++ifloat: 1
++
+ Function: Real part of "casin":
+ double: 1
+ float: 1
+@@ -990,8 +1351,6 @@ ildouble: 2
+ ldouble: 2
+ Function: Imaginary part of "casin":
+-float: 1
+-ifloat: 1
+ ildouble: 2
+ ldouble: 2
+@@ -1011,10 +1370,6 @@ ifloat: 6
+ ildouble: 5
+ ldouble: 5
+-Function: Real part of "catan":
+-float: 4
+-ifloat: 4
+-
+ Function: Imaginary part of "catan":
+ double: 1
+ float: 1
+@@ -1027,10 +1382,6 @@ idouble: 4
+ ildouble: 1
+ ldouble: 1
+-Function: Imaginary part of "catanh":
+-float: 6
+-ifloat: 6
+-
+ Function: "cbrt":
+ double: 1
+ idouble: 1
+@@ -1058,9 +1409,7 @@ idouble: 1
+ ifloat: 1
+ Function: Imaginary part of "ccosh":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1081,25 +1430,17 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+-Function: Imaginary part of "clog":
+-float: 3
+-ifloat: 3
+-
+ Function: Real part of "clog10":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+ Function: Imaginary part of "clog10":
+ double: 1
+-float: 5
++float: 1
+ idouble: 1
+-ifloat: 5
+-ildouble: 1
+-ldouble: 1
++ifloat: 1
+ Function: "cos":
+ double: 2
+@@ -1109,11 +1450,55 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "cos_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_tonearest":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "cos_upward":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_downward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "cosh_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "cosh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "cosh_upward":
++ildouble: 1
++ldouble: 1
++
+ Function: Real part of "cpow":
+ double: 2
+-float: 5
++float: 4
+ idouble: 2
+-ifloat: 5
++ifloat: 4
+ ildouble: 5
+ ldouble: 5
+@@ -1129,16 +1514,8 @@ Function: Real part of "csin":
+ ildouble: 1
+ ldouble: 1
+-Function: Imaginary part of "csin":
+-double: 1
+-float: 1
+-idouble: 1
+-ifloat: 1
+-
+ Function: Real part of "csinh":
+-double: 1
+ float: 1
+-idouble: 1
+ ifloat: 1
+ ildouble: 1
+ ldouble: 1
+@@ -1148,24 +1525,18 @@ double: 1
+ float: 1
+ idouble: 1
+ ifloat: 1
+-ildouble: 2
+-ldouble: 2
+ Function: Real part of "csqrt":
+ float: 1
+ ifloat: 1
+ Function: Real part of "ctan":
+-double: 1
+-idouble: 1
+-ildouble: 439
+-ldouble: 439
++ildouble: 1
++ldouble: 1
+ Function: Imaginary part of "ctan":
+ double: 1
+-float: 1
+ idouble: 1
+-ifloat: 1
+ ildouble: 3
+ ldouble: 3
+@@ -1174,16 +1545,16 @@ double: 1
+ float: 2
+ idouble: 1
+ ifloat: 2
+-ildouble: 5
+-ldouble: 5
++ildouble: 3
++ldouble: 3
+ Function: Imaginary part of "ctanh":
+-float: 1
+-ifloat: 1
+-ildouble: 25
+-ldouble: 25
+ double: 1
++float: 1
+ idouble: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
+ Function: "erf":
+ double: 1
+@@ -1196,12 +1567,28 @@ ildouble: 1
+ ldouble: 1
+ Function: "exp10":
+-ildouble: 8
+-ldouble: 8
+-float: 2
+-ifloat: 2
+ double: 6
++float: 2
+ idouble: 6
++ifloat: 2
++ildouble: 3
++ldouble: 3
++
++Function: "exp_downward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "exp_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "exp_upward":
++float: 1
++ifloat: 1
+ Function: "expm1":
+ double: 1
+@@ -1250,17 +1637,59 @@ ildouble: 1
+ ldouble: 1
+ Function: "log10":
++double: 1
+ float: 2
++idouble: 1
+ ifloat: 2
+ ildouble: 1
+ ldouble: 1
+-double: 1
+-idouble: 1
+ Function: "log1p":
+ float: 1
+ ifloat: 1
++Function: "pow_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "pow_upward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_tonearest":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_towardzero":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "sin_upward":
++float: 2
++ifloat: 2
++ildouble: 1
++ldouble: 1
++
+ Function: "sincos":
+ double: 1
+ float: 1
+@@ -1269,10 +1698,52 @@ ifloat: 1
+ ildouble: 1
+ ldouble: 1
++Function: "sinh_downward":
++float: 1
++ifloat: 1
++ildouble: 5
++ldouble: 5
++
++Function: "sinh_tonearest":
++ildouble: 6
++ldouble: 6
++
++Function: "sinh_towardzero":
++float: 1
++ifloat: 1
++ildouble: 5
++ldouble: 5
++
++Function: "sinh_upward":
++ildouble: 27
++ldouble: 27
++
+ Function: "tan":
+ double: 1
+ idouble: 1
++Function: "tan_downward":
++float: 1
++ifloat: 1
++ildouble: 1
++ldouble: 1
++
++Function: "tan_tonearest":
++ildouble: 1
++ldouble: 1
++
++Function: "tan_towardzero":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
++Function: "tan_upward":
++float: 1
++ifloat: 1
++ildouble: 2
++ldouble: 2
++
+ Function: "tgamma":
+ double: 1
+ float: 1
+diff -Nrup a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
+--- a/sysdeps/x86_64/fpu/math_private.h        2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/x86_64/fpu/math_private.h        2012-08-06 09:54:00.893929393 -0600
+@@ -56,3 +56,82 @@ do {                                                                \
+ } while (0)
+ #endif
++
++
++/* Specialized variants of the <fenv.h> interfaces which only handle
++   either the FPU or the SSE unit.  */
++#undef libc_fegetround
++#define libc_fegetround() \
++  ({                                                                        \
++     unsigned int mxcsr;                                                    \
++     asm volatile ("stmxcsr %0" : "=m" (*&mxcsr));                          \
++     (mxcsr & 0x6000) >> 3;                                                 \
++  })
++#undef libc_fegetroundf
++#define libc_fegetroundf() libc_fegetround ()
++// #define libc_fegetroundl() fegetround ()
++
++#undef libc_fesetround
++#define libc_fesetround(r) \
++  do {                                                                              \
++     unsigned int mxcsr;                                                    \
++     asm ("stmxcsr %0" : "=m" (*&mxcsr));                                   \
++     mxcsr = (mxcsr & ~0x6000) | ((r) << 3);                                \
++     asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr));                         \
++  } while (0)
++#undef libc_fesetroundf
++#define libc_fesetroundf(r) libc_fesetround (r)
++// #define libc_fesetroundl(r) (void) fesetround (r)
++
++#undef libc_feholdexcept
++#define libc_feholdexcept(e) \
++  do {                                                                              \
++     unsigned int mxcsr;                                                    \
++     asm ("stmxcsr %0" : "=m" (*&mxcsr));                                   \
++     (e)->__mxcsr = mxcsr;                                                  \
++     mxcsr = (mxcsr | 0x1f80) & ~0x3f;                                              \
++     asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr));                         \
++  } while (0)
++#undef libc_feholdexceptf
++#define libc_feholdexceptf(e) libc_feholdexcept (e)
++// #define libc_feholdexceptl(e) (void) feholdexcept (e)
++
++#undef libc_feholdexcept_setround
++#define libc_feholdexcept_setround(e, r) \
++  do {                                                                              \
++     unsigned int mxcsr;                                                    \
++     asm ("stmxcsr %0" : "=m" (*&mxcsr));                                   \
++     (e)->__mxcsr = mxcsr;                                                  \
++     mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3);                             \
++     asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr));                         \
++  } while (0)
++#undef libc_feholdexcept_setroundf
++#define libc_feholdexcept_setroundf(e, r) libc_feholdexcept_setround (e, r)
++// #define libc_feholdexcept_setroundl(e, r) ...
++
++#undef libc_fetestexcept
++#define libc_fetestexcept(e) \
++  ({ unsigned int mxcsr; asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \
++     mxcsr & (e) & FE_ALL_EXCEPT; })
++#undef libc_fetestexceptf
++#define libc_fetestexceptf(e) libc_fetestexcept (e)
++// #define libc_fetestexceptl(e) fetestexcept (e)
++
++#undef libc_fesetenv
++#define libc_fesetenv(e) \
++  asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr))
++#undef libc_fesetenvf
++#define libc_fesetenvf(e) libc_fesetenv (e)
++// #define libc_fesetenvl(e) (void) fesetenv (e)
++
++#undef libc_feupdateenv
++#define libc_feupdateenv(e) \
++  do {                                                                              \
++    unsigned int mxcsr;                                                             \
++    asm volatile ("stmxcsr %0" : "=m" (*&mxcsr));                           \
++    asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr));                             \
++    feraiseexcept (mxcsr & FE_ALL_EXCEPT);                                  \
++  } while (0)
++#undef libc_feupdateenvf
++#define libc_feupdateenvf(e) libc_feupdateenv (e)
++// #define libc_feupdateenvl(e) (void) feupdateenv (e)
diff --git a/src/patches/glibc/glibc-rh841787.patch b/src/patches/glibc/glibc-rh841787.patch
new file mode 100644 (file)
index 0000000..3cec783
--- /dev/null
@@ -0,0 +1,42 @@
+diff -rup a/resolv/res_init.c b/resolv/res_init.c
+--- a/resolv/res_init.c        2012-07-26 15:10:45.655638776 -0600
++++ b/resolv/res_init.c        2012-07-26 15:11:27.731423002 -0600
+@@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit
+                       cp++;
+                   if ((*cp != '\0') && (*cp != '\n')
+                       && __inet_aton(cp, &a)) {
+-                      statp->nsaddr_list[nservall].sin_addr = a;
+-                      statp->nsaddr_list[nservall].sin_family = AF_INET;
+-                      statp->nsaddr_list[nservall].sin_port =
++                      statp->nsaddr_list[nserv].sin_addr = a;
++                      statp->nsaddr_list[nserv].sin_family = AF_INET;
++                      statp->nsaddr_list[nserv].sin_port =
+                               htons(NAMESERVER_PORT);
+                       nserv++;
+ #ifdef _LIBC
+diff -rup a/resolv/res_send.c b/resolv/res_send.c
+--- a/resolv/res_send.c        2010-05-04 05:27:23.000000000 -0600
++++ b/resolv/res_send.c        2012-07-26 15:34:58.398261659 -0600
+@@ -421,10 +421,10 @@ __libc_res_nsend(res_state statp, const
+                               EXT(statp).nsmap[n] = MAXNS;
+                       }
+               }
+-              n = statp->nscount;
+-              if (statp->nscount > EXT(statp).nscount)
++              n = statp->nscount - EXT(statp).nscount6;
++              if (n > EXT(statp).nscount)
+                       for (n = EXT(statp).nscount, ns = 0;
+-                           n < statp->nscount; n++) {
++                           n < statp->nscount - EXT(statp).nscount6; n++) {
+                               while (ns < MAXNS
+                                      && EXT(statp).nsmap[ns] != MAXNS)
+                                       ns++;
+@@ -441,7 +441,7 @@ __libc_res_nsend(res_state statp, const
+                                   malloc(sizeof (struct sockaddr_in6));
+                       if (EXT(statp).nsaddrs[n] != NULL) {
+                               memset (mempcpy(EXT(statp).nsaddrs[n],
+-                                              &statp->nsaddr_list[n],
++                                              &statp->nsaddr_list[ns],
+                                               sizeof (struct sockaddr_in)),
+                                       '\0',
+                                       sizeof (struct sockaddr_in6)
diff --git a/src/patches/glibc/glibc-rh843673.patch b/src/patches/glibc/glibc-rh843673.patch
new file mode 100644 (file)
index 0000000..a2ff262
--- /dev/null
@@ -0,0 +1,31 @@
+diff -Brup a/stdlib/msort.c b/stdlib/msort.c
+--- a/stdlib/msort.c   2010-05-04 07:27:23.000000000 -0400
++++ b/stdlib/msort.c   2012-08-07 13:30:14.131765346 -0400
+@@ -25,6 +25,8 @@
+ #include <unistd.h>
+ #include <memcopy.h>
+ #include <errno.h>
++#include <atomic.h>
++
+ struct msort_param
+ {
+@@ -182,7 +184,7 @@ qsort_r (void *b, size_t n, size_t s, __
+       static long int phys_pages;
+       static int pagesize;
+-      if (phys_pages == 0)
++      if (pagesize == 0)
+       {
+         phys_pages = __sysconf (_SC_PHYS_PAGES);
+@@ -197,6 +199,9 @@ qsort_r (void *b, size_t n, size_t s, __
+            a quarter of the physical memory.  */
+         phys_pages /= 4;
++          /* Make sure phys_pages is written to memory.  */
++          atomic_write_barrier ();
++
+         pagesize = __sysconf (_SC_PAGESIZE);
+       }
diff --git a/src/patches/glibc/glibc-rh846342.patch b/src/patches/glibc/glibc-rh846342.patch
new file mode 100644 (file)
index 0000000..8cfca05
--- /dev/null
@@ -0,0 +1,48 @@
+This is a workaround for broken code which issues memcpy requests with
+overlapping arguments.  With this patch installed, if the file
+/etc/sysconfig/32bit_ssse3_memcpy_via_32bit_ssse3_memmove exists then a
+32bit memcpy call which normally would be handled by the SSSE3 memcpy
+implementation would instead be handled by the 32bit SSSE3 memmove
+implementation which is more tolerant of overlaps.
+
+diff -Nrup a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
+--- a/sysdeps/i386/i686/multiarch/memcpy.S     2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/i386/i686/multiarch/memcpy.S     2012-11-20 14:19:52.890780415 -0700
+@@ -21,6 +21,10 @@
+ #include <sysdep.h>
+ #include <init-arch.h>
++        .section .rodata
++L(magicfile):
++      .ascii "/etc/sysconfig/32bit_ssse3_memcpy_via_32bit_ssse3_memmove"
++
+ /* Define multiple versions only for the definition in lib and for
+    DSO.  In static binaries we need memcpy before the initialization
+    happened.  */
+@@ -48,6 +52,26 @@ ENTRY(memcpy)
+ 1:    leal    __memcpy_ia32@GOTOFF(%ebx), %eax
+       testl   $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
+       jz      2f
++
++      /* This is an inlined access (magicfile, 0) syscall.  
++
++         Note that it clobbers %ebx, so we have to save/restore
++         it around the syscall.  */
++      mov     %ebx, %edx
++      leal    L(magicfile)@GOTOFF(%ebx), %ebx
++      xor     %ecx, %ecx
++      movl    $33, %eax
++      int     $0x80
++      mov     %edx, %ebx
++
++      /* If the file did not exist, then %eax will be -1..-4095 and we
++         do nothing special.  */
++      cmpl    $-4095, %eax
++      jae     4f
++
++      leal    __memmove_ssse3@GOTOFF(%ebx), %eax
++      jmp     2f
++4:
+       leal    __memcpy_ssse3@GOTOFF(%ebx), %eax
+       testl   $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)
+       jz      2f
diff --git a/src/patches/glibc/glibc-rh847932.patch b/src/patches/glibc/glibc-rh847932.patch
new file mode 100644 (file)
index 0000000..33ea851
--- /dev/null
@@ -0,0 +1,364 @@
+diff -Nrup a/stdlib/Makefile b/stdlib/Makefile
+--- a/stdlib/Makefile  2010-05-04 05:27:23.000000000 -0600
++++ b/stdlib/Makefile  2012-08-15 09:25:37.812443006 -0600
+@@ -71,7 +71,7 @@ tests                := tst-strtol tst-strtod testmb t
+                  tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
+                  tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2       \
+                  tst-makecontext2 tst-strtod6 tst-unsetenv1               \
+-                 tst-makecontext3
++                 tst-makecontext3 tst-strtod-overflow
+ include ../Makeconfig
+diff -Nrup a/stdlib/strtod_l.c b/stdlib/strtod_l.c
+--- a/stdlib/strtod_l.c        2010-05-04 05:27:23.000000000 -0600
++++ b/stdlib/strtod_l.c        2012-08-15 09:34:29.550281346 -0600
+@@ -62,6 +62,7 @@ extern unsigned long long int ____strtou
+ #include <math.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdint.h>
+ /* The gmp headers need some configuration frobs.  */
+ #define HAVE_ALLOCA 1
+@@ -176,19 +177,19 @@ extern const mp_limb_t _tens_in_limb[MAX
+ /* Return a floating point number of the needed type according to the given
+    multi-precision number after possible rounding.  */
+ static FLOAT
+-round_and_return (mp_limb_t *retval, int exponent, int negative,
++round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
+                 mp_limb_t round_limb, mp_size_t round_bit, int more_bits)
+ {
+   if (exponent < MIN_EXP - 1)
+     {
+-      mp_size_t shift = MIN_EXP - 1 - exponent;
+-
+-      if (shift > MANT_DIG)
++      if (exponent < MIN_EXP - 1 - MANT_DIG)
+       {
+         __set_errno (EDOM);
+         return 0.0;
+       }
++      mp_size_t shift = MIN_EXP - 1 - exponent;
++
+       more_bits |= (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0;
+       if (shift == MANT_DIG)
+       /* This is a special case to handle the very seldom case where
+@@ -235,6 +236,9 @@ round_and_return (mp_limb_t *retval, int
+       __set_errno (ERANGE);
+     }
++  if (exponent > MAX_EXP)
++    goto overflow;
++
+   if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
+       && (more_bits || (retval[0] & 1) != 0
+         || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0))
+@@ -260,6 +264,7 @@ round_and_return (mp_limb_t *retval, int
+     }
+   if (exponent > MAX_EXP)
++  overflow:
+     return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
+   return MPN2FLOAT (retval, exponent, negative);
+@@ -273,7 +278,7 @@ round_and_return (mp_limb_t *retval, int
+    factor for the resulting number (see code) multiply by it.  */
+ static const STRING_TYPE *
+ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
+-          int *exponent
++          intmax_t *exponent
+ #ifndef USE_WIDE_CHAR
+           , const char *decimal, size_t decimal_len, const char *thousands
+ #endif
+@@ -337,7 +342,7 @@ str_to_mpn (const STRING_TYPE *str, int
+     }
+   while (--digcnt > 0);
+-  if (*exponent > 0 && cnt + *exponent <= MAX_DIG_PER_LIMB)
++  if (*exponent > 0 && *exponent <= MAX_DIG_PER_LIMB - cnt)
+     {
+       low *= _tens_in_limb[*exponent];
+       start = _tens_in_limb[cnt + *exponent];
+@@ -415,7 +420,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+ {
+   int negative;                       /* The sign of the number.  */
+   MPN_VAR (num);              /* MP representation of the number.  */
+-  int exponent;                       /* Exponent of the number.  */
++  intmax_t exponent;          /* Exponent of the number.  */
+   /* Numbers starting `0X' or `0x' have to be processed with base 16.  */
+   int base = 10;
+@@ -437,7 +442,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+   /* Points at the character following the integer and fractional digits.  */
+   const STRING_TYPE *expp;
+   /* Total number of digit and number of digits in integer part.  */
+-  int dig_no, int_no, lead_zero;
++  size_t dig_no, int_no, lead_zero;
+   /* Contains the last character read.  */
+   CHAR_TYPE c;
+@@ -769,7 +774,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+      are all or any is really a fractional digit will be decided
+      later.  */
+   int_no = dig_no;
+-  lead_zero = int_no == 0 ? -1 : 0;
++  lead_zero = int_no == 0 ? (size_t) -1 : 0;
+   /* Read the fractional digits.  A special case are the 'american
+      style' numbers like `16.' i.e. with decimal point but without
+@@ -791,12 +796,13 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+            (base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
+                              lo >= L_('a') && lo <= L_('f'); })))
+       {
+-        if (c != L_('0') && lead_zero == -1)
++        if (c != L_('0') && lead_zero == (size_t) -1)
+           lead_zero = dig_no - int_no;
+         ++dig_no;
+         c = *++cp;
+       }
+     }
++  assert (dig_no <= (uintmax_t) INTMAX_MAX);
+   /* Remember start of exponent (if any).  */
+   expp = cp;
+@@ -819,24 +825,80 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+       if (c >= L_('0') && c <= L_('9'))
+       {
+-        int exp_limit;
++        intmax_t exp_limit;
+         /* Get the exponent limit. */
+         if (base == 16)
+-          exp_limit = (exp_negative ?
+-                       -MIN_EXP + MANT_DIG + 4 * int_no :
+-                       MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
++          {
++            if (exp_negative)
++              {
++                assert (int_no <= (uintmax_t) (INTMAX_MAX
++                                               + MIN_EXP - MANT_DIG) / 4);
++                exp_limit = -MIN_EXP + MANT_DIG + 4 * (intmax_t) int_no;
++              }
++            else
++              {
++                if (int_no)
++                  {
++                    assert (lead_zero == 0
++                            && int_no <= (uintmax_t) INTMAX_MAX / 4);
++                    exp_limit = MAX_EXP - 4 * (intmax_t) int_no + 3;
++                  }
++                else if (lead_zero == (size_t) -1)
++                  {
++                    /* The number is zero and this limit is
++                       arbitrary.  */
++                    exp_limit = MAX_EXP + 3;
++                  }
++                else
++                  {
++                    assert (lead_zero
++                            <= (uintmax_t) (INTMAX_MAX - MAX_EXP - 3) / 4);
++                    exp_limit = (MAX_EXP
++                                 + 4 * (intmax_t) lead_zero
++                                 + 3);
++                  }
++              }
++          }
+         else
+-          exp_limit = (exp_negative ?
+-                       -MIN_10_EXP + MANT_DIG + int_no :
+-                       MAX_10_EXP - int_no + lead_zero + 1);
++          {
++            if (exp_negative)
++              {
++                assert (int_no
++                        <= (uintmax_t) (INTMAX_MAX + MIN_10_EXP - MANT_DIG));
++                exp_limit = -MIN_10_EXP + MANT_DIG + (intmax_t) int_no;
++              }
++            else
++              {
++                if (int_no)
++                  {
++                    assert (lead_zero == 0
++                            && int_no <= (uintmax_t) INTMAX_MAX);
++                    exp_limit = MAX_10_EXP - (intmax_t) int_no + 1;
++                  }
++                else if (lead_zero == (size_t) -1)
++                  {
++                    /* The number is zero and this limit is
++                       arbitrary.  */
++                    exp_limit = MAX_10_EXP + 1;
++                  }
++                else
++                  {
++                    assert (lead_zero
++                            <= (uintmax_t) (INTMAX_MAX - MAX_10_EXP - 1));
++                    exp_limit = MAX_10_EXP + (intmax_t) lead_zero + 1;
++                  }
++              }
++          }
++
++        if (exp_limit < 0)
++          exp_limit = 0;
+         do
+           {
+-            exponent *= 10;
+-            exponent += c - L_('0');
+-
+-            if (__builtin_expect (exponent > exp_limit, 0))
++            if (__builtin_expect ((exponent > exp_limit / 10
++                                  || (exponent == exp_limit / 10
++                                      && c - L_('0') > exp_limit % 10)), 0))
+               /* The exponent is too large/small to represent a valid
+                  number.  */
+               {
+@@ -845,7 +907,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+                 /* We have to take care for special situation: a joker
+                    might have written "0.0e100000" which is in fact
+                    zero.  */
+-                if (lead_zero == -1)
++                if (lead_zero == (size_t) -1)
+                   result = negative ? -0.0 : 0.0;
+                 else
+                   {
+@@ -864,6 +926,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+                 /* NOTREACHED */
+               }
++            exponent *= 10;
++            exponent += c - L_('0');
++
+             c = *++cp;
+           }
+         while (c >= L_('0') && c <= L_('9'));
+@@ -932,7 +997,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+       }
+ #endif
+       startp += lead_zero + decimal_len;
+-      exponent -= base == 16 ? 4 * lead_zero : lead_zero;
++      assert (lead_zero <= (base == 16
++                          ? (uintmax_t) INTMAX_MAX / 4
++                          : (uintmax_t) INTMAX_MAX));
++      assert (lead_zero <= (base == 16
++                          ? ((uintmax_t) exponent
++                             - (uintmax_t) INTMAX_MIN) / 4
++                          : ((uintmax_t) exponent - (uintmax_t) INTMAX_MIN)));
++      exponent -= base == 16 ? 4 * (intmax_t) lead_zero : (intmax_t) lead_zero;
+       dig_no -= lead_zero;
+     }
+@@ -974,7 +1046,10 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+       }
+       /* Adjust the exponent for the bits we are shifting in.  */
+-      exponent += bits - 1 + (int_no - 1) * 4;
++      assert (int_no <= (uintmax_t) (exponent < 0
++                                   ? (INTMAX_MAX - bits + 1) / 4
++                                   : (INTMAX_MAX - exponent - bits + 1) / 4));
++      exponent += bits - 1 + ((intmax_t) int_no - 1) * 4;
+       while (--dig_no > 0 && idx >= 0)
+       {
+@@ -1014,13 +1089,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+      really integer digits or belong to the fractional part; i.e. we normalize
+      123e-2 to 1.23.  */
+   {
+-    register int incr = (exponent < 0 ? MAX (-int_no, exponent)
+-                       : MIN (dig_no - int_no, exponent));
++    register intmax_t incr = (exponent < 0
++                            ? MAX (-(intmax_t) int_no, exponent)
++                            : MIN ((intmax_t) dig_no - (intmax_t) int_no,
++                                   exponent));
+     int_no += incr;
+     exponent -= incr;
+   }
+-  if (__builtin_expect (int_no + exponent > MAX_10_EXP + 1, 0))
++  if (__builtin_expect (exponent > MAX_10_EXP + 1 - (intmax_t) int_no, 0))
+     {
+       __set_errno (ERANGE);
+       return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
+@@ -1205,7 +1282,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+        digits we should have enough bits for the result.  The remaining
+        decimal digits give us the information that more bits are following.
+        This can be used while rounding.  (Two added as a safety margin.)  */
+-    if (dig_no - int_no > (MANT_DIG - bits + 2) / 3 + 2)
++    if ((intmax_t) dig_no > (intmax_t) int_no + (MANT_DIG - bits + 2) / 3 + 2)
+       {
+       dig_no = int_no + (MANT_DIG - bits + 2) / 3 + 2;
+       more_bits = 1;
+@@ -1213,7 +1290,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+     else
+       more_bits = 0;
+-    neg_exp = dig_no - int_no - exponent;
++    neg_exp = (intmax_t) dig_no - (intmax_t) int_no - exponent;
+     /* Construct the denominator.  */
+     densize = 0;
+@@ -1491,7 +1568,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+                         register int i;
+                         (void) __mpn_lshift (&retval[used
+                                                      / BITS_PER_MP_LIMB],
+-                                             retval, RETURN_LIMB_SIZE,
++                                             retval,
++                                             (RETURN_LIMB_SIZE
++                                              - used / BITS_PER_MP_LIMB),
+                                              used % BITS_PER_MP_LIMB);
+                         for (i = used / BITS_PER_MP_LIMB - 1; i >= 0; --i)
+                           retval[i] = 0;
+diff -Nrup a/stdlib/tst-strtod-overflow.c b/stdlib/tst-strtod-overflow.c
+--- a/stdlib/tst-strtod-overflow.c     1969-12-31 17:00:00.000000000 -0700
++++ b/stdlib/tst-strtod-overflow.c     2012-08-15 09:25:01.098592764 -0600
+@@ -0,0 +1,48 @@
++/* Test for integer/buffer overflow in strtod.
++   Copyright (C) 2012 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define EXPONENT "e-2147483649"
++#define SIZE 214748364
++
++static int
++do_test (void)
++{
++  char *p = malloc (1 + SIZE + sizeof (EXPONENT));
++  if (p == NULL)
++    {
++      puts ("malloc failed, cannot test for overflow");
++      return 0;
++    }
++  p[0] = '1';
++  memset (p + 1, '0', SIZE);
++  memcpy (p + 1 + SIZE, EXPONENT, sizeof (EXPONENT));
++  double d = strtod (p, NULL);
++  if (d != 0)
++    {
++      printf ("strtod returned wrong value: %a\n", d);
++      return 1;
++    }
++  return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
diff --git a/src/patches/glibc/glibc-rh848082.patch b/src/patches/glibc/glibc-rh848082.patch
new file mode 100644 (file)
index 0000000..dfb96bf
--- /dev/null
@@ -0,0 +1,88 @@
+commit 4f031072a5055abd83717820b59efdaa463d5853
+Author: Ulrich Drepper <drepper@gmail.com>
+Date:   Sat May 28 16:59:30 2011 -0400
+
+    Handle failure of _nl_explode_name in all cases
+
+ 2011-05-28  Ulrich Drepper  <drepper@gmail.com>
+       * locale/findlocale.c (_nl_find_locale): Return right away if
+       _nl_explode_name failed.
+       * locale/programs/locarchive.c (add_locale_to_archive): Likewise.
+
+diff --git a/locale/findlocale.c b/locale/findlocale.c
+index 6b88c96..2fec9a7 100644
+--- a/locale/findlocale.c
++++ b/locale/findlocale.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1996-2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
++/* Copyright (C) 1996-2003, 2006, 2010, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+@@ -140,6 +140,9 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
+    */
+   mask = _nl_explode_name (loc_name, &language, &modifier, &territory,
+                          &codeset, &normalized_codeset);
++  if (mask == -1)
++    /* Memory allocate problem.  */
++    return NULL;
+   /* If exactly this locale was already asked for we have an entry with
+      the complete name.  */
+diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
+index 85ba77d..e95bcf1 100644
+--- a/locale/programs/locarchive.c
++++ b/locale/programs/locarchive.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 2002,2003,2005,2007,2009,2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+@@ -1079,6 +1079,8 @@ add_locale_to_archive (ah, name, data, replace)
+   int mask = _nl_explode_name (strdupa (name),
+                              &language, &modifier, &territory,
+                              &codeset, &normalized_codeset);
++  if (mask == -1)
++    return -1;
+   if (mask & XPG_NORM_CODESET)
+     /* This name contains a codeset in unnormalized form.
+@@ -1128,6 +1130,7 @@ add_locale_to_archive (ah, name, data, replace)
+   /* Now read the locale.alias files looking for lines whose
+      right hand side matches our name after normalization.  */
++  int result = 0;
+   if (alias_file != NULL)
+     {
+       FILE *fp;
+@@ -1207,6 +1210,11 @@ add_locale_to_archive (ah, name, data, replace)
+                                                    &rhs_territory,
+                                                    &rhs_codeset,
+                                                    &rhs_normalized_codeset);
++                  if (rhs_mask == 1)
++                    {
++                      result = -1;
++                      goto out;
++                    }
+                   if (!strcmp (language, rhs_language)
+                       && ((rhs_mask & XPG_CODESET)
+                           /* He has a codeset, it must match normalized.  */
+@@ -1240,6 +1248,7 @@ add_locale_to_archive (ah, name, data, replace)
+           }
+       }
++    out:
+       fclose (fp);
+     }
+@@ -1248,7 +1257,7 @@ add_locale_to_archive (ah, name, data, replace)
+   if (mask & XPG_NORM_CODESET)
+     free ((char *) normalized_codeset);
+-  return 0;
++  return result;
+ }
diff --git a/src/patches/glibc/glibc-rh849203.patch b/src/patches/glibc/glibc-rh849203.patch
new file mode 100644 (file)
index 0000000..ea50593
--- /dev/null
@@ -0,0 +1,195 @@
+diff -Nrup a/intl/Makefile b/intl/Makefile
+--- a/intl/Makefile    2010-05-04 05:27:23.000000000 -0600
++++ b/intl/Makefile    2012-08-17 14:40:00.457226629 -0600
+@@ -74,6 +74,16 @@ ifneq (no,$(PERL))
+ tests: $(objpfx)mtrace-tst-gettext
+ endif
+ endif
++
++# Multiple tests use this data.  Create it once to avoid racing and
++# spurious test failures.
++codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo
++
++$(codeset_mo):
++      $(make-target-directory)
++      msgfmt -o $@T tstcodeset.po
++      mv -f $@T $@
++
+ $(objpfx)mtrace-tst-gettext: $(objpfx)tst-gettext.out
+       $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@
+ $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext
+@@ -83,16 +93,14 @@ $(objpfx)tst-translit.out: tst-translit.
+       $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
+ $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2
+       $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
+-$(objpfx)tst-codeset.out: tst-codeset.sh $(objpfx)tst-codeset
+-      $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
+-$(objpfx)tst-gettext3.out: tst-gettext3.sh $(objpfx)tst-gettext3
+-      $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
+ $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4
+       $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
+-$(objpfx)tst-gettext5.out: tst-gettext5.sh $(objpfx)tst-gettext5
+-      $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
+ $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6
+       $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(common-objpfx)intl/
++
++$(objpfx)tst-codeset.out: $(codeset_mo)
++$(objpfx)tst-gettext3.out: $(codeset_mo)
++$(objpfx)tst-gettext5.out: $(codeset_mo)
+ endif
+ endif
+@@ -109,6 +117,11 @@ CFLAGS-tst-gettext4.c = -DOBJPFX=\"$(obj
+ CFLAGS-tst-gettext5.c = -DOBJPFX=\"$(objpfx)\"
+ CFLAGS-tst-gettext6.c = -DOBJPFX=\"$(objpfx)\"
++LOCPATH-ENV = LOCPATH=$(common-objpfx)localedata
++tst-codeset-ENV = $(LOCPATH-ENV)
++tst-gettext3-ENV = $(LOCPATH-ENV)
++tst-gettext5-ENV = $(LOCPATH-ENV)
++
+ ifeq ($(have-thread-library),yes)
+ ifeq (yes,$(build-shared))
+ $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library)
+diff -Nrup a/intl/tst-codeset.sh b/intl/tst-codeset.sh
+--- a/intl/tst-codeset.sh      2010-05-04 05:27:23.000000000 -0600
++++ b/intl/tst-codeset.sh      1969-12-31 17:00:00.000000000 -0700
+@@ -1,43 +0,0 @@
+-#! /bin/sh
+-# Test of bind_textdomain_codeset.
+-# Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+-# This file is part of the GNU C Library.
+-#
+-
+-# The GNU C Library is free software; you can redistribute it and/or
+-# modify it under the terms of the GNU Lesser General Public
+-# License as published by the Free Software Foundation; either
+-# version 2.1 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
+-# Lesser General Public License for more details.
+-
+-# You should have received a copy of the GNU Lesser General Public
+-# License along with the GNU C Library; if not, write to the Free
+-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-# 02111-1307 USA.
+-
+-common_objpfx=$1
+-objpfx=$2
+-
+-LC_ALL=C
+-export LC_ALL
+-
+-# Generate the test data.
+-msgfmt -o ${objpfx}codeset.mo.$$ tstcodeset.po || exit
+-# Create the domain directories.
+-mkdir -p ${objpfx}domaindir/de_DE/LC_MESSAGES
+-# Populate them.
+-mv -f ${objpfx}codeset.mo.$$ ${objpfx}domaindir/de_DE/LC_MESSAGES/codeset.mo
+-
+-GCONV_PATH=${common_objpfx}iconvdata
+-export GCONV_PATH
+-LOCPATH=${common_objpfx}localedata
+-export LOCPATH
+-
+-${common_objpfx}elf/ld.so --library-path $common_objpfx \
+-${objpfx}tst-codeset > ${objpfx}tst-codeset.out
+-
+-exit $?
+diff -Nrup a/intl/tst-gettext3.sh b/intl/tst-gettext3.sh
+--- a/intl/tst-gettext3.sh     2010-05-04 05:27:23.000000000 -0600
++++ b/intl/tst-gettext3.sh     1969-12-31 17:00:00.000000000 -0700
+@@ -1,44 +0,0 @@
+-#! /bin/sh
+-# Test that the gettext() results come out in the correct encoding for
+-# locales that differ only in their encoding.
+-# Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+-# This file is part of the GNU C Library.
+-#
+-
+-# The GNU C Library is free software; you can redistribute it and/or
+-# modify it under the terms of the GNU Lesser General Public
+-# License as published by the Free Software Foundation; either
+-# version 2.1 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
+-# Lesser General Public License for more details.
+-
+-# You should have received a copy of the GNU Lesser General Public
+-# License along with the GNU C Library; if not, write to the Free
+-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-# 02111-1307 USA.
+-
+-common_objpfx=$1
+-objpfx=$2
+-
+-LC_ALL=C
+-export LC_ALL
+-
+-# Generate the test data.
+-msgfmt -o ${objpfx}codeset.mo.$$ tstcodeset.po || exit
+-# Create the domain directories.
+-mkdir -p ${objpfx}domaindir/de_DE/LC_MESSAGES
+-# Populate them.
+-mv -f ${objpfx}codeset.mo.$$ ${objpfx}domaindir/de_DE/LC_MESSAGES/codeset.mo
+-
+-GCONV_PATH=${common_objpfx}iconvdata
+-export GCONV_PATH
+-LOCPATH=${common_objpfx}localedata
+-export LOCPATH
+-
+-${common_objpfx}elf/ld.so --library-path $common_objpfx \
+-${objpfx}tst-gettext3 > ${objpfx}tst-gettext3.out
+-
+-exit $?
+diff -Nrup a/intl/tst-gettext5.sh b/intl/tst-gettext5.sh
+--- a/intl/tst-gettext5.sh     2010-05-04 05:27:23.000000000 -0600
++++ b/intl/tst-gettext5.sh     1969-12-31 17:00:00.000000000 -0700
+@@ -1,43 +0,0 @@
+-#! /bin/sh
+-# Test that gettext() in multithreaded applications works correctly if
+-# different threads operate in different locales referring to the same
+-# catalog file but with different encodings.
+-# Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+-# This file is part of the GNU C Library.
+-#
+-
+-# The GNU C Library is free software; you can redistribute it and/or
+-# modify it under the terms of the GNU Lesser General Public
+-# License as published by the Free Software Foundation; either
+-# version 2.1 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
+-# Lesser General Public License for more details.
+-
+-# You should have received a copy of the GNU Lesser General Public
+-# License along with the GNU C Library; if not, write to the Free
+-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-# 02111-1307 USA.
+-
+-common_objpfx=$1
+-run_program_prefix=$2
+-objpfx=$3
+-
+-LC_ALL=C
+-export LC_ALL
+-
+-# Create the domain directories.
+-mkdir -p ${objpfx}domaindir/de_DE/LC_MESSAGES
+-# Populate them.
+-msgfmt -o ${objpfx}domaindir/de_DE/LC_MESSAGES/codeset.mo tstcodeset.po
+-
+-GCONV_PATH=${common_objpfx}iconvdata
+-export GCONV_PATH
+-LOCPATH=${common_objpfx}localedata
+-export LOCPATH
+-
+-${run_program_prefix} ${objpfx}tst-gettext5 > ${objpfx}tst-gettext5.out
+-
+-exit $?
diff --git a/src/patches/glibc/glibc-rh849651.patch b/src/patches/glibc/glibc-rh849651.patch
new file mode 100644 (file)
index 0000000..97a5144
--- /dev/null
@@ -0,0 +1,343 @@
+diff -Nrup a/sysdeps/x86_64/fpu/e_expf.S b/sysdeps/x86_64/fpu/e_expf.S
+--- a/sysdeps/x86_64/fpu/e_expf.S      1969-12-31 17:00:00.000000000 -0700
++++ b/sysdeps/x86_64/fpu/e_expf.S      2012-08-20 09:47:15.551971545 -0600
+@@ -0,0 +1,339 @@
++/* Optimized __ieee754_expf function.
++   Copyright (C) 2012 Free Software Foundation, Inc.
++   Contributed by Intel Corporation.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <sysdep.h>
++
++/* Short algorithm description:
++ *
++ *  Let K = 64 (table size).
++ *       e^x  = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
++ *  where
++ *       x = m*log(2)/K + y,    y in [0.0..log(2)/K]
++ *       m = n*K + j,           m,n,j - signed integer, j in [0..K-1]
++ *       values of 2^(j/K) are tabulated as T[j].
++ *
++ *       P(y) is a minimax polynomial approximation of expf(x)-1
++ *       on small interval [0.0..log(2)/K].
++ *
++ *       P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
++ *       z = y*y;    P(y) = (P3*z + P1)*z + (P2*z + P0)*y
++ *
++ * Special cases:
++ *  expf(NaN) = NaN
++ *  expf(+INF) = +INF
++ *  expf(-INF) = 0
++ *  expf(x) = 1 for subnormals
++ *  for finite argument, only expf(0)=1 is exact
++ *  expf(x) overflows if x>88.7228317260742190
++ *  expf(x) underflows if x<-103.972076416015620
++ */
++
++      .text
++ENTRY(__ieee754_expf)
++      /* Input: single precision x in %xmm0 */
++      cvtss2sd        %xmm0, %xmm1    /* Convert x to double precision */
++      movd    %xmm0, %ecx             /* Copy x */
++      movsd   L(DP_KLN2)(%rip), %xmm2 /* DP K/log(2) */
++      movsd   L(DP_P2)(%rip), %xmm3   /* DP P2 */
++      movl    %ecx, %eax              /* x */
++      mulsd   %xmm1, %xmm2            /* DP x*K/log(2) */
++      andl    $0x7fffffff, %ecx       /* |x| */
++      lea     L(DP_T)(%rip), %rsi     /* address of table T[j] */
++      cmpl    $0x42ad496b, %ecx       /* |x|<125*log(2) ? */
++      movsd   L(DP_P3)(%rip), %xmm4   /* DP P3 */
++      addsd   L(DP_RS)(%rip), %xmm2   /* DP x*K/log(2)+RS */
++      jae     L(special_paths)
++
++      /* Here if |x|<125*log(2) */
++      cmpl    $0x31800000, %ecx       /* |x|<2^(-28) ? */
++      jb      L(small_arg)
++
++      /* Main path: here if 2^(-28)<=|x|<125*log(2) */
++      cvtsd2ss        %xmm2, %xmm2    /* SP x*K/log(2)+RS */
++      movd    %xmm2, %eax             /* bits of n*K+j with trash */
++      subss   L(SP_RS)(%rip), %xmm2   /* SP t=round(x*K/log(2)) */
++      movl    %eax, %edx              /* n*K+j with trash */
++      cvtss2sd        %xmm2, %xmm2    /* DP t */
++      andl    $0x3f, %eax             /* bits of j */
++      mulsd   L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
++      andl    $0xffffffc0, %edx       /* bits of n */
++#ifdef __AVX__
++      vaddsd  %xmm1, %xmm2, %xmm0     /* DP y=x-t*log(2)/K */
++      vmulsd  %xmm0, %xmm0, %xmm2     /* DP z=y*y */
++#else
++      addsd   %xmm1, %xmm2            /* DP y=x-t*log(2)/K */
++      movaps  %xmm2, %xmm0            /* DP y */
++      mulsd   %xmm2, %xmm2            /* DP z=y*y */
++#endif
++      mulsd   %xmm2, %xmm4            /* DP P3*z */
++      addl    $0x1fc0, %edx           /* bits of n + SP exponent bias */
++      mulsd   %xmm2, %xmm3            /* DP P2*z */
++      shll    $17, %edx               /* SP 2^n */
++      addsd   L(DP_P1)(%rip), %xmm4   /* DP P3*z+P1 */
++      addsd   L(DP_P0)(%rip), %xmm3   /* DP P2*z+P0 */
++      movd    %edx, %xmm1             /* SP 2^n */
++      mulsd   %xmm2, %xmm4            /* DP (P3*z+P1)*z */
++      mulsd   %xmm3, %xmm0            /* DP (P2*z+P0)*y */
++      addsd   %xmm4, %xmm0            /* DP P(y) */
++      mulsd   (%rsi,%rax,8), %xmm0    /* DP P(y)*T[j] */
++      addsd   (%rsi,%rax,8), %xmm0    /* DP T[j]*(P(y)+1) */
++      cvtsd2ss        %xmm0, %xmm0    /* SP T[j]*(P(y)+1) */
++      mulss   %xmm1, %xmm0            /* SP result=2^n*(T[j]*(P(y)+1)) */
++      ret
++
++      .p2align        4
++L(small_arg):
++      /* Here if 0<=|x|<2^(-28) */
++      addss   L(SP_ONE)(%rip), %xmm0  /* 1.0 + x */
++      /* Return 1.0 with inexact raised, except for x==0 */
++      ret
++
++      .p2align        4
++L(special_paths):
++      /* Here if 125*log(2)<=|x| */
++      shrl    $31, %eax               /* Get sign bit of x, and depending on it: */
++      lea     L(SP_RANGE)(%rip), %rdx /* load over/underflow bound */
++      cmpl    (%rdx,%rax,4), %ecx     /* |x|<under/overflow bound ? */
++      jbe     L(near_under_or_overflow)
++
++      /* Here if |x|>under/overflow bound */
++      cmpl    $0x7f800000, %ecx       /* |x| is finite ? */
++      jae     L(arg_inf_or_nan)
++
++      /* Here if |x|>under/overflow bound, and x is finite */
++      testq   %rax, %rax              /* sign of x nonzero ? */
++      je      L(res_overflow)
++
++      /* Here if -inf<x<underflow bound (x<0) */
++      movss   L(SP_SMALL)(%rip), %xmm0/* load small value 2^(-100) */
++      mulss   %xmm0, %xmm0            /* Return underflowed result (zero or subnormal) */
++      ret
++
++      .p2align        4
++L(res_overflow):
++      /* Here if overflow bound<x<inf (x>0) */
++      movss   L(SP_LARGE)(%rip), %xmm0/* load large value 2^100 */
++      mulss   %xmm0, %xmm0            /* Return overflowed result (Inf or max normal) */
++      ret
++
++      .p2align        4
++L(arg_inf_or_nan):
++      /* Here if |x| is Inf or NAN */
++      jne     L(arg_nan)      /* |x| is Inf ? */
++
++      /* Here if |x| is Inf */
++      lea     L(SP_INF_0)(%rip), %rdx /* depending on sign of x: */
++      movss   (%rdx,%rax,4), %xmm0    /* return zero or Inf */
++      ret
++
++      .p2align        4
++L(arg_nan):
++      /* Here if |x| is NaN */
++      addss   %xmm0, %xmm0            /* Return x+x (raise invalid) */
++      ret
++
++      .p2align        4
++L(near_under_or_overflow):
++      /* Here if 125*log(2)<=|x|<under/overflow bound */
++      cvtsd2ss        %xmm2, %xmm2    /* SP x*K/log(2)+RS */
++      movd    %xmm2, %eax             /* bits of n*K+j with trash */
++      subss   L(SP_RS)(%rip), %xmm2   /* SP t=round(x*K/log(2)) */
++      movl    %eax, %edx              /* n*K+j with trash */
++      cvtss2sd        %xmm2, %xmm2    /* DP t */
++      andl    $0x3f, %eax             /* bits of j */
++      mulsd   L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
++      andl    $0xffffffc0, %edx       /* bits of n */
++#ifdef __AVX__
++      vaddsd  %xmm1, %xmm2, %xmm0     /* DP y=x-t*log(2)/K */
++      vmulsd  %xmm0, %xmm0, %xmm2     /* DP z=y*y */
++#else
++      addsd   %xmm1, %xmm2            /* DP y=x-t*log(2)/K */
++      movaps  %xmm2, %xmm0            /* DP y */
++      mulsd   %xmm2, %xmm2            /* DP z=y*y */
++#endif
++      mulsd   %xmm2, %xmm4            /* DP P3*z */
++      addl    $0xffc0, %edx           /* bits of n + DP exponent bias */
++      mulsd   %xmm2, %xmm3            /* DP P2*z */
++      shlq    $46, %rdx               /* DP 2^n */
++      addsd   L(DP_P1)(%rip), %xmm4   /* DP P3*z+P1 */
++      addsd   L(DP_P0)(%rip), %xmm3   /* DP P2*z+P0 */
++      movd    %rdx, %xmm1             /* DP 2^n */
++      mulsd   %xmm2, %xmm4            /* DP (P3*z+P1)*z */
++      mulsd   %xmm3, %xmm0            /* DP (P2*z+P0)*y */
++      addsd   %xmm4, %xmm0            /* DP P(y) */
++      mulsd   (%rsi,%rax,8), %xmm0    /* DP P(y)*T[j] */
++      addsd   (%rsi,%rax,8), %xmm0    /* DP T[j]*(P(y)+1) */
++      mulsd   %xmm1, %xmm0            /* DP result=2^n*(T[j]*(P(y)+1)) */
++      cvtsd2ss        %xmm0, %xmm0    /* convert result to single precision */
++      ret
++END(__ieee754_expf)
++
++      .section .rodata, "a"
++      .p2align 3
++L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
++      .long   0x00000000, 0x3ff00000
++      .long   0x3e778061, 0x3ff02c9a
++      .long   0xd3158574, 0x3ff059b0
++      .long   0x18759bc8, 0x3ff08745
++      .long   0x6cf9890f, 0x3ff0b558
++      .long   0x32d3d1a2, 0x3ff0e3ec
++      .long   0xd0125b51, 0x3ff11301
++      .long   0xaea92de0, 0x3ff1429a
++      .long   0x3c7d517b, 0x3ff172b8
++      .long   0xeb6fcb75, 0x3ff1a35b
++      .long   0x3168b9aa, 0x3ff1d487
++      .long   0x88628cd6, 0x3ff2063b
++      .long   0x6e756238, 0x3ff2387a
++      .long   0x65e27cdd, 0x3ff26b45
++      .long   0xf51fdee1, 0x3ff29e9d
++      .long   0xa6e4030b, 0x3ff2d285
++      .long   0x0a31b715, 0x3ff306fe
++      .long   0xb26416ff, 0x3ff33c08
++      .long   0x373aa9cb, 0x3ff371a7
++      .long   0x34e59ff7, 0x3ff3a7db
++      .long   0x4c123422, 0x3ff3dea6
++      .long   0x21f72e2a, 0x3ff4160a
++      .long   0x6061892d, 0x3ff44e08
++      .long   0xb5c13cd0, 0x3ff486a2
++      .long   0xd5362a27, 0x3ff4bfda
++      .long   0x769d2ca7, 0x3ff4f9b2
++      .long   0x569d4f82, 0x3ff5342b
++      .long   0x36b527da, 0x3ff56f47
++      .long   0xdd485429, 0x3ff5ab07
++      .long   0x15ad2148, 0x3ff5e76f
++      .long   0xb03a5585, 0x3ff6247e
++      .long   0x82552225, 0x3ff66238
++      .long   0x667f3bcd, 0x3ff6a09e
++      .long   0x3c651a2f, 0x3ff6dfb2
++      .long   0xe8ec5f74, 0x3ff71f75
++      .long   0x564267c9, 0x3ff75feb
++      .long   0x73eb0187, 0x3ff7a114
++      .long   0x36cf4e62, 0x3ff7e2f3
++      .long   0x994cce13, 0x3ff82589
++      .long   0x9b4492ed, 0x3ff868d9
++      .long   0x422aa0db, 0x3ff8ace5
++      .long   0x99157736, 0x3ff8f1ae
++      .long   0xb0cdc5e5, 0x3ff93737
++      .long   0x9fde4e50, 0x3ff97d82
++      .long   0x82a3f090, 0x3ff9c491
++      .long   0x7b5de565, 0x3ffa0c66
++      .long   0xb23e255d, 0x3ffa5503
++      .long   0x5579fdbf, 0x3ffa9e6b
++      .long   0x995ad3ad, 0x3ffae89f
++      .long   0xb84f15fb, 0x3ffb33a2
++      .long   0xf2fb5e47, 0x3ffb7f76
++      .long   0x904bc1d2, 0x3ffbcc1e
++      .long   0xdd85529c, 0x3ffc199b
++      .long   0x2e57d14b, 0x3ffc67f1
++      .long   0xdcef9069, 0x3ffcb720
++      .long   0x4a07897c, 0x3ffd072d
++      .long   0xdcfba487, 0x3ffd5818
++      .long   0x03db3285, 0x3ffda9e6
++      .long   0x337b9b5f, 0x3ffdfc97
++      .long   0xe78b3ff6, 0x3ffe502e
++      .long   0xa2a490da, 0x3ffea4af
++      .long   0xee615a27, 0x3ffefa1b
++      .long   0x5b6e4540, 0x3fff5076
++      .long   0x819e90d8, 0x3fffa7c1
++      .type L(DP_T), @object
++      ASM_SIZE_DIRECTIVE(L(DP_T))
++
++      .section .rodata.cst8,"aM",@progbits,8
++      .p2align 3
++L(DP_KLN2): /* double precision K/log(2) */
++      .long   0x652b82fe, 0x40571547
++      .type L(DP_KLN2), @object
++      ASM_SIZE_DIRECTIVE(L(DP_KLN2))
++
++      .p2align 3
++L(DP_NLN2K): /* double precision -log(2)/K */
++      .long   0xfefa39ef, 0xbf862e42
++      .type L(DP_NLN2K), @object
++      ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
++
++      .p2align 3
++L(DP_RS): /* double precision 2^23+2^22 */
++      .long   0x00000000, 0x41680000
++      .type L(DP_RS), @object
++      ASM_SIZE_DIRECTIVE(L(DP_RS))
++
++      .p2align 3
++L(DP_P3): /* double precision polynomial coefficient P3 */
++      .long   0xeb78fa85, 0x3fa56420
++      .type L(DP_P3), @object
++      ASM_SIZE_DIRECTIVE(L(DP_P3))
++
++      .p2align 3
++L(DP_P1): /* double precision polynomial coefficient P1 */
++      .long   0x008d6118, 0x3fe00000
++      .type L(DP_P1), @object
++      ASM_SIZE_DIRECTIVE(L(DP_P1))
++
++      .p2align 3
++L(DP_P2): /* double precision polynomial coefficient P2 */
++      .long   0xda752d4f, 0x3fc55550
++      .type L(DP_P2), @object
++      ASM_SIZE_DIRECTIVE(L(DP_P2))
++
++      .p2align 3
++L(DP_P0): /* double precision polynomial coefficient P0 */
++      .long   0xffffe7c6, 0x3fefffff
++      .type L(DP_P0), @object
++      ASM_SIZE_DIRECTIVE(L(DP_P0))
++
++      .p2align 2
++L(SP_RANGE): /* single precision overflow/underflow bounds */
++      .long   0x42b17217      /* if x>this bound, then result overflows */
++      .long   0x42cff1b4      /* if x<this bound, then result underflows */
++      .type L(SP_RANGE), @object
++      ASM_SIZE_DIRECTIVE(L(SP_RANGE))
++
++      .p2align 2
++L(SP_INF_0):
++      .long   0x7f800000      /* single precision Inf */
++      .long   0               /* single precision zero */
++      .type L(SP_INF_0), @object
++      ASM_SIZE_DIRECTIVE(L(SP_INF_0))
++
++      .section .rodata.cst4,"aM",@progbits,4
++      .p2align 2
++L(SP_RS): /* single precision 2^23+2^22 */
++      .long   0x4b400000
++      .type L(SP_RS), @object
++      ASM_SIZE_DIRECTIVE(L(SP_RS))
++
++      .p2align 2
++L(SP_SMALL): /* single precision small value 2^(-100) */
++      .long   0x0d800000
++      .type L(SP_SMALL), @object
++      ASM_SIZE_DIRECTIVE(L(SP_SMALL))
++
++      .p2align 2
++L(SP_LARGE): /* single precision large value 2^100 */
++      .long   0x71800000
++      .type L(SP_LARGE), @object
++      ASM_SIZE_DIRECTIVE(L(SP_LARGE))
++
++      .p2align 2
++L(SP_ONE): /* single precision 1.0 */
++      .long   0x3f800000
++      .type L(SP_ONE), @object
++      ASM_SIZE_DIRECTIVE(L(SP_ONE))
++
++strong_alias (__ieee754_expf, __expf_finite)
diff --git a/src/patches/glibc/glibc-rh852445.patch b/src/patches/glibc/glibc-rh852445.patch
new file mode 100644 (file)
index 0000000..3c4e13f
--- /dev/null
@@ -0,0 +1,105 @@
+From libc-alpha-return-31329-listarch-libc-alpha=sources dot redhat dot com at sourceware dot org Wed Jul 11 11:36:39 2012
+Return-Path: <libc-alpha-return-31329-listarch-libc-alpha=sources dot redhat dot com at sourceware dot org>
+Delivered-To: listarch-libc-alpha at sources dot redhat dot com
+Received: (qmail 15677 invoked by alias); 11 Jul 2012 11:36:39 -0000
+Received: (qmail 15654 invoked by uid 22791); 11 Jul 2012 11:36:37 -0000
+X-SWARE-Spam-Status: No, hits=-4.3 required=5.0
+       tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
+X-Spam-Check-By: sourceware.org
+Date: Wed, 11 Jul 2012 21:06:06 +0930
+From: Alan Modra <amodra at gmail dot com>
+To: libc-alpha at sourceware dot org
+Cc: rsa at linux dot vnet dot ibm dot com
+Subject: powerpc pthread_once bug fix
+Message-ID: <20120711113606.GM3117@bubble.grove.modra.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+User-Agent: Mutt/1.5.21 (2010-09-15)
+Mailing-List: contact libc-alpha-help at sourceware dot org; run by ezmlm
+Precedence: bulk
+List-Id: <libc-alpha.sourceware.org>
+List-Subscribe: <mailto:libc-alpha-subscribe at sourceware dot org>
+List-Archive: <http://sourceware.org/ml/libc-alpha/>
+List-Post: <mailto:libc-alpha at sourceware dot org>
+List-Help: <mailto:libc-alpha-help at sourceware dot org>, <http://sourceware dot org/ml/#faqs>
+Sender: libc-alpha-owner at sourceware dot org
+Delivered-To: mailing list libc-alpha at sourceware dot org
+
+This fixes some bugs in the powerpc pthread_once code.  Ref
+gcc.gnu.org/bugzilla/show_bug.cgi?id=52839#c10
+
+Release barriers are needed to ensure any memory written by
+init_routine is seen by other threads before *once_control changes.
+In the case of clear_once_control we need to flush any partially
+written state.
+
+2012-06-28  Alan Modra  <amodra@gmail.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
+       Add release barrier before setting once_control to say
+       initialisation is done.  Add hints on lwarx.  Use macro in
+       place of isync.
+       (clear_once_control): Add release barrier.
+
+[ This was slightly edited -- the constraint for operand 0 in the last asm was changed
+  from "=&r" to "=&b" as using r0 in that context results in a load immediate 1 into
+  the target rather than incrementing the target. ]
+
+diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c b/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
+index 4e3d7bd..bb1ebf2 100644
+--- a/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
++++ b/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
+@@ -28,6 +28,7 @@ clear_once_control (void *arg)
+ {
+   pthread_once_t *once_control = (pthread_once_t *) arg;
++  __asm __volatile (__lll_rel_instr);
+   *once_control = 0;
+   lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+ }
+@@ -47,15 +48,15 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
+        oldval = *once_control;
+        if ((oldval & 2) == 0)
+          *once_control = newval;
+-       Do this atomically.
++       Do this atomically with an acquire barrier.
+       */
+       newval = __fork_generation | 1;
+-      __asm __volatile ("1:   lwarx   %0,0,%3\n"
++      __asm __volatile ("1:   lwarx   %0,0,%3" MUTEX_HINT_ACQ "\n"
+                       "       andi.   %1,%0,2\n"
+                       "       bne     2f\n"
+                       "       stwcx.  %4,0,%3\n"
+                       "       bne     1b\n"
+-                      "2:     isync"
++                      "2:     " __lll_acq_instr
+                       : "=&r" (oldval), "=&r" (tmp), "=m" (*once_control)
+                       : "r" (once_control), "r" (newval), "m" (*once_control)
+                       : "cr0");
+@@ -87,8 +88,18 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
+   pthread_cleanup_pop (0);
+-  /* Add one to *once_control to take the bottom 2 bits from 01 to 10.  */
+-  atomic_increment (once_control);
++  /* Add one to *once_control to take the bottom 2 bits from 01 to 10.
++     A release barrier is needed to ensure memory written by init_routine
++     is seen in other threads before *once_control changes.  */
++  int tmp;
++  __asm __volatile (__lll_rel_instr "\n"
++                  "1: lwarx   %0,0,%2" MUTEX_HINT_REL "\n"
++                  "   addi    %0,%0,1\n"
++                  "   stwcx.  %0,0,%2\n"
++                  "   bne-    1b"
++                  : "=&b" (tmp), "=m" (*once_control)
++                  : "r" (once_control), "m" (*once_control)
++                  : "cr0");
+   /* Wake up all other threads.  */
+   lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+
+-- 
+Alan Modra
+Australia Development Lab, IBM
+
diff --git a/src/patches/glibc/glibc-rh861167.patch b/src/patches/glibc/glibc-rh861167.patch
new file mode 100644 (file)
index 0000000..d7e982f
--- /dev/null
@@ -0,0 +1,86 @@
+commit be08eda54c7cf833ccfa4b8d1f1b1d668c26af66
+Author: Andreas Jaeger <aj@suse.de>
+Date:   Wed May 23 09:27:39 2012 +0200
+
+    Update from Linux 3.4
+
+[ Partial, unrelated bits not included. ]
+
+2012-05-23  Andreas Jaeger  <aj@suse.de>
+
+       * sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+       (MADV_DONTDUMP,MADV_DODUMP): New macros from Linux 3.4.
+       macro.
+       * sysdeps/unix/sysv/linux/s390/bits/mman.h
+       (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+       * sysdeps/unix/sysv/linux/i386/bits/mman.h
+       (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+       (MADV_DONTDUMP,MADV_DODUMP): Likewise.
+
+diff -Nrup a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h
+--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h 2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h 2012-09-27 11:44:26.985150148 -0600
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/i386 version.
+-   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
++   Copyright (C) 1997-2012 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -94,6 +94,9 @@
+ # define MADV_DOFORK    11    /* Do inherit across fork.  */
+ # define MADV_MERGEABLE         12    /* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13  /* KSM may not merge identical pages.  */
++# define MADV_DONTDUMP          16    /* Explicity exclude from the core dump,
++                                   overrides the coredump filter bits.  */
++# define MADV_DODUMP    17    /* Clear the MADV_DONTDUMP flag.  */
+ # define MADV_HWPOISON          100   /* Poison a page for testing.  */
+ #endif
+diff -Nrup a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h      2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h      2012-09-27 11:43:37.161351259 -0600
+@@ -96,6 +96,9 @@
+ # define MADV_DOFORK    11    /* Do inherit across fork.  */
+ # define MADV_MERGEABLE         12    /* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13  /* KSM may not merge identical pages.  */
++# define MADV_DONTDUMP          16    /* Explicity exclude from the core dump,
++                                   overrides the coredump filter bits.  */
++# define MADV_DODUMP    17    /* Clear the MADV_DONTDUMP flag.  */
+ # define MADV_HWPOISON          100   /* Poison a page for testing.  */
+ #endif
+diff -Nrup a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h
+--- a/sysdeps/unix/sysv/linux/s390/bits/mman.h 2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h 2012-09-27 11:44:49.745059646 -0600
+@@ -94,6 +94,9 @@
+ # define MADV_DOFORK    11    /* Do inherit across fork.  */
+ # define MADV_MERGEABLE         12    /* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13  /* KSM may not merge identical pages.  */
++# define MADV_DONTDUMP          16    /* Explicity exclude from the core dump,
++                                   overrides the coredump filter bits.  */
++# define MADV_DODUMP    17    /* Clear the MADV_DONTDUMP flag.  */
+ # define MADV_HWPOISON          100   /* Poison a page for testing.  */
+ #endif
+diff -Nrup a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h       2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h       2012-09-27 11:42:08.314725733 -0600
+@@ -1,5 +1,5 @@
+ /* Definitions for POSIX memory map interface.  Linux/x86_64 version.
+-   Copyright (C) 2001, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2001-2012 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -95,6 +95,9 @@
+ # define MADV_DOFORK    11    /* Do inherit across fork.  */
+ # define MADV_MERGEABLE         12    /* KSM may merge identical pages.  */
+ # define MADV_UNMERGEABLE 13  /* KSM may not merge identical pages.  */
++# define MADV_DONTDUMP          16    /* Explicity exclude from the core dump,
++                                   overrides the coredump filter bits.  */
++# define MADV_DODUMP    17    /* Clear the MADV_DONTDUMP flag.  */
+ # define MADV_HWPOISON          100   /* Poison a page for testing.  */
+ #endif
diff --git a/src/patches/glibc/glibc-rh863453.patch b/src/patches/glibc/glibc-rh863453.patch
new file mode 100644 (file)
index 0000000..96fb769
--- /dev/null
@@ -0,0 +1,81 @@
+--- glibc-2.12-2-gc4ccff1/nscd/grpcache.c.lrgrpissue   2002-03-19 01:06:04.905969517 +0530
++++ glibc-2.12-2-gc4ccff1/nscd/grpcache.c      2002-03-19 01:09:46.495970850 +0530
+@@ -207,10 +207,11 @@ cache_addgr (struct database_dyn *db, in
+        change.  Allocate memory on the cache since it is likely
+        discarded anyway.  If it turns out to be necessary to have a
+        new record we can still allocate real memory.  */
+-      bool dataset_in_stack_or_freed = false;
++      bool dataset_temporary = false;
++      bool dataset_malloced = false; 
+       dataset = NULL;
+-      if (he == NULL || ! __libc_use_alloca (alloca_used + total + n))
++      if (he == NULL)
+       dataset = (struct dataset *) mempool_alloc (db, total + n, 1);
+       if (dataset == NULL)
+@@ -218,10 +219,16 @@ cache_addgr (struct database_dyn *db, in
+         /* We cannot permanently add the result in the moment.  But
+            we can provide the result as is.  Store the data in some
+            temporary memory.  */
+-        dataset = (struct dataset *) alloca_account (total + n, alloca_used);
+-
++        if (! __libc_use_alloca (alloca_used + total + n))
++        {
++              /* XXX What to do if malloc fails?  */
++              dataset = (struct dataset *) malloc (total + n);
++              dataset_malloced = true;
++        }
++        else
++              dataset = (struct dataset *) alloca_account (total + n, alloca_used); 
+         /* We cannot add this record to the permanent database.  */
+-        dataset_in_stack_or_freed = true;
++        dataset_temporary = true; 
+       }
+       dataset->head.allocsize = total + n;
+@@ -276,13 +283,10 @@ cache_addgr (struct database_dyn *db, in
+             dh->timeout = dataset->head.timeout;
+             ++dh->nreloads;
+-            /* If the new record was not allocated on the stack, then it must
+-               be freed.  Note that it can no longer be used.  */
+-            if (! dataset_in_stack_or_freed)
+-              {
+-                free (dataset);
+-                dataset_in_stack_or_freed = true;
+-              }
++            /* If the new record was allocated via malloc, then we
++               must free it here.  */
++            if (dataset_malloced)
++                free (dataset); 
+           }
+         else
+           {
+@@ -298,7 +302,7 @@ cache_addgr (struct database_dyn *db, in
+                 key_copy = (char *) newp + (key_copy - (char *) dataset);
+                 dataset = memcpy (newp, dataset, total + n);
+-                dataset_in_stack_or_freed = false;
++                dataset_temporary = false;
+               }
+             /* Mark the old record as obsolete.  */
+@@ -313,7 +317,7 @@ cache_addgr (struct database_dyn *db, in
+         assert (fd != -1);
+ #ifdef HAVE_SENDFILE
+-        if (__builtin_expect (db->mmap_used, 1) && !dataset_in_stack_or_freed)
++        if (__builtin_expect (db->mmap_used, 1) && ! dataset_temporary) 
+           {
+             assert (db->wr_fd != -1);
+             assert ((char *) &dataset->resp > (char *) db->data);
+@@ -340,7 +344,7 @@ cache_addgr (struct database_dyn *db, in
+       /* Add the record to the database.  But only if it has not been
+        stored on the stack.  */
+-      if (! dataset_in_stack_or_freed)
++       if (! dataset_temporary) 
+       {
+         /* If necessary, we also propagate the data to disk.  */
+         if (db->persistent)
diff --git a/src/patches/glibc/glibc-rh864322.patch b/src/patches/glibc/glibc-rh864322.patch
new file mode 100644 (file)
index 0000000..565a146
--- /dev/null
@@ -0,0 +1,12 @@
+diff -rup a/sysdeps/generic/netinet/ip.h b/sysdeps/generic/netinet/ip.h
+--- a/sysdeps/generic/netinet/ip.h     2010-05-04 05:27:23.000000000 -0600
++++ b/sysdeps/generic/netinet/ip.h     2012-10-11 09:22:12.620160387 -0600
+@@ -194,7 +194,7 @@ struct ip_timestamp
+  */
+ #define       IPTOS_CLASS_MASK                0xe0
+-#define       IPTOS_CLASS(class)              ((tos) & IPTOS_CLASS_MASK)
++#define       IPTOS_CLASS(class)              ((class) & IPTOS_CLASS_MASK)
+ #define       IPTOS_CLASS_CS0                 0x00
+ #define       IPTOS_CLASS_CS1                 0x20
+ #define       IPTOS_CLASS_CS2                 0x40
diff --git a/src/patches/glibc/glibc-rh929388.patch b/src/patches/glibc/glibc-rh929388.patch
new file mode 100644 (file)
index 0000000..44ddd17
--- /dev/null
@@ -0,0 +1,21 @@
+diff -pruN glibc-2.5-20061008T1257/sysdeps/x86_64/fpu/math_private.h glibc-2.5-20061008T1257.patched/sysdeps/x86_64/fpu/math_private.h
+--- glibc-2.5-20061008T1257/sysdeps/x86_64/fpu/math_private.h  2013-02-12 07:05:08.000000000 -0500
++++ glibc-2.5-20061008T1257.patched/sysdeps/x86_64/fpu/math_private.h  2013-02-12 06:59:08.000000000 -0500
+@@ -90,10 +90,14 @@ while (0)
+ #undef libc_feupdateenv
+ #define libc_feupdateenv(e) \
+   do {                                                                              \
+-    unsigned int mxcsr;                                                             \
++    unsigned int mxcsr, new_mxcsr;                                          \
+     asm volatile ("stmxcsr %0" : "=m" (*&mxcsr));                           \
+-    asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr));                             \
+-    feraiseexcept (mxcsr & FE_ALL_EXCEPT);                                  \
++    /* Merge in the old exceptions.  */                                             \
++    new_mxcsr = mxcsr & FE_ALL_EXCEPT | (e)->__mxcsr;                       \
++    asm volatile ("ldmxcsr %0" : : "m" (*&new_mxcsr));                              \
++    /* Only raise exception if there are any that are not masked.  */       \
++    if (~(mxcsr >> 7) & mxcsr & FE_ALL_EXCEPT)                                      \
++      feraiseexcept (mxcsr & FE_ALL_EXCEPT);                                \
+   } while (0)
+ #undef libc_feupdateenvf
+ #define libc_feupdateenvf(e) libc_feupdateenv (e)
diff --git a/src/patches/glibc/glibc-rh970992.patch b/src/patches/glibc/glibc-rh970992.patch
new file mode 100644 (file)
index 0000000..42aa819
--- /dev/null
@@ -0,0 +1,190 @@
+#
+# Patch provided by Ulrich Drepper in BZ#919562.
+#
+# Patch has not been sent upstream.
+#
+# 2013-03-08  Ulrich Drepper  <drepper@gmail.com>
+#
+#      * elf/rtld.c (dl_main): Correctly determine when the application
+#      required DSOs with TLS and bump the generation counter in that
+#      case.  The current condition does not account for an audit
+#      module using TLS.
+#      * elf/dl-tls.c (_dl_count_modids): New function.
+#      (_dl_allocate_tls_init): Add assertion to check TLS
+#      generation.
+#      * sysdeps/generic/ldsodefs.h: Declare _dl_count_modids.
+#      * elf/Makefile: Add rules to build and run tst-audit9.
+#      * elf/tst-audit9.c: New file.
+#      * elf/tst-auditmod9a.c: New file.
+#      * elf/tst-auditmod9b.c: New file.
+#
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/dl-tls.c glibc-2.12-2-gc4ccff1/elf/dl-tls.c
+--- glibc-2.12-2-gc4ccff1.orig/elf/dl-tls.c    2013-04-24 16:06:10.410756438 -0400
++++ glibc-2.12-2-gc4ccff1/elf/dl-tls.c 2013-04-24 16:06:49.092604707 -0400
+@@ -109,6 +109,28 @@
+ }
++size_t
++internal_function
++_dl_count_modids (void)
++{
++  if (! __builtin_expect (GL(dl_tls_dtv_gaps), true))
++    return GL(dl_tls_max_dtv_idx);
++
++  size_t n = 0;
++  struct dtv_slotinfo_list *runp = GL(dl_tls_dtv_slotinfo_list);
++  while (runp != NULL)
++    {
++      for (size_t i = 0; i < runp->len; ++i)
++      if (runp->slotinfo[i].map != NULL)
++        ++n;
++
++      runp = runp->next;
++    }
++
++  return n;
++}
++
++
+ #ifdef SHARED
+ void
+ internal_function
+@@ -411,6 +433,7 @@
+         /* Keep track of the maximum generation number.  This might
+            not be the generation counter.  */
++        assert (listp->slotinfo[cnt].gen <= GL(dl_tls_generation));
+         maxgen = MAX (maxgen, listp->slotinfo[cnt].gen);
+         if (map->l_tls_offset == NO_TLS_OFFSET
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/Makefile glibc-2.12-2-gc4ccff1/elf/Makefile
+--- glibc-2.12-2-gc4ccff1.orig/elf/Makefile    2013-04-24 16:06:10.408756448 -0400
++++ glibc-2.12-2-gc4ccff1/elf/Makefile 2013-04-24 16:07:29.475457962 -0400
+@@ -97,6 +97,8 @@
+                  tst-audit6.c tst-auditmod6a.c tst-auditmod6b.c \
+                  tst-auditmod6c.c \
+                  tst-audit7.c tst-auditmod7a.c tst-auditmod7b.c \
++                 tst-audit9.c \
++                 tst-auditmod9a.c tst-auditmod9b.c \
+                  order2mod1.c order2mod2.c order2mod3.c order2mod4.c \
+                  tst-stackguard1.c tst-stackguard1-static.c \
+                  tst-array5.c tst-array5-static.c tst-array5dep.c \
+@@ -198,7 +200,7 @@
+        tst-dlmodcount tst-dlopenrpath tst-deep1 \
+        tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
+        unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
+-       tst-audit1 tst-audit2 \
++       tst-audit1 tst-audit2 tst-audit9 \
+        tst-stackguard1 tst-addr1 tst-thrlock \
+        tst-unique1 tst-unique2
+ #      reldep9
+@@ -251,7 +253,8 @@
+               unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
+               order2mod1 order2mod2 order2mod3 order2mod4 \
+               tst-unique1mod1 tst-unique1mod2 \
+-              tst-unique2mod1 tst-unique2mod2
++              tst-unique2mod1 tst-unique2mod2 \
++              tst-auditmod9a tst-auditmod9b
+ ifeq (yes,$(have-initfini-array))
+ modules-names += tst-array2dep tst-array5dep
+ endif
+@@ -574,6 +577,8 @@
+ ifuncmod1.so-no-z-defs = yes
+ ifuncmod5.so-no-z-defs = yes
+ ifuncmod6.so-no-z-defs = yes
++tst-auditmod9a.so-no-z-defs = yes
++tst-auditmod9b.so-no-z-defs = yes
+ ifeq ($(build-shared),yes)
+ # Build all the modules even when not actually running test programs.
+@@ -1015,6 +1020,10 @@
+ $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
+ tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
++$(objpfx)tst-audit9: $(libdl)
++$(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so
++tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so
++
+ $(objpfx)tst-global1: $(libdl)
+ $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/rtld.c glibc-2.12-2-gc4ccff1/elf/rtld.c
+--- glibc-2.12-2-gc4ccff1.orig/elf/rtld.c      2013-04-24 16:06:10.410756438 -0400
++++ glibc-2.12-2-gc4ccff1/elf/rtld.c   2013-04-24 16:06:49.096604693 -0400
+@@ -1637,6 +1637,10 @@
+       }
+     }
++  /* Keep track of the currently loaded modules to count how many
++     non-audit modules which use TLS are loaded.  */
++  size_t count_modids = _dl_count_modids ();
++
+   /* Set up debugging before the debugger is notified for the first time.  */
+ #ifdef ELF_MACHINE_DEBUG_SETUP
+   /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way.  */
+@@ -2281,7 +2285,8 @@
+ # define NONTLS_INIT_TP do { } while (0)
+ #endif
+-  if (!was_tls_init_tp_called && GL(dl_tls_max_dtv_idx) > 0)
++  if ((!was_tls_init_tp_called && GL(dl_tls_max_dtv_idx) > 0)
++      || count_modids != _dl_count_modids ())
+     ++GL(dl_tls_generation);
+   /* Now that we have completed relocation, the initializer data
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/tst-audit9.c glibc-2.12-2-gc4ccff1/elf/tst-audit9.c
+--- glibc-2.12-2-gc4ccff1.orig/elf/tst-audit9.c        1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1/elf/tst-audit9.c     2013-04-24 16:06:49.096604693 -0400
+@@ -0,0 +1,8 @@
++#include <dlfcn.h>
++
++int main(void)
++{
++  void *h = dlopen("$ORIGIN/tst-auditmod9b.so", RTLD_LAZY);
++  int (*fp)(void) = dlsym(h, "f");
++  return fp() - 1;
++}
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/tst-auditmod9a.c glibc-2.12-2-gc4ccff1/elf/tst-auditmod9a.c
+--- glibc-2.12-2-gc4ccff1.orig/elf/tst-auditmod9a.c    1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1/elf/tst-auditmod9a.c 2013-04-24 16:06:49.097604689 -0400
+@@ -0,0 +1,16 @@
++#include <stdint.h>
++
++__thread int var;
++
++unsigned int
++la_version (unsigned int v)
++{
++  return v;
++}
++
++void
++la_activity (uintptr_t *cookie, unsigned int flag)
++{
++  ++var;
++}
++
+diff -urN glibc-2.12-2-gc4ccff1.orig/elf/tst-auditmod9b.c glibc-2.12-2-gc4ccff1/elf/tst-auditmod9b.c
+--- glibc-2.12-2-gc4ccff1.orig/elf/tst-auditmod9b.c    1969-12-31 19:00:00.000000000 -0500
++++ glibc-2.12-2-gc4ccff1/elf/tst-auditmod9b.c 2013-04-24 16:06:49.097604689 -0400
+@@ -0,0 +1,6 @@
++__thread int a;
++
++int f(void)
++{
++  return ++a;
++}
+diff -urN glibc-2.12-2-gc4ccff1.orig/sysdeps/generic/ldsodefs.h glibc-2.12-2-gc4ccff1/sysdeps/generic/ldsodefs.h
+--- glibc-2.12-2-gc4ccff1.orig/sysdeps/generic/ldsodefs.h      2013-04-24 16:06:10.545755798 -0400
++++ glibc-2.12-2-gc4ccff1/sysdeps/generic/ldsodefs.h   2013-04-24 16:06:49.098604686 -0400
+@@ -1031,6 +1031,9 @@
+ /* Determine next available module ID.  */
+ extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden;
++/* Count the modules with TLS segments.  */
++extern size_t _dl_count_modids (void) internal_function attribute_hidden;
++
+ /* Calculate offset of the TLS blocks in the static TLS block.  */
+ extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden;
diff --git a/src/patches/glibc/glibc-rh989558-2.patch b/src/patches/glibc/glibc-rh989558-2.patch
new file mode 100644 (file)
index 0000000..ad895c7
--- /dev/null
@@ -0,0 +1,107 @@
+2013-05-03  Carlos O'Donell  <carlos at redhat.com>
+
+        * intl/dcigettext.c (DCIGETTEXT): Skip translating if _nl_find_msg returns -1.
+        (_nl_find_msg): Return -1 if recursive call returned -1. If newmem is null
+        return -1.
+        * intl/loadmsgcat.c (_nl_load_domain): If _nl_find_msg returns -1 abort
+        loading the domain.
+
+diff -Nrup a/intl/dcigettext.c b/intl/dcigettext.c
+--- a/intl/dcigettext.c        2010-05-04 07:27:23.000000000 -0400
++++ b/intl/dcigettext.c        2013-08-01 00:11:54.616363264 -0400
+@@ -640,6 +640,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, 
+                 retval = _nl_find_msg (domain->successor[cnt], binding,
+                                        msgid1, 1, &retlen);
++                /* Resource problems are not fatal, instead we return no
++                  translation.  */
++                if (__builtin_expect (retval == (char *) -1, 0))
++                  goto no_translation;
++
+                 if (retval != NULL)
+                   {
+                     domain = domain->successor[cnt];
+@@ -943,6 +948,11 @@ _nl_find_msg (domain_file, domainbinding
+           nullentry =
+             _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
++          /* Resource problems are fatal.  If we continue onwards we will
++             only attempt to calloc a new conv_tab and fail later.  */
++          if (__builtin_expect (nullentry == (char *) -1, 0))
++             return (char *) -1;
++
+           if (nullentry != NULL)
+             {
+               const char *charsetstr;
+@@ -1156,7 +1166,7 @@ _nl_find_msg (domain_file, domainbinding
+                                                            freemem_size);
+ # ifdef _LIBC
+                     if (newmem != NULL)
+-                      transmem_list = transmem_list->next;
++                      transmem_list = newmem;
+                     else
+                       {
+                         struct transmem_list *old = transmem_list;
+@@ -1171,6 +1181,16 @@ _nl_find_msg (domain_file, domainbinding
+                     malloc_count = 1;
+                     freemem_size = INITIAL_BLOCK_SIZE;
+                     newmem = (transmem_block_t *) malloc (freemem_size);
++# ifdef _LIBC
++                    if (newmem != NULL)
++                      {
++                        /* Add the block to the list of blocks we have to free
++                           at some point.  */
++                        newmem->next = transmem_list;
++                        transmem_list = newmem;
++                      }
++                    /* Fall through and return -1.  */
++# endif
+                   }
+                 if (__builtin_expect (newmem == NULL, 0))
+                   {
+@@ -1181,11 +1201,6 @@ _nl_find_msg (domain_file, domainbinding
+                   }
+ # ifdef _LIBC
+-                /* Add the block to the list of blocks we have to free
+-                   at some point.  */
+-                newmem->next = transmem_list;
+-                transmem_list = newmem;
+-
+                 freemem = (unsigned char *) newmem->data;
+                 freemem_size -= offsetof (struct transmem_list, data);
+ # else
+@@ -1402,7 +1417,7 @@ get_output_charset (domainbinding)
+         return _NL_CURRENT (LC_CTYPE, CODESET);
+ # else
+ #  if HAVE_ICONV
+-        extern const char *locale_charset PARAMS ((void);
++        extern const char *locale_charset PARAMS ((void));
+         return locale_charset ();
+ #  endif
+ # endif
+diff -Nrup a/intl/loadmsgcat.c b/intl/loadmsgcat.c
+--- a/intl/loadmsgcat.c        2010-05-04 07:27:23.000000000 -0400
++++ b/intl/loadmsgcat.c        2013-08-01 00:12:48.448237849 -0400
+@@ -1235,7 +1235,7 @@ _nl_load_domain (domain_file, domainbind
+     default:
+       /* This is an invalid revision.  */
+     invalid:
+-      /* This is an invalid .mo file.  */
++      /* This is an invalid .mo file or we ran out of resources.  */
+       free (domain->malloced);
+ #ifdef HAVE_MMAP
+       if (use_mmap)
+@@ -1255,6 +1255,12 @@ _nl_load_domain (domain_file, domainbind
+   /* Get the header entry and look for a plural specification.  */
+   nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
++  if (__builtin_expect (nullentry == (char *) -1, 0))
++    {
++      __libc_rwlock_fini (domain->conversions_lock);
++      goto invalid;
++    }
++
+   EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
+  out:
diff --git a/src/patches/glibc/glibc-rh989558.patch b/src/patches/glibc/glibc-rh989558.patch
new file mode 100644 (file)
index 0000000..61ddbe8
--- /dev/null
@@ -0,0 +1,181 @@
+#
+# Red Hat BZ:
+# https://bugzilla.redhat.com/show_bug.cgi?id=816647
+#
+# ChangeLog
+#
+#2013-04-30  Patsy Franklin  <pfrankli@redhat.com>
+#
+#      * iconv/gconv_cache.c (find_module): Demangle init_fct before 
+#      checking for NULL. Mangle __btowc_fct if init_fct is non-NULL.
+#      * iconv/gconv_db.c (free_derivation): Check that __shlib_handle 
+#      is non-NULL before demangling the end_fct.  Check for NULL
+#      end_fct after demangling.
+#      (__gconv_release_step): Demangle the end_fct before checking 
+#      it for NULL.   Remove assert on __shlibc_handle != NULL.
+#      (gen_steps): Don't check btowc_fct for NULL before mangling.  
+#      Demangle init_fct before checking for NULL.
+#      (increment_counter): Likewise
+#      * gconv_dl.c (__gconv_find_shlib): Don't check init_fct or
+#      end_fct for NULL before mangling.
+#      * wcsmbs/btowc.c (__btowc): Demangle btowc_fct before checking
+#      for NULL.
+#
+diff -Nrup a/iconv/gconv_cache.c b/iconv/gconv_cache.c
+--- a/iconv/gconv_cache.c      2012-12-24 22:02:13.000000000 -0500
++++ b/iconv/gconv_cache.c      2013-04-30 11:34:20.112389987 -0400
+@@ -207,17 +207,16 @@ find_module (const char *directory, cons
+       result->__data = NULL;
+       /* Call the init function.  */
+-      if (result->__init_fct != NULL)
+-      {
+-        __gconv_init_fct init_fct = result->__init_fct;
++      __gconv_init_fct init_fct = result->__init_fct;
+ #ifdef PTR_DEMANGLE
+-        PTR_DEMANGLE (init_fct);
++      PTR_DEMANGLE (init_fct);
+ #endif
++      if (init_fct != NULL)
++      {
+         status = DL_CALL_FCT (init_fct, (result));
+ #ifdef PTR_MANGLE
+-        if (result->__btowc_fct != NULL)
+-          PTR_MANGLE (result->__btowc_fct);
++        PTR_MANGLE (result->__btowc_fct);
+ #endif
+       }
+     }
+diff -Nrup a/iconv/gconv_db.c b/iconv/gconv_db.c
+--- a/iconv/gconv_db.c 2012-12-24 22:02:13.000000000 -0500
++++ b/iconv/gconv_db.c 2013-04-30 11:32:42.700592914 -0400
+@@ -179,16 +179,15 @@ free_derivation (void *p)
+   size_t cnt;
+   for (cnt = 0; cnt < deriv->nsteps; ++cnt)
+-    if (deriv->steps[cnt].__counter > 0
+-      && deriv->steps[cnt].__end_fct != NULL)
++    if ((deriv->steps[cnt].__counter > 0)
++      && (deriv->steps[cnt].__shlib_handle != NULL))
+       {
+-      assert (deriv->steps[cnt].__shlib_handle != NULL);
+-
+       __gconv_end_fct end_fct = deriv->steps[cnt].__end_fct;
+ #ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (end_fct);
+ #endif
+-      DL_CALL_FCT (end_fct, (&deriv->steps[cnt]));
++      if (end_fct != NULL)
++        DL_CALL_FCT (end_fct, (&deriv->steps[cnt]));
+       }
+   /* Free the name strings.  */
+@@ -212,16 +211,12 @@ __gconv_release_step (struct __gconv_ste
+   if (step->__shlib_handle != NULL && --step->__counter == 0)
+     {
+       /* Call the destructor.  */
+-      if (step->__end_fct != NULL)
+-      {
+-        assert (step->__shlib_handle != NULL);
+-
+-        __gconv_end_fct end_fct = step->__end_fct;
++      __gconv_end_fct end_fct = step->__end_fct;
+ #ifdef PTR_DEMANGLE
+-        PTR_DEMANGLE (end_fct);
++      PTR_DEMANGLE (end_fct);
+ #endif
+-        DL_CALL_FCT (end_fct, (step));
+-      }
++      if (end_fct != NULL)
++      DL_CALL_FCT (end_fct, (step));
+ #ifndef STATIC_GCONV
+       /* Release the loaded module.  */
+@@ -293,13 +288,11 @@ gen_steps (struct derivation_step *best,
+             /* Call the init function.  */
+             __gconv_init_fct init_fct = result[step_cnt].__init_fct;
+-            if (init_fct != NULL)
+-              {
+-                assert (result[step_cnt].__shlib_handle != NULL);
+-
+ # ifdef PTR_DEMANGLE
+-                PTR_DEMANGLE (init_fct);
++            PTR_DEMANGLE (init_fct);
+ # endif
++            if (init_fct != NULL)
++              {
+                 status = DL_CALL_FCT (init_fct, (&result[step_cnt]));
+                 if (__builtin_expect (status, __GCONV_OK) != __GCONV_OK)
+@@ -312,8 +305,7 @@ gen_steps (struct derivation_step *best,
+                   }
+ # ifdef PTR_MANGLE
+-                if (result[step_cnt].__btowc_fct != NULL)
+-                  PTR_MANGLE (result[step_cnt].__btowc_fct);
++                PTR_MANGLE (result[step_cnt].__btowc_fct);
+ # endif
+               }
+           }
+@@ -393,16 +385,15 @@ increment_counter (struct __gconv_step *
+         /* Call the init function.  */
+         __gconv_init_fct init_fct = step->__init_fct;
+-        if (init_fct != NULL)
+-          {
+ #ifdef PTR_DEMANGLE
+-            PTR_DEMANGLE (init_fct);
++        PTR_DEMANGLE (init_fct);
+ #endif
++        if (init_fct != NULL)
++          {
+             DL_CALL_FCT (init_fct, (step));
+ #ifdef PTR_MANGLE
+-            if (step->__btowc_fct != NULL)
+-              PTR_MANGLE (step->__btowc_fct);
++            PTR_MANGLE (step->__btowc_fct);
+ #endif
+           }
+       }
+diff -Nrup a/iconv/gconv_dl.c b/iconv/gconv_dl.c
+--- a/iconv/gconv_dl.c 2012-12-24 22:02:13.000000000 -0500
++++ b/iconv/gconv_dl.c 2013-04-30 11:32:42.701592922 -0400
+@@ -132,10 +132,8 @@ __gconv_find_shlib (const char *name)
+ #ifdef PTR_MANGLE
+                 PTR_MANGLE (found->fct);
+-                if (found->init_fct != NULL)
+-                  PTR_MANGLE (found->init_fct);
+-                if (found->end_fct !=  NULL)
+-                  PTR_MANGLE (found->end_fct);
++                PTR_MANGLE (found->init_fct);
++                PTR_MANGLE (found->end_fct);
+ #endif
+                 /* We have succeeded in loading the shared object.  */
+diff -Nrup a/wcsmbs/btowc.c b/wcsmbs/btowc.c
+--- a/wcsmbs/btowc.c   2012-12-24 22:02:13.000000000 -0500
++++ b/wcsmbs/btowc.c   2013-04-30 11:32:42.701592922 -0400
+@@ -47,15 +47,15 @@ __btowc (c)
+   /* Get the conversion functions.  */
+   fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+   __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct;
++#ifdef PTR_DEMANGLE
++  if (fcts->towc->__shlib_handle != NULL)
++    PTR_DEMANGLE (btowc_fct);
++#endif
+   if (__builtin_expect (fcts->towc_nsteps == 1, 1)
+       && __builtin_expect (btowc_fct != NULL, 1))
+     {
+       /* Use the shortcut function.  */
+-#ifdef PTR_DEMANGLE
+-      if (fcts->towc->__shlib_handle != NULL)
+-      PTR_DEMANGLE (btowc_fct);
+-#endif
+       return DL_CALL_FCT (btowc_fct, (fcts->towc, (unsigned char) c));
+     }
+   else
index f943ac83e0dae25e89d8db161e45e6fbf4807725..12c0f1df5f19853160f5c212bb91c15cd8889ec1 100644 (file)
@@ -637,7 +637,42 @@ if ($ip ne $ipcache) {
                            } else {
                                &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server)");
                            }
-                       } else {
+                       }
+                       elsif ($settings{'SERVICE'} eq 'udmedia.de') {
+                           # use proxy ?
+                           my %proxysettings;
+                           &General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
+                           if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
+                               my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
+                               Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} );
+                           }
+
+                           if ($settings{'HOSTNAME'} eq '') {
+                               $settings{'HOSTDOMAIN'} = $settings{'DOMAIN'};
+                           } else {
+                               $settings{'HOSTDOMAIN'} = "$settings{'HOSTNAME'}.$settings{'DOMAIN'}";
+                           }
+
+                           my ($out, $response) = Net::SSLeay::get_https( 'www.udmedia.de',
+                                                                           443,
+                                                                           "/nic/update?myip=$ip&username=$settings{'HOSTDOMAIN'}&password=$settings{'PASSWORD'}",
+                                                                           Net::SSLeay::make_headers('User-Agent' => 'IPFire',
+                                                                                                     'Authorization' => 'Basic ' . encode_base64("$settings{'LOGIN'}:$settings{'PASSWORD'}")) );
+
+                           # Valid response are 'ok'   'nochange'
+                           if ($response =~ m%HTTP/1\.. 200 OK%) {
+                               if ( $out !~ m/^(ok|nochg)/ ) {
+                                   $out =~ s/\n/ /g;
+                                   &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure ($out)");
+                               } else {
+                                   &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success");
+                                   $success++;
+                               }
+                           } else {
+                               &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server, check your credentials---$out-$response--)");
+                           }
+                       }
+                       else {
                                if ($settings{'WILDCARDS'} eq 'on') {
                                    $settings{'WILDCARDS'} = '-w';
                                } else {