commit:     48ff1c2c0ca14220c2dbba05f61dc5546397b3ee
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 06:45:15 2014 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Dec  6 06:45:15 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=48ff1c2c

sys-libs/glibc-2.19: RAP support. This is the last kernel running on 
<linux-2.6.32

---
 sys-libs/glibc/Manifest                            |    7 +-
 .../files/2.17/glibc-2.17-runtime-prefix.patch     |   24 +-
 .../files/2.19/glibc-2.19-configurable-paths.patch | 2115 ++++++++++++++++++++
 .../glibc-2.19-hardened-configure-picdefault.patch |   30 +
 sys-libs/glibc/glibc-2.19-r1.ebuild                |  230 +++
 5 files changed, 2393 insertions(+), 13 deletions(-)

diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index ebaaa48..a66f51f 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -7,11 +7,13 @@ AUX 2.12/glibc-2.12-hardened-pie.patch 1542 SHA256 
9d11da52900a4cfdaa9052476029c
 AUX 2.15/glibc-2.15-localstatedir-backport.patch 412 SHA256 
465bedaaf735a48825cd6433007abfb1e40c2ef8ddf94d12d452b486c70ce36b SHA512 
76506a540d47ad7e76073c3b25bc46278a9e56e34e17d49caf9fffc0622646e8e0d6905fe7d00599db02f444420ed0b9d64d3d70df78446564b137fd65021e45
 WHIRLPOOL 
f21fb6d6eb3555421f7d90b179a7a2745e7056316eacbf209066f01e742037fd283689c5a5f5a313666a2fb79d5ad0631dbada94d9c7eb958ee01217b605533a
 AUX 2.16/glibc-2.16-hardened-pie.patch 1570 SHA256 
9a8d8a8268605251782b1fba509cda090f39f56edc8a5497c7b4acfc428041f7 SHA512 
1dff16b1ce4ba6246336d19fac21ea6e8d5710e138a23603fa6b79896d895834b6d28bb1948c83648120ca1d038805db7dd7138ba3e28e9071254d6320cdc092
 WHIRLPOOL 
f96487ac4bd95a99e9e70204c686c3f19bb8238cfd4a9856b031be58ac23927886f228a8b4add14213e0489a204c51ebbeb8a376311305025116b8ae45fc90c2
 AUX 2.17/glibc-2.17-hardened-pie.patch 1784 SHA256 
bba32e40c73aef20122b2825f31e5c3aa058b61feae4f32f336e1941f83f82d1 SHA512 
9ecfe2b6c8c982a42786181d6507d5fa588a6868109065451f58a779848837bd5e69c32a24e43a186c2ff63a9784015c51487e342c87982ac074139e36c169fc
 WHIRLPOOL 
1baffbef9e6d870ea2f2ae5be014b71020a213a1a11e9856fa207545867de444ed164cb926b2aac23471854eaaf72a87e38760702b32bfcfa639add8733d925e
-AUX 2.17/glibc-2.17-runtime-prefix.patch 6755 SHA256 
8c87433165aad101b6560dde6ac197bb280fa8caecae73498ab6b7e30df0b01f SHA512 
c3008120b02decf055a0e0e759f32780cc787b4942bd249b1c9ed4f47cdc684fbc2a0cbe1626ffccf1c4bc15f8421e693a9e7c09b789e4245acac96fe786a5ff
 WHIRLPOOL 
a7af7be989b7166c15b5b211c6c4535eb2357316a27aef992858c88c964074e444a400f56de9453d46fd48f4d19d9c4dc0fe0567573a0b94e629b900143f8116
+AUX 2.17/glibc-2.17-runtime-prefix.patch 6695 SHA256 
466198a1e2f92957017d3e550b806196de40a6cbf780320b3b11ac72459c19d8 SHA512 
9adf787c8516ec86609bb2c1975d2d05c679199200732c141f4c8ae2724bc1b92a3981995f814542d2fed44662d7ccf560b0e9d904e27d68eafcfe3f55787a43
 WHIRLPOOL 
3bc2aab75168ad3a8b4b273577c3f0e71396a631f151974433187ecb3c73b0adc2ad15e9fd17334b9cb1332035c98937d302a03bc1afb3f66ff1d36d347d21f4
 AUX 2.17/glibc-2.17-shadow-prefix.patch 950 SHA256 
36fa45e0e2642c6ce8809341b69e93d45d97d3b6c451a089198f7b90a5d0eb21 SHA512 
3101b9814bcbd0443d309f3949024e753cb6101e84e9cbbae1502fb4c3f85c2fad041608ba69c966cb1da2cf64f5f2c0931c08db222933a2053394f7b0fabf9d
 WHIRLPOOL 
5243b70d2d2e2d3c3c9b07eb2251bb5e78767e776c0491f91fc8499c3d807b44bdab384f7c81867373a577574999079791695eb65ed8c2da1ce5a79c8e60a5ef
 AUX 2.17/locale-gen_prefix.patch 2704 SHA256 
0807c8979b7a1a63b48d155417ff8ecc7e14773e928a0d1fe6c349a36fcdadef SHA512 
d6b41b953713f7fe0ba14af6d045fc0e6b649f278da691ca5f021d95be5cdabfc87de399880cf988fec2b189fac22864d004ec8d159e59a2348b41945de1d5db
 WHIRLPOOL 
3c7d6b4e789ae494cebea620ed64a6ba8dd401837914f4ead72c7b2d6af94538c9a28f65781db7e6ae0d21c7fac13c531b71147fdb5456ffd39ae1246b331069
 AUX 2.17/vdso-disable.patch 1136 SHA256 
49006855c1ba3ae3d3aa5ed71787056dc64e993eec70a4bef05bcc9f4d824014 SHA512 
6eeb6eae8b8c1777ebd18170a7651b9e95297125cfc3829786c4d02887cad4a5d768fc2950723d1d040d16d15d72491d7443a3c14ca9f20eb2adb1ba6d1649ca
 WHIRLPOOL 
80367da491b958d0b7855d23d3225a5c17a3a7a1b1f9a54ebc093c53823a5ef1642b974b45e079aec0abff0476494368ed9afcaed83b87576ed8458b8348e41e
 AUX 2.17/vdso.patch 697 SHA256 
26f2089344709de9c1bdd2f974d02ff5d4c465f6ebebd5d1ac2cd72b732de201 SHA512 
a303a6828ed001b16f2f5c3532890cff66a50259c2e2aa2843e992f2bed5e6141abc9e120afed25f2e1f30d77bc218c3940d680c3d73c227d2056370d5e6b806
 WHIRLPOOL 
edcaa815b8f86e17d77f0582453a717fbbd848400bfdbd302730fec20a952a584ea8f5ba4f7175b25d84752bc895519d7baa55664073cae5037962b0c1825aa3
+AUX 2.19/glibc-2.19-configurable-paths.patch 81250 SHA256 
ae15864d46cb4d5e061465249c9a9c4585961a312d61d6e9edbf8dd8a5dc8a22 SHA512 
e9b4c4d48560fc4af41505996b40f3dd0023ba86a71182d965a5c0978f1ed6236311da5b990199e2916b9fc091ce374b2d346b03c133f2d8fcf7e6f07616a3fd
 WHIRLPOOL 
67cf918f3f26b74cf34108806195465dbfe0a51b3c97a7ed19e398c093980dbb0bf5b9102f351cdd95acad58cb3b7c947a50efd593c6a161212afe2f4a9f8ac0
+AUX 2.19/glibc-2.19-hardened-configure-picdefault.patch 865 SHA256 
feeb2ddc276e90f55d2fd358837e8d4922d3b2875cb8080b1d8e27e5da83a2d9 SHA512 
d8e6fea72e240f1fde8a487958463140a84e8bd6bb5b176f8ce84a34df3137943db9016300884f3efdd4da130e342448e57ed0c0dc6eb2956d647286ce1d00ce
 WHIRLPOOL 
3a5d2882b5fc1bea78c45409c848c94a260659e3ea1e28a5dc8818de8825e55453aa1cc97b86eef99c91b17bde9f2a6db1fd8ae03839f7029d93a71feaa4d4d0
 AUX 2.20/glibc-2.20-configurable-paths.patch 109416 SHA256 
4aa8fb2d7cc006279afac59fbd5f862e4d2273fbfb4176080d33dd7827716d8b SHA512 
c46a6b443dfc3aa31f7a1bd69bbdcb5188731e718fea3991e2a69a19dd96a992e0984966f4a2b8f7501f3c1d3fe8d74b808cf972d5a57bafaaaf968e53e076b1
 WHIRLPOOL 
d16aea24f8863af6c70b3d94ccb56ad2e44af73b8ae1646a5c6b0040e9f93466dc825808743c6936a113369f7ae5d8c40d6e53dc1f6b99f7fc950e8ae3db266b
 AUX 2.20/glibc-2.20-gentoo-chk_fail.c 8978 SHA256 
f9cc426b0fb21de1dc11bb36e43bca8e1b3114fe78f8b343f672a951a82c742e SHA512 
5cb529ac9d18a315f25fd48a3a80a529924bee0588074c97e6df7dbe8568a67f786363c41da6300ea55818369e3609ed4315b2e2104f8a8b4f1266ba43076eda
 WHIRLPOOL 
2d38c19a20226fc4687037b8bb19025065f039ddaa62466879ca98765c8899e64b147dd148565304419ed1a98fbe1f8403710b22c930b08a19bddba7e79b0f1d
 AUX 2.20/glibc-2.20-gentoo-stack_chk_fail.c 55 SHA256 
ec73e74297b5eade591bfb3a2999989e2a7aa80752140048ffa67349635f05e7 SHA512 
4dfec1bd17007b826110dcb73d09331a58b7a892c87de55b94480b14c28686442c567725b610082813411cf9911e180835a400a54ea704fe80f81cfba966a989
 WHIRLPOOL 
b2b338a50f7895c530a71a19e4582bd0116a0b9d13b2e1505f0566924557493849f93cefb2c0ad1719ef684321e145129e0f72cfc9aa85a44ea7ebf910e7304c
@@ -62,6 +64,8 @@ DIST glibc-2.16.0-patches-11.tar.bz2 90997 SHA256 
4a1abb359e6e73b36eeb21286780fc
 DIST glibc-2.16.0.tar.xz 9990512 SHA256 
1edc36aa2a6cb7127971fce8e02eecffe9c7956297ad3ef10dd4c09f486d5924 SHA512 
be9acc11b77ab3c01d5766fe626a6a51bc3192ac98f9554fbb5c37120cfc6f636c0b7a80beddc180f13b32ad06051d24c1999fa2e64eeb724d55a9498f0f634e
 WHIRLPOOL 
9bfd4358a4488080e12e08deca5fca59c1555853d1c1978b7d1bb3b480eb8fb125dccab38c55644248ae5e18b0167aec85f8a7850bab9e11f980aae6f171eac3
 DIST glibc-2.17-patches-7.tar.bz2 79288 SHA256 
8000409d072571d2d5119d4dd538e3a3ea39213407e202ea10033bf6aed516af SHA512 
c6de4d7754cec6e7a9e36d56eadc6605ba6fcfac116eb50553503738873659977beb935112d361620c35e7b15e86f845a49fd13269ffbf98c72f54dffade19f7
 WHIRLPOOL 
259e938e8f4ca6b7296db4982748429f00135f80cd03965da589e4318134aeddb5acdfa0f8f61871e46330a0c96eb8e734a3c2f50d564882ba37f13f722b78c5
 DIST glibc-2.17.tar.xz 10981956 SHA256 
6914e337401e0e0ade23694e1b2c52a5f09e4eda3270c67e7c3ba93a89b5b23e SHA512 
384e54037daaa344a26ce58242acc3f9a249d0765088d18a540a305745afa33ae6dec4024adae958eacd7100be9c713d117260ace8340f6d8c8396dbde4868d2
 WHIRLPOOL 
9b98c1c298aeff607aaa554341c300c15491b7314f127524fc5c048c67c5059daaf706e6cf206bb69213d5307e37bed87137ab46f504d8072bb778310081fc23
+DIST glibc-2.19-patches-3.tar.bz2 80664 SHA256 
6fb03292e224199e0dd9ba7ee83aca723e1560f26831e85cdc6302b187c6de3c SHA512 
d281d6a2757920124cf8a3f02b97e75192598b08d96ae48840df34c7ffdcb212952d171f233e6f12a429b19437d0a296212fe1f2eae164d6a1c6793cb3cb69f0
 WHIRLPOOL 
6f28a2d0dff42e8ad0e77859938e3093753f77f78821375777eebb2db5568bf1c56e8b8208f02280f23acb2dd26dc8a313fedd5b2c10755f1659e6d324a1dbc3
+DIST glibc-2.19.tar.xz 12083312 SHA256 
2d3997f588401ea095a0b27227b1d50cdfdd416236f6567b564549d3b46ea2a2 SHA512 
9e021fcb3afbb9ace2a0e37fded231a62de861bd766e29d47163a03182e37add718b7acc3963d1c525f9556773e842297725715acde48dcfbaab6e756af1a23d
 WHIRLPOOL 
9581a3a23ebdd56bc559b56b95b7bcd21ca039546ec19c6c0e4e0738597542164fdb21ab1d1f36d5e73a205fb51f0974c7d497972615bce69ae002298f6475b6
 DIST glibc-2.20-patches-1.tar.bz2 78477 SHA256 
b3b1c4022503dc433cc4969534f27ee019ab695aed8b722e914d7fb864db5606 SHA512 
56e954f11610fa4f9fffc68bdad98114bed7592f5a4f8bd81a0306ee99311db8cb4dd4469a6f2a5a60ff4a9e6d172e49971d389f1b2911df7a408571737c1ee1
 WHIRLPOOL 
02aeda854ca220ed3b4fe41510d918a8fc4fb9e95a3761a3884e2d2d3c0a515c82e835d7a74e41dc0a20c865de120b60ea4e561cd3f25534568981c8084dce00
 DIST glibc-2.20.tar.xz 12283992 SHA256 
f84b6d42aecc288d593c397b0a3d02260a33ee686bce0c634eb9b32798f36ba5 SHA512 
7a8eea8b71d3ccba766c3f304cab61055446d451ef063309476b26dc40d880562dc33b1b68fbedeedb4b55b84c26415b9202311aaa71ef8c141b6849a814d2fa
 WHIRLPOOL 
042f74d75c62a655ae35348c9cd0bed0845ab199e37a76635eb74c04ed927b5eca77723c38d2dc46f12fca62c1004001887b43946a914b079ad22f6a9cc8daaa
 DIST glibc-2.9-20081201.tar.bz2 16430489 SHA256 
6f8e515775e20ed48610860d10315adda418a3649b3465f36ee5cd467364a8f6 SHA512 
bdd3f5b61f741f09da21020ceef95e8e4f22574d11f8f2341f573ab2225baaf68698446ec26cbc4a63a21a8a400eaf5820fce4bd89c3e1dcf52172a62df561f4
 WHIRLPOOL 
37e4875e450e8a4067f657b4d71be184844cd45c0d7dbd9242e8f998aab4e15c732fc64ba148c5782078873182d4b132c911da9242b0513eea96a2338aa04722
@@ -90,6 +94,7 @@ EBUILD glibc-2.15-r2.ebuild 7692 SHA256 
1ee891da4bbb450ce16318877a9043773c34a741
 EBUILD glibc-2.15-r3.ebuild 7764 SHA256 
17540bbede72db02e113f556cd3c4a6873c45be1191bade644b5a78d2557c673 SHA512 
b9f856356a1dad8f51a62610defce3984477e7f8265427c7e6d21c7868bb6756de4f66b16d3184fd51180155112339e33547a2348d55a2cf1059ccbdf68f0c3f
 WHIRLPOOL 
9c36e9f55427b2cf0180db983446d572d63be309e64b42bbe3571105446f4eddaa815081faf79fe6fc639e3ddf3e3720f11e7af2e85ea19125ef561176eaeff5
 EBUILD glibc-2.16.0.ebuild 7495 SHA256 
d498eb21c832602c2711b4fd8607bbb36cbbbcd701405c5f84e2dbbe9ac81774 SHA512 
caa429992f3510b4a530fb7d700ba8e67664d5df406ecd198bb7481009e4413cbf9a8f366b77f0e4949670f56dd5e21d7fccee13aa4d13684cfdb8ccf6054aa9
 WHIRLPOOL 
1f3a56785e164b4d2f8f258bc44b6a324dee3cecd8231b030ac68efdcc007c7cc906519d4f3f3585ed327bc572b8a2ded827afdeed9aaad1b81aeeca915571f7
 EBUILD glibc-2.17.ebuild 7660 SHA256 
2c8265a15c54486846ad9928aef4de401470b8874c501c4d8120246a8c8d7900 SHA512 
31ed1869e4f8f586edf928973eed5ae7f8ca10ad1fad9edeb58e4fcf65a7b1a76e257559627e88ca37047f067fe33dae3d69a24b3da7954af93209a5ae8c5253
 WHIRLPOOL 
f09a27c5d118d182533deb68d84c3708329cbc6d844bc78ac28036858f0e625294d21cce645808326c84b9b98d25726a79c29818a938bf023bdb1cccd43f7bf2
+EBUILD glibc-2.19-r1.ebuild 7562 SHA256 
f715dbc5eb11587b744603235ee11ec0b787b1fcc0e53d4c83f7701f61047172 SHA512 
8dcd4bbcde23271f96368cf888385a6a2616e749f077d9ddeeda99c97b3dbb0bf6abe3eb2ac3ca3badb25be910628a81e576d9be32f5fe4337a0cb093e2abc4b
 WHIRLPOOL 
f21cd58a928e9e6d01147bbba17d1c23e7f2411bcb72f1cfc9c5816fb2b05cdaa360e5d6cd8063887343e3643bb923d44dc0ccb3bd1598463d77433e9bdd32dd
 EBUILD glibc-2.20.ebuild 6865 SHA256 
cde32f02960587d06711502a06ee134422d8ed0442c6b91ba6a3c78a38b8ed60 SHA512 
fd0b85b71bb525b0575cf6d9336676c273cb29b2731192774c026d5e7124ecad0158a763bd11023eca02da763a9f853cd86c7f120dc58083f1715fbc5565ba6b
 WHIRLPOOL 
ade288570fa373c42944ca9dd8009fe29d6e93afc7b1adfe2baab08a7631a180fab6530eb65867bdc9805993978bcce7c6207a9844c6eb22904dd2bfb9145058
 EBUILD glibc-2.9_p20081201-r3.ebuild 6770 SHA256 
87e75b306b69d170c7fd6083c7a40303ea292616a810c3e5302eb13ff72932b8 SHA512 
3dc0d6f0b99a1e83caa8a152bb7752b8b504324876bed83657b683c73f8a3432150cb5d3b42aea11d064ee9d1a4d1788dab6c9da11cfc5cf716c214ec145e177
 WHIRLPOOL 
9fec37815cd88eab81f4452e02e13b96e13b1ad8284b1be7f77213280da54a9de85275cf665307d3920e36c3bc02f6005acd5316f6f2ed3dac5b3b60a80690b0
 EBUILD glibc-9999.ebuild 6619 SHA256 
523f30d0bd4fb9aef983b7e62e57239d089251d0f3907b6dfb70a00cbc0c2e6c SHA512 
2d875c8434720b700bfc99836870e625b7c3010178a4a501e435832e826e7008764878d1e4f88d9f568d21f97de56589bff7984b37d3e9840f19492585cfe16f
 WHIRLPOOL 
7da4b26e63d4f79592891ebd1cf1fb915d40049e8feeb61d9c55f7af601bfe2b7f1a03b1aed51f95be0451c90e93992920949c92ccd2401a0c129b600f5afdb9

diff --git a/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch 
b/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch
index 3d16944..8fc683d 100644
--- a/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch
+++ b/sys-libs/glibc/files/2.17/glibc-2.17-runtime-prefix.patch
@@ -1,7 +1,7 @@
-Index: work/glibc-2.17/sysdeps/generic/paths.h
+Index: glibc-2.19/sysdeps/generic/paths.h
 ===================================================================
---- work.orig/glibc-2.17/sysdeps/generic/paths.h
-+++ work/glibc-2.17/sysdeps/generic/paths.h
+--- glibc-2.19.orig/sysdeps/generic/paths.h
++++ glibc-2.19/sysdeps/generic/paths.h
 @@ -33,43 +33,43 @@
  #define       _PATHS_H_
  
@@ -67,10 +67,10 @@ Index: work/glibc-2.17/sysdeps/generic/paths.h
  #define       _PATH_VARTMP    "/var/tmp/"
  
  #endif /* !_PATHS_H_ */
-Index: work/glibc-2.17/sysdeps/unix/sysv/linux/paths.h
+Index: glibc-2.19/sysdeps/unix/sysv/linux/paths.h
 ===================================================================
---- work.orig/glibc-2.17/sysdeps/unix/sysv/linux/paths.h
-+++ work/glibc-2.17/sysdeps/unix/sysv/linux/paths.h
+--- glibc-2.19.orig/sysdeps/unix/sysv/linux/paths.h
++++ glibc-2.19/sysdeps/unix/sysv/linux/paths.h
 @@ -33,43 +33,43 @@
  #define       _PATHS_H_
  
@@ -134,10 +134,10 @@ Index: work/glibc-2.17/sysdeps/unix/sysv/linux/paths.h
  #define       _PATH_VARTMP    "/var/tmp/"
  
  #endif /* !_PATHS_H_ */
-Index: work/glibc-2.17/sysdeps/posix/system.c
+Index: glibc-2.19/sysdeps/posix/system.c
 ===================================================================
---- work.orig/glibc-2.17/sysdeps/posix/system.c
-+++ work/glibc-2.17/sysdeps/posix/system.c
+--- glibc-2.19.orig/sysdeps/posix/system.c
++++ glibc-2.19/sysdeps/posix/system.c
 @@ -26,7 +26,7 @@
  #include <sysdep-cancel.h>
  
@@ -147,10 +147,10 @@ Index: work/glibc-2.17/sysdeps/posix/system.c
  #define       SHELL_NAME      "sh"            /* Name to give it.  */
  
  
-Index: work/glibc-2.17/libio/iopopen.c
+Index: glibc-2.19/libio/iopopen.c
 ===================================================================
---- work.orig/glibc-2.17/libio/iopopen.c
-+++ work/glibc-2.17/libio/iopopen.c
+--- glibc-2.19.orig/libio/iopopen.c
++++ glibc-2.19/libio/iopopen.c
 @@ -222,7 +222,7 @@ _IO_new_proc_open (fp, command, mode)
            _IO_close (fd);
        }

diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-configurable-paths.patch 
b/sys-libs/glibc/files/2.19/glibc-2.19-configurable-paths.patch
new file mode 100644
index 0000000..1cf906a
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-configurable-paths.patch
@@ -0,0 +1,2115 @@
+Index: glibc-2.19/nis/Makefile
+===================================================================
+--- glibc-2.19.orig/nis/Makefile
++++ glibc-2.19/nis/Makefile
+@@ -58,6 +58,11 @@ libnsl-routines = yp_xdr ypclnt ypupdate
+                 nis_clone_res nss-default
+ 
+ libnss_compat-routines        := $(addprefix compat-,grp pwd spwd initgroups)
++SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
++CPPFLAGS-compat-grp.c = $(SYSCONF-FLAGS)
++CPPFLAGS-compat-pwd.c = $(SYSCONF-FLAGS)
++CPPFLAGS-compat-spwd.c = $(SYSCONF-FLAGS)
++CPPFLAGS-compat-initgroups.c = $(SYSCONF-FLAGS)
+ libnss_compat-inhibit-o       = $(filter-out .os,$(object-suffixes))
+ 
+ libnss_nis-routines   := $(addprefix nis-,$(databases)) nis-initgroups \
+Index: glibc-2.19/nis/nss_compat/compat-grp.c
+===================================================================
+--- glibc-2.19.orig/nis/nss_compat/compat-grp.c
++++ glibc-2.19/nis/nss_compat/compat-grp.c
+@@ -120,7 +120,7 @@ internal_setgrent (ent_t *ent, int stayo
+ 
+   if (ent->stream == NULL)
+     {
+-      ent->stream = fopen ("/etc/group", "rme");
++      ent->stream = fopen (SYSCONFDIR "/group", "rme");
+ 
+       if (ent->stream == NULL)
+       status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
+Index: glibc-2.19/nis/nss_compat/compat-initgroups.c
+===================================================================
+--- glibc-2.19.orig/nis/nss_compat/compat-initgroups.c
++++ glibc-2.19/nis/nss_compat/compat-initgroups.c
+@@ -136,7 +136,7 @@ internal_setgrent (ent_t *ent)
+   else
+     ent->blacklist.current = 0;
+ 
+-  ent->stream = fopen ("/etc/group", "rme");
++  ent->stream = fopen (SYSCONFDIR "/group", "rme");
+ 
+   if (ent->stream == NULL)
+     status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
+Index: glibc-2.19/nis/nss_compat/compat-pwd.c
+===================================================================
+--- glibc-2.19.orig/nis/nss_compat/compat-pwd.c
++++ glibc-2.19/nis/nss_compat/compat-pwd.c
+@@ -235,7 +235,7 @@ internal_setpwent (ent_t *ent, int stayo
+ 
+   if (ent->stream == NULL)
+     {
+-      ent->stream = fopen ("/etc/passwd", "rme");
++      ent->stream = fopen (SYSCONFDIR "/passwd", "rme");
+ 
+       if (ent->stream == NULL)
+       status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
+Index: glibc-2.19/nis/nss_compat/compat-spwd.c
+===================================================================
+--- glibc-2.19.orig/nis/nss_compat/compat-spwd.c
++++ glibc-2.19/nis/nss_compat/compat-spwd.c
+@@ -191,7 +191,7 @@ internal_setspent (ent_t *ent, int stayo
+ 
+   if (ent->stream == NULL)
+     {
+-      ent->stream = fopen ("/etc/shadow", "rme");
++      ent->stream = fopen (SYSCONFDIR "/shadow", "rme");
+ 
+       if (ent->stream == NULL)
+       status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
+Index: glibc-2.19/nss/Makefile
+===================================================================
+--- glibc-2.19.orig/nss/Makefile
++++ glibc-2.19/nss/Makefile
+@@ -39,6 +39,8 @@ extra-objs           += $(makedb-modules:=.o)
+ 
+ tests                 = test-netdb tst-nss-test1 test-digits-dots
+ xtests                        = bug-erange
++SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
++CPPFLAGS-bug-erange.c = $(SYSCONF-FLAGS)
+ 
+ include ../Makeconfig
+ 
+@@ -57,6 +59,8 @@ vpath %.c $(subdir-dirs) ../locale/progr
+ 
+ libnss_files-routines := $(addprefix files-,$(databases)) \
+                          files-initgroups files-have_o_cloexec files-init
++CPPFLAGS-files-init.c = $(SYSCONF-FLAGS)
++CPPFLAGS-files-initgroups.c = $(SYSCONF-FLAGS)
+ 
+ libnss_db-dbs         := $(addprefix db-,\
+                                      $(filter-out hosts network key alias,\
+@@ -102,7 +106,7 @@ $(libnss_db-dbs:%=$(objpfx)%.c): $(objpf
+ 
+ $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
+ 
+-$(inst_vardbdir)/Makefile: db-Makefile $(+force)
++$(inst_vardbdir)/Makefile: $(objpfx)db-Makefile $(+force)
+       $(do-install)
+ 
+ CFLAGS-nss_test1.c = -DNOT_IN_libc=1
+Index: glibc-2.19/nss/bug-erange.c
+===================================================================
+--- glibc-2.19.orig/nss/bug-erange.c
++++ glibc-2.19/nss/bug-erange.c
+@@ -37,7 +37,7 @@ main (void)
+     {
+       printf ("gethostbyname_r failed: %s (errno: %m)\n", strerror (res));
+ 
+-      if (access ("/etc/resolv.conf", R_OK))
++      if (access (SYSCONFDIR "/resolv.conf", R_OK))
+       {
+         puts ("DNS probably not set up");
+         return 0;
+Index: glibc-2.19/nss/nss_files/files-init.c
+===================================================================
+--- glibc-2.19.orig/nss/nss_files/files-init.c
++++ glibc-2.19/nss/nss_files/files-init.c
+@@ -35,33 +35,33 @@ static union                                               
        \
+     }                                                         \
+   }
+ 
+-TF (pwd, "/etc/passwd");
+-TF (grp, "/etc/group");
+-TF (hst, "/etc/hosts");
+-TF (resolv, "/etc/resolv.conf", .call_res_init = 1);
+-TF (serv, "/etc/services");
+-TF (netgr, "/etc/netgroup");
++TF (pwd, SYSCONFDIR "/passwd");
++TF (grp, SYSCONFDIR "/group");
++TF (hst, SYSCONFDIR "/hosts");
++TF (resolv, SYSCONFDIR "/resolv.conf", .call_res_init = 1);
++TF (serv, SYSCONFDIR "/services");
++TF (netgr, SYSCONFDIR "/netgroup");
+ 
+ 
+ void
+ _nss_files_init (void (*cb) (size_t, struct traced_file *))
+ {
+-  strcpy (pwd_traced_file.file.fname, "/etc/passwd");
++  strcpy (pwd_traced_file.file.fname, SYSCONFDIR "/passwd");
+   cb (pwddb, &pwd_traced_file.file);
+ 
+-  strcpy (grp_traced_file.file.fname, "/etc/group");
++  strcpy (grp_traced_file.file.fname, SYSCONFDIR "/group");
+   cb (grpdb, &grp_traced_file.file);
+ 
+-  strcpy (hst_traced_file.file.fname, "/etc/hosts");
++  strcpy (hst_traced_file.file.fname, SYSCONFDIR "/hosts");
+   cb (hstdb, &hst_traced_file.file);
+ 
+-  strcpy (resolv_traced_file.file.fname, "/etc/resolv.conf");
++  strcpy (resolv_traced_file.file.fname, SYSCONFDIR "/resolv.conf");
+   cb (hstdb, &resolv_traced_file.file);
+ 
+-  strcpy (serv_traced_file.file.fname, "/etc/services");
++  strcpy (serv_traced_file.file.fname, SYSCONFDIR "/services");
+   cb (servdb, &serv_traced_file.file);
+ 
+-  strcpy (netgr_traced_file.file.fname, "/etc/netgroup");
++  strcpy (netgr_traced_file.file.fname, SYSCONFDIR "/netgroup");
+   cb (netgrdb, &netgr_traced_file.file);
+ }
+ 
+Index: glibc-2.19/nss/nss_files/files-initgroups.c
+===================================================================
+--- glibc-2.19.orig/nss/nss_files/files-initgroups.c
++++ glibc-2.19/nss/nss_files/files-initgroups.c
+@@ -31,7 +31,7 @@ _nss_files_initgroups_dyn (const char *u
+                          long int *size, gid_t **groupsp, long int limit,
+                          int *errnop)
+ {
+-  FILE *stream = fopen ("/etc/group", "rce");
++  FILE *stream = fopen (SYSCONFDIR "/group", "rce");
+   if (stream == NULL)
+     {
+       *errnop = errno;
+Index: glibc-2.19/nss/db-Makefile
+===================================================================
+--- glibc-2.19.orig/nss/db-Makefile
++++ /dev/null
+@@ -1,166 +0,0 @@
+-# Makefile to (re-)generate db versions of system database files.
+-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+-# This file is part of the GNU C Library.
+-# Contributed by Ulrich Drepper <[email protected]>, 1996.
+-#
+-
+-# 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/>.
+-
+-DATABASES = $(wildcard /etc/passwd /etc/group /etc/ethers /etc/protocols \
+-                     /etc/rpc /etc/services /etc/shadow /etc/gshadow \
+-                     /etc/netgroup)
+-
+-VAR_DB = /var/db
+-
+-AWK = awk
+-MAKEDB = makedb --quiet
+-
+-all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
+-
+-
+-$(VAR_DB)/passwd.db: /etc/passwd
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print; \
+-                         printf "=%s ", $$3; print }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/group.db: /etc/group
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print; \
+-                         printf "=%s ", $$3; print; \
+-                         if ($$4 != "") { \
+-                           split($$4, grmems, ","); \
+-                           for (memidx in grmems) { \
+-                             mem=grmems[memidx]; \
+-                             if (members[mem] == "") \
+-                               members[mem]=$$3; \
+-                             else \
+-                               members[mem]=members[mem] "," $$3; \
+-                           } \
+-                           delete grmems; } } \
+-               END { for (mem in members) \
+-                       printf ":%s %s %s\n", mem, mem, members[mem]; }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/ethers.db: /etc/ethers
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) '/^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print; \
+-                         printf "=%s ", $$2; print }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/protocols.db: /etc/protocols
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) '/^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print; \
+-                         printf "=%s ", $$2; print; \
+-                         for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+-                           { printf ".%s ", $$i; print } }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/rpc.db: /etc/rpc
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) '/^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print; \
+-                         printf "=%s ", $$2; print; \
+-                         for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+-                           { printf ".%s ", $$i; print } }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/services.db: /etc/services
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { FS="[ \t/]+" } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { sub(/[ \t]*#.*$$/, "");\
+-                         printf ":%s/%s ", $$1, $$3; print; \
+-                         printf ":%s/ ", $$1; print; \
+-                         printf "=%s/%s ", $$2, $$3; print; \
+-                         printf "=%s/ ", $$2; print; \
+-                         for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
+-                           { printf ":%s/%s ", $$i, $$3; print; \
+-                             printf ":%s/ ", $$i; print } }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+-
+-$(VAR_DB)/shadow.db: /etc/shadow
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
+-      (umask 077 && $(MAKEDB) -o $@ -)
+-      @echo "done."
+-      @if chgrp shadow $@ 2>/dev/null; then \
+-        chmod g+r $@; \
+-      else \
+-        chown 0 $@; chgrp 0 $@; chmod 600 $@; \
+-        echo; \
+-        echo "Warning: The shadow password database $@"; \
+-        echo "has been set to be readable only by root.  You may want"; \
+-        echo "to make it readable by the \`shadow' group depending"; \
+-        echo "on your configuration."; \
+-        echo; \
+-      fi
+-
+-$(VAR_DB)/gshadow.db: /etc/gshadow
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
+-      (umask 077 && $(MAKEDB) -o $@ -)
+-      @echo "done."
+-      @if chgrp shadow $@ 2>/dev/null; then \
+-        chmod g+r $@; \
+-      else \
+-        chown 0 $@; chgrp 0 $@; chmod 600 $@; \
+-        echo; \
+-        echo "Warning: The shadow group database $@"; \
+-        echo "has been set to be readable only by root.  You may want"; \
+-        echo "to make it readable by the \`shadow' group depending"; \
+-        echo "on your configuration."; \
+-        echo; \
+-      fi
+-
+-$(VAR_DB)/netgroup.db: /etc/netgroup
+-      @echo -n "$(patsubst %.db,%,$(@F))... "
+-      @$(AWK) 'BEGIN { ini=1 } \
+-               /^[ \t]*$$/ { next } \
+-               /^[ \t]*#/ { next } \
+-               /^[^#]/ { if (sub(/[ \t]*\\$$/, " ") == 0) end="\n"; \
+-                         else end=""; \
+-                         gsub(/[ \t]+/, " "); \
+-                         sub(/^[ \t]*/, ""); \
+-                         if (ini == 0) printf "%s%s", $$0, end; \
+-                         else printf ".%s %s%s", $$1, $$0, end; \
+-                         ini=end == "" ? 0 : 1; } \
+-                         END { if (ini==0) printf "\n" }' $^ | \
+-      $(MAKEDB) -o $@ -
+-      @echo "done."
+Index: glibc-2.19/nss/db-Makefile.in
+===================================================================
+--- /dev/null
++++ glibc-2.19/nss/db-Makefile.in
+@@ -0,0 +1,173 @@
++
++# Makefile to (re-)generate db versions of system database files.
++# Copyright (C) 1996-2014 Free Software Foundation, Inc.
++# This file is part of the GNU C Library.
++# Contributed by Ulrich Drepper <[email protected]>, 1996.
++#
++
++# 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/>.
++
++DATABASES = $(wildcard @libc_cv_sysconfdir@/passwd    \
++                     @libc_cv_sysconfdir@/group       \
++                     @libc_cv_sysconfdir@/ethers      \
++                     @libc_cv_sysconfdir@/protocols   \
++                     @libc_cv_sysconfdir@/rpc         \
++                     @libc_cv_sysconfdir@/services    \
++                     @libc_cv_sysconfdir@/shadow      \
++                     @libc_cv_sysconfdir@/gshadow     \
++                     @libc_cv_sysconfdir@/netgroup)
++
++VAR_DB = /var/db
++
++AWK = awk
++MAKEDB = makedb --quiet
++
++all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
++
++
++$(VAR_DB)/passwd.db: @libc_cv_sysconfdir@/passwd
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print; \
++                         printf "=%s ", $$3; print }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/group.db: @libc_cv_sysconfdir@/group
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print; \
++                         printf "=%s ", $$3; print; \
++                         if ($$4 != "") { \
++                           split($$4, grmems, ","); \
++                           for (memidx in grmems) { \
++                             mem=grmems[memidx]; \
++                             if (members[mem] == "") \
++                               members[mem]=$$3; \
++                             else \
++                               members[mem]=members[mem] "," $$3; \
++                           } \
++                           delete grmems; } } \
++               END { for (mem in members) \
++                       printf ":%s %s %s\n", mem, mem, members[mem]; }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/ethers.db: @libc_cv_sysconfdir@/ethers
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) '/^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print; \
++                         printf "=%s ", $$2; print }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/protocols.db: @libc_cv_sysconfdir@/protocols
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) '/^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print; \
++                         printf "=%s ", $$2; print; \
++                         for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
++                           { printf ".%s ", $$i; print } }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/rpc.db: @libc_cv_sysconfdir@/rpc
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) '/^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print; \
++                         printf "=%s ", $$2; print; \
++                         for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
++                           { printf ".%s ", $$i; print } }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/services.db: @libc_cv_sysconfdir@/services
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { FS="[ \t/]+" } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { sub(/[ \t]*#.*$$/, "");\
++                         printf ":%s/%s ", $$1, $$3; print; \
++                         printf ":%s/ ", $$1; print; \
++                         printf "=%s/%s ", $$2, $$3; print; \
++                         printf "=%s/ ", $$2; print; \
++                         for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
++                           { printf ":%s/%s ", $$i, $$3; print; \
++                             printf ":%s/ ", $$i; print } }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
++
++$(VAR_DB)/shadow.db: @libc_cv_sysconfdir@/shadow
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
++      (umask 077 && $(MAKEDB) -o $@ -)
++      @echo "done."
++      @if chgrp shadow $@ 2>/dev/null; then \
++        chmod g+r $@; \
++      else \
++        chown 0 $@; chgrp 0 $@; chmod 600 $@; \
++        echo; \
++        echo "Warning: The shadow password database $@"; \
++        echo "has been set to be readable only by root.  You may want"; \
++        echo "to make it readable by the \`shadow' group depending"; \
++        echo "on your configuration."; \
++        echo; \
++      fi
++
++$(VAR_DB)/gshadow.db: @libc_cv_sysconfdir@/gshadow
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
++      (umask 077 && $(MAKEDB) -o $@ -)
++      @echo "done."
++      @if chgrp shadow $@ 2>/dev/null; then \
++        chmod g+r $@; \
++      else \
++        chown 0 $@; chgrp 0 $@; chmod 600 $@; \
++        echo; \
++        echo "Warning: The shadow group database $@"; \
++        echo "has been set to be readable only by root.  You may want"; \
++        echo "to make it readable by the \`shadow' group depending"; \
++        echo "on your configuration."; \
++        echo; \
++      fi
++
++$(VAR_DB)/netgroup.db: @libc_cv_sysconfdir@/netgroup
++      @echo -n "$(patsubst %.db,%,$(@F))... "
++      @$(AWK) 'BEGIN { ini=1 } \
++               /^[ \t]*$$/ { next } \
++               /^[ \t]*#/ { next } \
++               /^[^#]/ { if (sub(/[ \t]*\\$$/, " ") == 0) end="\n"; \
++                         else end=""; \
++                         gsub(/[ \t]+/, " "); \
++                         sub(/^[ \t]*/, ""); \
++                         if (ini == 0) printf "%s%s", $$0, end; \
++                         else printf ".%s %s%s", $$1, $$0, end; \
++                         ini=end == "" ? 0 : 1; } \
++                         END { if (ini==0) printf "\n" }' $^ | \
++      $(MAKEDB) -o $@ -
++      @echo "done."
+Index: glibc-2.19/resolv/netdb.h
+===================================================================
+--- glibc-2.19.orig/resolv/netdb.h
++++ glibc-2.19/resolv/netdb.h
+@@ -42,12 +42,12 @@
+ #include <bits/netdb.h>
+ 
+ /* Absolute file name for network data base files.  */
+-#define       _PATH_HEQUIV            "/etc/hosts.equiv"
+-#define       _PATH_HOSTS             "/etc/hosts"
+-#define       _PATH_NETWORKS          "/etc/networks"
+-#define       _PATH_NSSWITCH_CONF     "/etc/nsswitch.conf"
+-#define       _PATH_PROTOCOLS         "/etc/protocols"
+-#define       _PATH_SERVICES          "/etc/services"
++#define       _PATH_HEQUIV            SYSCONFDIR "/hosts.equiv"
++#define       _PATH_HOSTS             SYSCONFDIR "/hosts"
++#define       _PATH_NETWORKS          SYSCONFDIR "/networks"
++#define       _PATH_NSSWITCH_CONF     SYSCONFDIR "/nsswitch.conf"
++#define       _PATH_PROTOCOLS         SYSCONFDIR "/protocols"
++#define       _PATH_SERVICES          SYSCONFDIR "/services"
+ 
+ 
+ __BEGIN_DECLS
+Index: glibc-2.19/resolv/resolv.h
+===================================================================
+--- glibc-2.19.orig/resolv/resolv.h
++++ /dev/null
+@@ -1,389 +0,0 @@
+-/*
+- * Copyright (c) 1983, 1987, 1989
+- *    The Regents of the University of California.  All rights reserved.
+- *
+- * Redistribution and use in source and binary forms, with or without
+- * modification, are permitted provided that the following conditions
+- * are met:
+- * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer.
+- * 2. Redistributions in binary form must reproduce the above copyright
+- *    notice, this list of conditions and the following disclaimer in the
+- *    documentation and/or other materials provided with the distribution.
+- * 4. Neither the name of the University nor the names of its contributors
+- *    may be used to endorse or promote products derived from this software
+- *    without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- */
+-
+-/*
+- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 
WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- */
+-
+-/*
+- *    @(#)resolv.h    8.1 (Berkeley) 6/2/93
+- *    $BINDId: resolv.h,v 8.31 2000/03/30 20:16:50 vixie Exp $
+- */
+-
+-#ifndef _RESOLV_H_
+-
+-/* These headers are needed for types used in the `struct res_state'
+-   declaration.  */
+-#include <sys/types.h>
+-#include <netinet/in.h>
+-
+-#ifndef __need_res_state
+-# define _RESOLV_H_
+-
+-# include <sys/param.h>
+-# include <sys/cdefs.h>
+-# include <stdio.h>
+-# include <arpa/nameser.h>
+-#endif
+-
+-#ifndef __res_state_defined
+-# define __res_state_defined
+-
+-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
+-      res_sendhookact;
+-
+-typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *__ns,
+-                                         const u_char **__query,
+-                                         int *__querylen,
+-                                         u_char *__ans,
+-                                         int __anssiz,
+-                                         int *__resplen);
+-
+-typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *__ns,
+-                                         const u_char *__query,
+-                                         int __querylen,
+-                                         u_char *__ans,
+-                                         int __anssiz,
+-                                         int *__resplen);
+-
+-/*
+- * Global defines and variables for resolver stub.
+- */
+-# define MAXNS                        3       /* max # name servers we'll 
track */
+-# define MAXDFLSRCH           3       /* # default domain levels to try */
+-# define MAXDNSRCH            6       /* max # domains in search path */
+-# define LOCALDOMAINPARTS     2       /* min levels in name that is "local" */
+-
+-# define RES_TIMEOUT          5       /* min. seconds between retries */
+-# define MAXRESOLVSORT                10      /* number of net to sort on */
+-# define RES_MAXNDOTS         15      /* should reflect bit field size */
+-# define RES_MAXRETRANS               30      /* only for 
resolv.conf/RES_OPTIONS */
+-# define RES_MAXRETRY         5       /* only for resolv.conf/RES_OPTIONS */
+-# define RES_DFLRETRY         2       /* Default #/tries. */
+-# define RES_MAXTIME          65535   /* Infinity, in milliseconds. */
+-
+-struct __res_state {
+-      int     retrans;                /* retransmition time interval */
+-      int     retry;                  /* number of times to retransmit */
+-      u_long  options;                /* option flags - see below. */
+-      int     nscount;                /* number of name servers */
+-      struct sockaddr_in
+-              nsaddr_list[MAXNS];     /* address of name server */
+-# define nsaddr       nsaddr_list[0]          /* for backward compatibility */
+-      u_short id;                     /* current message id */
+-      /* 2 byte hole here.  */
+-      char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
+-      char    defdname[256];          /* default domain (deprecated) */
+-      u_long  pfcode;                 /* RES_PRF_ flags - see below. */
+-      unsigned ndots:4;               /* threshold for initial abs. query */
+-      unsigned nsort:4;               /* number of elements in sort_list[] */
+-      unsigned ipv6_unavail:1;        /* connecting to IPv6 server failed */
+-      unsigned unused:23;
+-      struct {
+-              struct in_addr  addr;
+-              u_int32_t       mask;
+-      } sort_list[MAXRESOLVSORT];
+-      /* 4 byte hole here on 64-bit architectures.  */
+-      res_send_qhook qhook;           /* query hook */
+-      res_send_rhook rhook;           /* response hook */
+-      int     res_h_errno;            /* last one set for this context */
+-      int     _vcsock;                /* PRIVATE: for res_send VC i/o */
+-      u_int   _flags;                 /* PRIVATE: see below */
+-      /* 4 byte hole here on 64-bit architectures.  */
+-      union {
+-              char    pad[52];        /* On an i386 this means 512b total. */
+-              struct {
+-                      u_int16_t               nscount;
+-                      u_int16_t               nsmap[MAXNS];
+-                      int                     nssocks[MAXNS];
+-                      u_int16_t               nscount6;
+-                      u_int16_t               nsinit;
+-                      struct sockaddr_in6     *nsaddrs[MAXNS];
+-#ifdef _LIBC
+-                      unsigned long long int  initstamp
+-                        __attribute__((packed));
+-#else
+-                      unsigned int            _initstamp[2];
+-#endif
+-              } _ext;
+-      } _u;
+-};
+-
+-typedef struct __res_state *res_state;
+-# undef __need_res_state
+-#endif
+-
+-#ifdef _RESOLV_H_
+-/*
+- * Revision information.  This is the release date in YYYYMMDD format.
+- * It can change every day so the right thing to do with it is use it
+- * in preprocessor commands such as "#if (__RES > 19931104)".  Do not
+- * compare for equality; rather, use it to determine whether your resolver
+- * is new enough to contain a certain feature.
+- */
+-
+-#define       __RES   19991006
+-
+-/*
+- * Resolver configuration file.
+- * Normally not present, but may contain the address of the
+- * inital name server(s) to query and the domain search list.
+- */
+-
+-#ifndef _PATH_RESCONF
+-#define _PATH_RESCONF        "/etc/resolv.conf"
+-#endif
+-
+-struct res_sym {
+-      int     number;         /* Identifying number, like T_MX */
+-      char *  name;           /* Its symbolic name, like "MX" */
+-      char *  humanname;      /* Its fun name, like "mail exchanger" */
+-};
+-
+-/*
+- * Resolver flags (used to be discrete per-module statics ints).
+- */
+-#define       RES_F_VC        0x00000001      /* socket is TCP */
+-#define       RES_F_CONN      0x00000002      /* socket is connected */
+-#define RES_F_EDNS0ERR        0x00000004      /* EDNS0 caused errors */
+-
+-/* res_findzonecut() options */
+-#define       RES_EXHAUSTIVE  0x00000001      /* always do all queries */
+-
+-/*
+- * Resolver options (keep these in synch with res_debug.c, please)
+- */
+-#define RES_INIT      0x00000001      /* address initialized */
+-#define RES_DEBUG     0x00000002      /* print debug messages */
+-#define RES_AAONLY    0x00000004      /* authoritative answers only (!IMPL)*/
+-#define RES_USEVC     0x00000008      /* use virtual circuit */
+-#define RES_PRIMARY   0x00000010      /* query primary server only (!IMPL) */
+-#define RES_IGNTC     0x00000020      /* ignore trucation errors */
+-#define RES_RECURSE   0x00000040      /* recursion desired */
+-#define RES_DEFNAMES  0x00000080      /* use default domain name */
+-#define RES_STAYOPEN  0x00000100      /* Keep TCP socket open */
+-#define RES_DNSRCH    0x00000200      /* search up local domain tree */
+-#define       RES_INSECURE1   0x00000400      /* type 1 security disabled */
+-#define       RES_INSECURE2   0x00000800      /* type 2 security disabled */
+-#define       RES_NOALIASES   0x00001000      /* shuts off HOSTALIASES 
feature */
+-#define       RES_USE_INET6   0x00002000      /* use/map IPv6 in 
gethostbyname() */
+-#define RES_ROTATE    0x00004000      /* rotate ns list after each query */
+-#define       RES_NOCHECKNAME 0x00008000      /* do not check names for 
sanity (!IMPL) */
+-#define       RES_KEEPTSIG    0x00010000      /* do not strip TSIG records */
+-#define       RES_BLAST       0x00020000      /* blast all recursive servers 
*/
+-#define RES_USEBSTRING        0x00040000      /* IPv6 reverse lookup with byte
+-                                         strings */
+-#define RES_NOIP6DOTINT       0x00080000      /* Do not use .ip6.int in IPv6
+-                                         reverse lookup */
+-#define RES_USE_EDNS0 0x00100000      /* Use EDNS0.  */
+-#define RES_SNGLKUP   0x00200000      /* one outstanding request at a time */
+-#define RES_SNGLKUPREOP       0x00400000      /* -"-, but open new socket for 
each
+-                                         request */
+-#define RES_USE_DNSSEC        0x00800000      /* use DNSSEC using OK bit in 
OPT */
+-#define RES_NOTLDQUERY        0x01000000      /* Do not look up unqualified 
name
+-                                         as a TLD.  */
+-
+-#define RES_DEFAULT   (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
+-
+-/*
+- * Resolver "pfcode" values.  Used by dig.
+- */
+-#define RES_PRF_STATS 0x00000001
+-#define RES_PRF_UPDATE        0x00000002
+-#define RES_PRF_CLASS   0x00000004
+-#define RES_PRF_CMD   0x00000008
+-#define RES_PRF_QUES  0x00000010
+-#define RES_PRF_ANS   0x00000020
+-#define RES_PRF_AUTH  0x00000040
+-#define RES_PRF_ADD   0x00000080
+-#define RES_PRF_HEAD1 0x00000100
+-#define RES_PRF_HEAD2 0x00000200
+-#define RES_PRF_TTLID 0x00000400
+-#define RES_PRF_HEADX 0x00000800
+-#define RES_PRF_QUERY 0x00001000
+-#define RES_PRF_REPLY 0x00002000
+-#define RES_PRF_INIT  0x00004000
+-/*                    0x00008000      */
+-
+-/* Things involving an internal (static) resolver context. */
+-__BEGIN_DECLS
+-extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+-__END_DECLS
+-#define _res (*__res_state())
+-
+-#ifndef __BIND_NOSTATIC
+-#define fp_nquery             __fp_nquery
+-#define fp_query              __fp_query
+-#define hostalias             __hostalias
+-#define p_query                       __p_query
+-#define res_close             __res_close
+-#define res_init              __res_init
+-#define res_isourserver               __res_isourserver
+-#define res_mkquery           __res_mkquery
+-#define res_query             __res_query
+-#define res_querydomain               __res_querydomain
+-#define res_search            __res_search
+-#define res_send              __res_send
+-
+-__BEGIN_DECLS
+-void          fp_nquery (const u_char *, int, FILE *) __THROW;
+-void          fp_query (const u_char *, FILE *) __THROW;
+-const char *  hostalias (const char *) __THROW;
+-void          p_query (const u_char *) __THROW;
+-void          res_close (void) __THROW;
+-int           res_init (void) __THROW;
+-int           res_isourserver (const struct sockaddr_in *) __THROW;
+-int           res_mkquery (int, const char *, int, int, const u_char *,
+-                           int, const u_char *, u_char *, int) __THROW;
+-int           res_query (const char *, int, int, u_char *, int) __THROW;
+-int           res_querydomain (const char *, const char *, int, int,
+-                               u_char *, int) __THROW;
+-int           res_search (const char *, int, int, u_char *, int) __THROW;
+-int           res_send (const u_char *, int, u_char *, int) __THROW;
+-__END_DECLS
+-#endif
+-
+-#define b64_ntop              __b64_ntop
+-#define b64_pton              __b64_pton
+-#define dn_comp                       __dn_comp
+-#define dn_count_labels               __dn_count_labels
+-#define dn_expand             __dn_expand
+-#define dn_skipname           __dn_skipname
+-#define fp_resstat            __fp_resstat
+-#define loc_aton              __loc_aton
+-#define loc_ntoa              __loc_ntoa
+-#define p_cdname              __p_cdname
+-#define p_cdnname             __p_cdnname
+-#define p_class                       __p_class
+-#define p_fqname              __p_fqname
+-#define p_fqnname             __p_fqnname
+-#define p_option              __p_option
+-#define p_secstodate          __p_secstodate
+-#define p_section             __p_section
+-#define p_time                        __p_time
+-#define p_type                        __p_type
+-#define p_rcode                       __p_rcode
+-#define putlong                       __putlong
+-#define putshort              __putshort
+-#define res_dnok              __res_dnok
+-#define res_hnok              __res_hnok
+-#define res_hostalias         __res_hostalias
+-#define res_mailok            __res_mailok
+-#define res_nameinquery               __res_nameinquery
+-#define res_nclose            __res_nclose
+-#define res_ninit             __res_ninit
+-#define res_nmkquery          __res_nmkquery
+-#define res_npquery           __res_npquery
+-#define res_nquery            __res_nquery
+-#define res_nquerydomain      __res_nquerydomain
+-#define res_nsearch           __res_nsearch
+-#define res_nsend             __res_nsend
+-#define res_nisourserver      __res_nisourserver
+-#define res_ownok             __res_ownok
+-#define res_queriesmatch      __res_queriesmatch
+-#define res_randomid          __res_randomid
+-#define sym_ntop              __sym_ntop
+-#define sym_ntos              __sym_ntos
+-#define sym_ston              __sym_ston
+-__BEGIN_DECLS
+-int           res_hnok (const char *) __THROW;
+-int           res_ownok (const char *) __THROW;
+-int           res_mailok (const char *) __THROW;
+-int           res_dnok (const char *) __THROW;
+-int           sym_ston (const struct res_sym *, const char *, int *) __THROW;
+-const char *  sym_ntos (const struct res_sym *, int, int *) __THROW;
+-const char *  sym_ntop (const struct res_sym *, int, int *) __THROW;
+-int           b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
+-int           b64_pton (char const *, u_char *, size_t) __THROW;
+-int           loc_aton (const char *__ascii, u_char *__binary) __THROW;
+-const char *  loc_ntoa (const u_char *__binary, char *__ascii) __THROW;
+-int           dn_skipname (const u_char *, const u_char *) __THROW;
+-void          putlong (u_int32_t, u_char *) __THROW;
+-void          putshort (u_int16_t, u_char *) __THROW;
+-const char *  p_class (int) __THROW;
+-const char *  p_time (u_int32_t) __THROW;
+-const char *  p_type (int) __THROW;
+-const char *  p_rcode (int) __THROW;
+-const u_char *        p_cdnname (const u_char *, const u_char *, int, FILE *)
+-     __THROW;
+-const u_char *        p_cdname (const u_char *, const u_char *, FILE *) 
__THROW;
+-const u_char *        p_fqnname (const u_char *__cp, const u_char *__msg,
+-                         int, char *, int) __THROW;
+-const u_char *        p_fqname (const u_char *, const u_char *, FILE *) 
__THROW;
+-const char *  p_option (u_long __option) __THROW;
+-char *                p_secstodate (u_long) __THROW;
+-int           dn_count_labels (const char *) __THROW;
+-int           dn_comp (const char *, u_char *, int, u_char **, u_char **)
+-     __THROW;
+-int           dn_expand (const u_char *, const u_char *, const u_char *,
+-                         char *, int) __THROW;
+-u_int         res_randomid (void) __THROW;
+-int           res_nameinquery (const char *, int, int,
+-                               const u_char *, const u_char *) __THROW;
+-int           res_queriesmatch (const u_char *, const u_char *,
+-                                const u_char *, const u_char *) __THROW;
+-const char *  p_section (int __section, int __opcode) __THROW;
+-/* Things involving a resolver context. */
+-int           res_ninit (res_state) __THROW;
+-int           res_nisourserver (const res_state,
+-                                const struct sockaddr_in *) __THROW;
+-void          fp_resstat (const res_state, FILE *) __THROW;
+-void          res_npquery (const res_state, const u_char *, int, FILE *)
+-     __THROW;
+-const char *  res_hostalias (const res_state, const char *, char *, size_t)
+-     __THROW;
+-int           res_nquery (res_state, const char *, int, int, u_char *, int)
+-     __THROW;
+-int           res_nsearch (res_state, const char *, int, int, u_char *, int)
+-     __THROW;
+-int           res_nquerydomain (res_state, const char *, const char *, int,
+-                                int, u_char *, int) __THROW;
+-int           res_nmkquery (res_state, int, const char *, int, int,
+-                            const u_char *, int, const u_char *, u_char *,
+-                            int) __THROW;
+-int           res_nsend (res_state, const u_char *, int, u_char *, int)
+-     __THROW;
+-void          res_nclose (res_state) __THROW;
+-__END_DECLS
+-#endif
+-
+-#endif /* !_RESOLV_H_ */
+Index: glibc-2.19/shadow/Makefile
+===================================================================
+--- glibc-2.19.orig/shadow/Makefile
++++ glibc-2.19/shadow/Makefile
+@@ -34,5 +34,6 @@ CFLAGS-fgetspent_r.c = -fexceptions $(li
+ CFLAGS-putspent.c = -fexceptions $(libio-mtsafe)
+ CFLAGS-getspnam.c = -fexceptions
+ CFLAGS-getspnam_r.c = -fexceptions
++CPPFLAGS-lckpwdf.c = -DSYSCONFDIR='"$(sysconfdir)"'
+ 
+ include ../Rules
+Index: glibc-2.19/shadow/lckpwdf.c
+===================================================================
+--- glibc-2.19.orig/shadow/lckpwdf.c
++++ glibc-2.19/shadow/lckpwdf.c
+@@ -29,7 +29,7 @@
+ 
+ 
+ /* Name of the lock file.  */
+-#define PWD_LOCKFILE "/etc/.pwd.lock"
++#define PWD_LOCKFILE SYSCONFDIR "/.pwd.lock"
+ 
+ /* How long to wait for getting the lock before returning with an
+    error.  */
+Index: glibc-2.19/configure.ac
+===================================================================
+--- glibc-2.19.orig/configure.ac
++++ glibc-2.19/configure.ac
+@@ -2173,7 +2173,7 @@ RELEASE=`sed -n -e 's/^#define RELEASE "
+ AC_SUBST(VERSION)
+ AC_SUBST(RELEASE)
+ 
+-AC_CONFIG_FILES([config.make Makefile])
++AC_CONFIG_FILES([config.make Makefile nss/db-Makefile resolv/netdb.h 
resolv/resolv.h])
+ AC_CONFIG_COMMANDS([default],[[
+ case $CONFIG_FILES in *config.make*)
+ echo "$config_vars" >> config.make;;
+Index: glibc-2.19/resolv/netdb.h.in
+===================================================================
+--- /dev/null
++++ glibc-2.19/resolv/netdb.h.in
+@@ -0,0 +1,715 @@
++  /* Copyright (C) 1996-2014 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/>.  */
++
++/* All data returned by the network data base library are supplied in
++   host order and returned in network order (suitable for use in
++   system calls).  */
++
++#ifndef       _NETDB_H
++#define       _NETDB_H        1
++
++#include <features.h>
++
++#include <netinet/in.h>
++#include <stdint.h>
++#ifdef __USE_MISC
++/* This is necessary to make this include file properly replace the
++   Sun version.  */
++# include <rpc/netdb.h>
++#endif
++
++#ifdef __USE_GNU
++# define __need_sigevent_t
++# include <bits/siginfo.h>
++# define __need_timespec
++# include <time.h>
++#endif
++
++#include <bits/netdb.h>
++
++/* Absolute file name for network data base files.  */
++#define       _PATH_HEQUIV            "@libc_cv_sysconfdir@/hosts.equiv"
++#define       _PATH_HOSTS             "@libc_cv_sysconfdir@/hosts"
++#define       _PATH_NETWORKS          "@libc_cv_sysconfdir@/networks"
++#define       _PATH_NSSWITCH_CONF     "@libc_cv_sysconfdir@/nsswitch.conf"
++#define       _PATH_PROTOCOLS         "@libc_cv_sysconfdir@/protocols"
++#define       _PATH_SERVICES          "@libc_cv_sysconfdir@/services"
++
++
++__BEGIN_DECLS
++
++#if defined __USE_MISC || !defined __USE_XOPEN2K8
++/* Error status for non-reentrant lookup functions.
++   We use a macro to access always the thread-specific `h_errno' variable.  */
++# define h_errno (*__h_errno_location ())
++
++/* Function to get address of global `h_errno' variable.  */
++extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
++
++
++/* Possible values left in `h_errno'.  */
++# define HOST_NOT_FOUND       1       /* Authoritative Answer Host not found. 
 */
++# define TRY_AGAIN    2       /* Non-Authoritative Host not found,
++                                 or SERVERFAIL.  */
++# define NO_RECOVERY  3       /* Non recoverable errors, FORMERR, REFUSED,
++                                 NOTIMP.  */
++# define NO_DATA      4       /* Valid name, no data record of requested
++                                 type.  */
++#endif
++#ifdef __USE_MISC
++# define NETDB_INTERNAL       -1      /* See errno.  */
++# define NETDB_SUCCESS        0       /* No problem.  */
++# define NO_ADDRESS   NO_DATA /* No address, look for MX record.  */
++#endif
++
++#if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED
++/* Highest reserved Internet port number.  */
++# define IPPORT_RESERVED      1024
++#endif
++
++#ifdef __USE_GNU
++/* Scope delimiter for getaddrinfo(), getnameinfo().  */
++# define SCOPE_DELIMITER      '%'
++#endif
++
++#ifdef __USE_MISC
++/* Print error indicated by `h_errno' variable on standard error.  STR
++   if non-null is printed before the error string.  */
++extern void herror (const char *__str) __THROW;
++
++/* Return string associated with error ERR_NUM.  */
++extern const char *hstrerror (int __err_num) __THROW;
++#endif
++
++
++/* Description of data base entry for a single host.  */
++struct hostent
++{
++  char *h_name;                       /* Official name of host.  */
++  char **h_aliases;           /* Alias list.  */
++  int h_addrtype;             /* Host address type.  */
++  int h_length;                       /* Length of address.  */
++  char **h_addr_list;         /* List of addresses from name server.  */
++#ifdef __USE_MISC
++# define      h_addr  h_addr_list[0] /* Address, for backward compatibility.*/
++#endif
++};
++
++/* Open host data base files and mark them as staying open even after
++   a later search if STAY_OPEN is non-zero.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void sethostent (int __stay_open);
++
++/* Close host data base files and clear `stay open' flag.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void endhostent (void);
++
++/* Get next entry from host data base file.  Open data base if
++   necessary.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct hostent *gethostent (void);
++
++/* Return entry from host data base which address match ADDR with
++   length LEN and type TYPE.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len,
++                                    int __type);
++
++/* Return entry from host data base for host with NAME.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct hostent *gethostbyname (const char *__name);
++
++#ifdef __USE_MISC
++/* Return entry from host data base for host with NAME.  AF must be
++   set to the address type which is `AF_INET' for IPv4 or `AF_INET6'
++   for IPv6.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern struct hostent *gethostbyname2 (const char *__name, int __af);
++
++/* Reentrant versions of the functions above.  The additional
++   arguments specify a buffer of BUFLEN starting at BUF.  The last
++   argument is a pointer to a variable which gets the value which
++   would be stored in the global variable `herrno' by the
++   non-reentrant functions.
++
++   These functions are not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation they are cancellation points and
++   therefore not marked with __THROW.  */
++extern int gethostent_r (struct hostent *__restrict __result_buf,
++                       char *__restrict __buf, size_t __buflen,
++                       struct hostent **__restrict __result,
++                       int *__restrict __h_errnop);
++
++extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len,
++                          int __type,
++                          struct hostent *__restrict __result_buf,
++                          char *__restrict __buf, size_t __buflen,
++                          struct hostent **__restrict __result,
++                          int *__restrict __h_errnop);
++
++extern int gethostbyname_r (const char *__restrict __name,
++                          struct hostent *__restrict __result_buf,
++                          char *__restrict __buf, size_t __buflen,
++                          struct hostent **__restrict __result,
++                          int *__restrict __h_errnop);
++
++extern int gethostbyname2_r (const char *__restrict __name, int __af,
++                           struct hostent *__restrict __result_buf,
++                           char *__restrict __buf, size_t __buflen,
++                           struct hostent **__restrict __result,
++                           int *__restrict __h_errnop);
++#endif        /* misc */
++
++
++/* Open network data base files and mark them as staying open even
++   after a later search if STAY_OPEN is non-zero.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void setnetent (int __stay_open);
++
++/* Close network data base files and clear `stay open' flag.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void endnetent (void);
++
++/* Get next entry from network data base file.  Open data base if
++   necessary.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct netent *getnetent (void);
++
++/* Return entry from network data base which address match NET and
++   type TYPE.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct netent *getnetbyaddr (uint32_t __net, int __type);
++
++/* Return entry from network data base for network with NAME.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct netent *getnetbyname (const char *__name);
++
++#ifdef        __USE_MISC
++/* Reentrant versions of the functions above.  The additional
++   arguments specify a buffer of BUFLEN starting at BUF.  The last
++   argument is a pointer to a variable which gets the value which
++   would be stored in the global variable `herrno' by the
++   non-reentrant functions.
++
++   These functions are not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation they are cancellation points and
++   therefore not marked with __THROW.  */
++extern int getnetent_r (struct netent *__restrict __result_buf,
++                      char *__restrict __buf, size_t __buflen,
++                      struct netent **__restrict __result,
++                      int *__restrict __h_errnop);
++
++extern int getnetbyaddr_r (uint32_t __net, int __type,
++                         struct netent *__restrict __result_buf,
++                         char *__restrict __buf, size_t __buflen,
++                         struct netent **__restrict __result,
++                         int *__restrict __h_errnop);
++
++extern int getnetbyname_r (const char *__restrict __name,
++                         struct netent *__restrict __result_buf,
++                         char *__restrict __buf, size_t __buflen,
++                         struct netent **__restrict __result,
++                         int *__restrict __h_errnop);
++#endif        /* misc */
++
++
++/* Description of data base entry for a single service.  */
++struct servent
++{
++  char *s_name;                       /* Official service name.  */
++  char **s_aliases;           /* Alias list.  */
++  int s_port;                 /* Port number.  */
++  char *s_proto;              /* Protocol to use.  */
++};
++
++/* Open service data base files and mark them as staying open even
++   after a later search if STAY_OPEN is non-zero.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void setservent (int __stay_open);
++
++/* Close service data base files and clear `stay open' flag.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void endservent (void);
++
++/* Get next entry from service data base file.  Open data base if
++   necessary.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct servent *getservent (void);
++
++/* Return entry from network data base for network with NAME and
++   protocol PROTO.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct servent *getservbyname (const char *__name, const char 
*__proto);
++
++/* Return entry from service data base which matches port PORT and
++   protocol PROTO.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct servent *getservbyport (int __port, const char *__proto);
++
++
++#ifdef        __USE_MISC
++/* Reentrant versions of the functions above.  The additional
++   arguments specify a buffer of BUFLEN starting at BUF.
++
++   These functions are not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation they are cancellation points and
++   therefore not marked with __THROW.  */
++extern int getservent_r (struct servent *__restrict __result_buf,
++                       char *__restrict __buf, size_t __buflen,
++                       struct servent **__restrict __result);
++
++extern int getservbyname_r (const char *__restrict __name,
++                          const char *__restrict __proto,
++                          struct servent *__restrict __result_buf,
++                          char *__restrict __buf, size_t __buflen,
++                          struct servent **__restrict __result);
++
++extern int getservbyport_r (int __port, const char *__restrict __proto,
++                          struct servent *__restrict __result_buf,
++                          char *__restrict __buf, size_t __buflen,
++                          struct servent **__restrict __result);
++#endif        /* misc */
++
++
++/* Description of data base entry for a single service.  */
++struct protoent
++{
++  char *p_name;                       /* Official protocol name.  */
++  char **p_aliases;           /* Alias list.  */
++  int p_proto;                        /* Protocol number.  */
++};
++
++/* Open protocol data base files and mark them as staying open even
++   after a later search if STAY_OPEN is non-zero.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void setprotoent (int __stay_open);
++
++/* Close protocol data base files and clear `stay open' flag.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern void endprotoent (void);
++
++/* Get next entry from protocol data base file.  Open data base if
++   necessary.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct protoent *getprotoent (void);
++
++/* Return entry from protocol data base for network with NAME.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct protoent *getprotobyname (const char *__name);
++
++/* Return entry from protocol data base which number is PROTO.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern struct protoent *getprotobynumber (int __proto);
++
++
++#ifdef        __USE_MISC
++/* Reentrant versions of the functions above.  The additional
++   arguments specify a buffer of BUFLEN starting at BUF.
++
++   These functions are not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation they are cancellation points and
++   therefore not marked with __THROW.  */
++extern int getprotoent_r (struct protoent *__restrict __result_buf,
++                        char *__restrict __buf, size_t __buflen,
++                        struct protoent **__restrict __result);
++
++extern int getprotobyname_r (const char *__restrict __name,
++                           struct protoent *__restrict __result_buf,
++                           char *__restrict __buf, size_t __buflen,
++                           struct protoent **__restrict __result);
++
++extern int getprotobynumber_r (int __proto,
++                             struct protoent *__restrict __result_buf,
++                             char *__restrict __buf, size_t __buflen,
++                             struct protoent **__restrict __result);
++
++
++/* Establish network group NETGROUP for enumeration.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int setnetgrent (const char *__netgroup);
++
++/* Free all space allocated by previous `setnetgrent' call.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern void endnetgrent (void);
++
++/* Get next member of netgroup established by last `setnetgrent' call
++   and return pointers to elements in HOSTP, USERP, and DOMAINP.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int getnetgrent (char **__restrict __hostp,
++                      char **__restrict __userp,
++                      char **__restrict __domainp);
++
++
++/* Test whether NETGROUP contains the triple (HOST,USER,DOMAIN).
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int innetgr (const char *__netgroup, const char *__host,
++                  const char *__user, const char *__domain);
++
++/* Reentrant version of `getnetgrent' where result is placed in BUFFER.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int getnetgrent_r (char **__restrict __hostp,
++                        char **__restrict __userp,
++                        char **__restrict __domainp,
++                        char *__restrict __buffer, size_t __buflen);
++#endif        /* misc */
++
++
++#ifdef __USE_MISC
++/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD.
++   The local user is LOCUSER, on the remote machine the command is
++   executed as REMUSER.  In *FD2P the descriptor to the socket for the
++   connection is returned.  The caller must have the right to use a
++   reserved port.  When the function returns *AHOST contains the
++   official host name.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
++               const char *__restrict __locuser,
++               const char *__restrict __remuser,
++               const char *__restrict __cmd, int *__restrict __fd2p);
++
++/* This is the equivalent function where the protocol can be selected
++   and which therefore can be used for IPv6.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
++                  const char *__restrict __locuser,
++                  const char *__restrict __remuser,
++                  const char *__restrict __cmd, int *__restrict __fd2p,
++                  sa_family_t __af);
++
++/* Call `rexecd' at port RPORT on remote machine *AHOST to execute
++   CMD.  The process runs at the remote machine using the ID of user
++   NAME whose cleartext password is PASSWD.  In *FD2P the descriptor
++   to the socket for the connection is returned.  When the function
++   returns *AHOST contains the official host name.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rexec (char **__restrict __ahost, int __rport,
++                const char *__restrict __name,
++                const char *__restrict __pass,
++                const char *__restrict __cmd, int *__restrict __fd2p);
++
++/* This is the equivalent function where the protocol can be selected
++   and which therefore can be used for IPv6.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rexec_af (char **__restrict __ahost, int __rport,
++                   const char *__restrict __name,
++                   const char *__restrict __pass,
++                   const char *__restrict __cmd, int *__restrict __fd2p,
++                   sa_family_t __af);
++
++/* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER.
++   If SUSER is not zero the user tries to become superuser.  Return 0 if
++   it is possible.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int ruserok (const char *__rhost, int __suser,
++                  const char *__remuser, const char *__locuser);
++
++/* This is the equivalent function where the protocol can be selected
++   and which therefore can be used for IPv6.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int ruserok_af (const char *__rhost, int __suser,
++                     const char *__remuser, const char *__locuser,
++                     sa_family_t __af);
++
++/* Check whether user REMUSER on system indicated by IPv4 address
++   RADDR is allowed to login as LOCUSER.  Non-IPv4 (e.g., IPv6) are
++   not supported.  If SUSER is not zero the user tries to become
++   superuser.  Return 0 if it is possible.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int iruserok (uint32_t __raddr, int __suser,
++                   const char *__remuser, const char *__locuser);
++
++/* This is the equivalent function where the pfamiliy if the address
++   pointed to by RADDR is determined by the value of AF.  It therefore
++   can be used for IPv6
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int iruserok_af (const void *__raddr, int __suser,
++                      const char *__remuser, const char *__locuser,
++                      sa_family_t __af);
++
++/* Try to allocate reserved port, returning a descriptor for a socket opened
++   at this port or -1 if unsuccessful.  The search for an available port
++   will start at ALPORT and continues with lower numbers.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rresvport (int *__alport);
++
++/* This is the equivalent function where the protocol can be selected
++   and which therefore can be used for IPv6.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int rresvport_af (int *__alport, sa_family_t __af);
++#endif
++
++
++/* Extension from POSIX.1g.  */
++#ifdef        __USE_POSIX
++/* Structure to contain information about address of a service provider.  */
++struct addrinfo
++{
++  int ai_flags;                       /* Input flags.  */
++  int ai_family;              /* Protocol family for socket.  */
++  int ai_socktype;            /* Socket type.  */
++  int ai_protocol;            /* Protocol for socket.  */
++  socklen_t ai_addrlen;               /* Length of socket address.  */
++  struct sockaddr *ai_addr;   /* Socket address for socket.  */
++  char *ai_canonname;         /* Canonical name for service location.  */
++  struct addrinfo *ai_next;   /* Pointer to next in list.  */
++};
++
++# ifdef __USE_GNU
++/* Structure used as control block for asynchronous lookup.  */
++struct gaicb
++{
++  const char *ar_name;                /* Name to look up.  */
++  const char *ar_service;     /* Service name.  */
++  const struct addrinfo *ar_request; /* Additional request specification.  */
++  struct addrinfo *ar_result; /* Pointer to result.  */
++  /* The following are internal elements.  */
++  int __return;
++  int __glibc_reserved[5];
++};
++
++/* Lookup mode.  */
++#  define GAI_WAIT    0
++#  define GAI_NOWAIT  1
++# endif
++
++/* Possible values for `ai_flags' field in `addrinfo' structure.  */
++# define AI_PASSIVE   0x0001  /* Socket address is intended for `bind'.  */
++# define AI_CANONNAME 0x0002  /* Request for canonical name.  */
++# define AI_NUMERICHOST       0x0004  /* Don't use name resolution.  */
++# define AI_V4MAPPED  0x0008  /* IPv4 mapped addresses are acceptable.  */
++# define AI_ALL               0x0010  /* Return IPv4 mapped and IPv6 
addresses.  */
++# define AI_ADDRCONFIG        0x0020  /* Use configuration of this host to 
choose
++                                 returned address type..  */
++# ifdef __USE_GNU
++#  define AI_IDN      0x0040  /* IDN encode input (assuming it is encoded
++                                 in the current locale's character set)
++                                 before looking it up. */
++#  define AI_CANONIDN 0x0080  /* Translate canonical name from IDN format. */
++#  define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode
++                                          code points.  */
++#  define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to
++                                              STD3 rules.  */
++# endif
++# define AI_NUMERICSERV       0x0400  /* Don't use name resolution.  */
++
++/* Error values for `getaddrinfo' function.  */
++# define EAI_BADFLAGS   -1    /* Invalid value for `ai_flags' field.  */
++# define EAI_NONAME     -2    /* NAME or SERVICE is unknown.  */
++# define EAI_AGAIN      -3    /* Temporary failure in name resolution.  */
++# define EAI_FAIL       -4    /* Non-recoverable failure in name res.  */
++# define EAI_FAMILY     -6    /* `ai_family' not supported.  */
++# define EAI_SOCKTYPE   -7    /* `ai_socktype' not supported.  */
++# define EAI_SERVICE    -8    /* SERVICE not supported for `ai_socktype'.  */
++# define EAI_MEMORY     -10   /* Memory allocation failure.  */
++# define EAI_SYSTEM     -11   /* System error returned in `errno'.  */
++# define EAI_OVERFLOW   -12   /* Argument buffer overflow.  */
++# ifdef __USE_GNU
++#  define EAI_NODATA    -5    /* No address associated with NAME.  */
++#  define EAI_ADDRFAMILY  -9  /* Address family for NAME not supported.  */
++#  define EAI_INPROGRESS  -100        /* Processing request in progress.  */
++#  define EAI_CANCELED          -101  /* Request canceled.  */
++#  define EAI_NOTCANCELED -102        /* Request not canceled.  */
++#  define EAI_ALLDONE   -103  /* All requests done.  */
++#  define EAI_INTR      -104  /* Interrupted by a signal.  */
++#  define EAI_IDN_ENCODE  -105        /* IDN encoding failed.  */
++# endif
++
++# ifdef __USE_MISC
++#  define NI_MAXHOST      1025
++#  define NI_MAXSERV      32
++# endif
++
++# define NI_NUMERICHOST       1       /* Don't try to look up hostname.  */
++# define NI_NUMERICSERV 2     /* Don't convert port number to name.  */
++# define NI_NOFQDN    4       /* Only return nodename portion.  */
++# define NI_NAMEREQD  8       /* Don't return numeric addresses.  */
++# define NI_DGRAM     16      /* Look up UDP service rather than TCP.  */
++# ifdef __USE_GNU
++#  define NI_IDN      32      /* Convert name from IDN format.  */
++#  define NI_IDN_ALLOW_UNASSIGNED 64 /* Don't reject unassigned Unicode
++                                      code points.  */
++#  define NI_IDN_USE_STD3_ASCII_RULES 128 /* Validate strings according to
++                                           STD3 rules.  */
++# endif
++
++/* Translate name of a service location and/or a service name to set of
++   socket addresses.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern int getaddrinfo (const char *__restrict __name,
++                      const char *__restrict __service,
++                      const struct addrinfo *__restrict __req,
++                      struct addrinfo **__restrict __pai);
++
++/* Free `addrinfo' structure AI including associated storage.  */
++extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
++
++/* Convert error return from getaddrinfo() to a string.  */
++extern const char *gai_strerror (int __ecode) __THROW;
++
++/* Translate a socket address to a location and service name.
++
++   This function is a possible cancellation point and therefore not
++   marked with __THROW.  */
++extern int getnameinfo (const struct sockaddr *__restrict __sa,
++                      socklen_t __salen, char *__restrict __host,
++                      socklen_t __hostlen, char *__restrict __serv,
++                      socklen_t __servlen, int __flags);
++#endif        /* POSIX */
++
++#ifdef __USE_GNU
++/* Enqueue ENT requests from the LIST.  If MODE is GAI_WAIT wait until all
++   requests are handled.  If WAIT is GAI_NOWAIT return immediately after
++   queueing the requests and signal completion according to SIG.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr],
++                        int __ent, struct sigevent *__restrict __sig);
++
++/* Suspend execution of the thread until at least one of the ENT requests
++   in LIST is handled.  If TIMEOUT is not a null pointer it specifies the
++   longest time the function keeps waiting before returning with an error.
++
++   This function is not part of POSIX and therefore no official
++   cancellation point.  But due to similarity with an POSIX interface
++   or due to the implementation it is a cancellation point and
++   therefore not marked with __THROW.  */
++extern int gai_suspend (const struct gaicb *const __list[], int __ent,
++                      const struct timespec *__timeout);
++
++/* Get the error status of the request REQ.  */
++extern int gai_error (struct gaicb *__req) __THROW;
++
++/* Cancel the requests associated with GAICBP.  */
++extern int gai_cancel (struct gaicb *__gaicbp) __THROW;
++#endif        /* GNU */
++
++__END_DECLS
++
++#endif        /* netdb.h */
+Index: glibc-2.19/resolv/resolv.h.in
+===================================================================
+--- /dev/null
++++ glibc-2.19/resolv/resolv.h.in
+@@ -0,0 +1,389 @@
++/*
++ * Copyright (c) 1983, 1987, 1989
++ *    The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 
WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ *    @(#)resolv.h    8.1 (Berkeley) 6/2/93
++ *    $BINDId: resolv.h,v 8.31 2000/03/30 20:16:50 vixie Exp $
++ */
++
++#ifndef _RESOLV_H_
++
++/* These headers are needed for types used in the `struct res_state'
++   declaration.  */
++#include <sys/types.h>
++#include <netinet/in.h>
++
++#ifndef __need_res_state
++# define _RESOLV_H_
++
++# include <sys/param.h>
++# include <sys/cdefs.h>
++# include <stdio.h>
++# include <arpa/nameser.h>
++#endif
++
++#ifndef __res_state_defined
++# define __res_state_defined
++
++typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
++      res_sendhookact;
++
++typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *__ns,
++                                         const u_char **__query,
++                                         int *__querylen,
++                                         u_char *__ans,
++                                         int __anssiz,
++                                         int *__resplen);
++
++typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *__ns,
++                                         const u_char *__query,
++                                         int __querylen,
++                                         u_char *__ans,
++                                         int __anssiz,
++                                         int *__resplen);
++
++/*
++ * Global defines and variables for resolver stub.
++ */
++# define MAXNS                        3       /* max # name servers we'll 
track */
++# define MAXDFLSRCH           3       /* # default domain levels to try */
++# define MAXDNSRCH            6       /* max # domains in search path */
++# define LOCALDOMAINPARTS     2       /* min levels in name that is "local" */
++
++# define RES_TIMEOUT          5       /* min. seconds between retries */
++# define MAXRESOLVSORT                10      /* number of net to sort on */
++# define RES_MAXNDOTS         15      /* should reflect bit field size */
++# define RES_MAXRETRANS               30      /* only for 
resolv.conf/RES_OPTIONS */
++# define RES_MAXRETRY         5       /* only for resolv.conf/RES_OPTIONS */
++# define RES_DFLRETRY         2       /* Default #/tries. */
++# define RES_MAXTIME          65535   /* Infinity, in milliseconds. */
++
++struct __res_state {
++      int     retrans;                /* retransmition time interval */
++      int     retry;                  /* number of times to retransmit */
++      u_long  options;                /* option flags - see below. */
++      int     nscount;                /* number of name servers */
++      struct sockaddr_in
++              nsaddr_list[MAXNS];     /* address of name server */
++# define nsaddr       nsaddr_list[0]          /* for backward compatibility */
++      u_short id;                     /* current message id */
++      /* 2 byte hole here.  */
++      char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
++      char    defdname[256];          /* default domain (deprecated) */
++      u_long  pfcode;                 /* RES_PRF_ flags - see below. */
++      unsigned ndots:4;               /* threshold for initial abs. query */
++      unsigned nsort:4;               /* number of elements in sort_list[] */
++      unsigned ipv6_unavail:1;        /* connecting to IPv6 server failed */
++      unsigned unused:23;
++      struct {
++              struct in_addr  addr;
++              u_int32_t       mask;
++      } sort_list[MAXRESOLVSORT];
++      /* 4 byte hole here on 64-bit architectures.  */
++      res_send_qhook qhook;           /* query hook */
++      res_send_rhook rhook;           /* response hook */
++      int     res_h_errno;            /* last one set for this context */
++      int     _vcsock;                /* PRIVATE: for res_send VC i/o */
++      u_int   _flags;                 /* PRIVATE: see below */
++      /* 4 byte hole here on 64-bit architectures.  */
++      union {
++              char    pad[52];        /* On an i386 this means 512b total. */
++              struct {
++                      u_int16_t               nscount;
++                      u_int16_t               nsmap[MAXNS];
++                      int                     nssocks[MAXNS];
++                      u_int16_t               nscount6;
++                      u_int16_t               nsinit;
++                      struct sockaddr_in6     *nsaddrs[MAXNS];
++#ifdef _LIBC
++                      unsigned long long int  initstamp
++                        __attribute__((packed));
++#else
++                      unsigned int            _initstamp[2];
++#endif
++              } _ext;
++      } _u;
++};
++
++typedef struct __res_state *res_state;
++# undef __need_res_state
++#endif
++
++#ifdef _RESOLV_H_
++/*
++ * Revision information.  This is the release date in YYYYMMDD format.
++ * It can change every day so the right thing to do with it is use it
++ * in preprocessor commands such as "#if (__RES > 19931104)".  Do not
++ * compare for equality; rather, use it to determine whether your resolver
++ * is new enough to contain a certain feature.
++ */
++
++#define       __RES   19991006
++
++/*
++ * Resolver configuration file.
++ * Normally not present, but may contain the address of the
++ * inital name server(s) to query and the domain search list.
++ */
++
++#ifndef _PATH_RESCONF
++#define _PATH_RESCONF        "@libc_cv_sysconfdir@/resolv.conf"
++#endif
++
++struct res_sym {
++      int     number;         /* Identifying number, like T_MX */
++      char *  name;           /* Its symbolic name, like "MX" */
++      char *  humanname;      /* Its fun name, like "mail exchanger" */
++};
++
++/*
++ * Resolver flags (used to be discrete per-module statics ints).
++ */
++#define       RES_F_VC        0x00000001      /* socket is TCP */
++#define       RES_F_CONN      0x00000002      /* socket is connected */
++#define RES_F_EDNS0ERR        0x00000004      /* EDNS0 caused errors */
++
++/* res_findzonecut() options */
++#define       RES_EXHAUSTIVE  0x00000001      /* always do all queries */
++
++/*
++ * Resolver options (keep these in synch with res_debug.c, please)
++ */
++#define RES_INIT      0x00000001      /* address initialized */
++#define RES_DEBUG     0x00000002      /* print debug messages */
++#define RES_AAONLY    0x00000004      /* authoritative answers only (!IMPL)*/
++#define RES_USEVC     0x00000008      /* use virtual circuit */
++#define RES_PRIMARY   0x00000010      /* query primary server only (!IMPL) */
++#define RES_IGNTC     0x00000020      /* ignore trucation errors */
++#define RES_RECURSE   0x00000040      /* recursion desired */
++#define RES_DEFNAMES  0x00000080      /* use default domain name */
++#define RES_STAYOPEN  0x00000100      /* Keep TCP socket open */
++#define RES_DNSRCH    0x00000200      /* search up local domain tree */
++#define       RES_INSECURE1   0x00000400      /* type 1 security disabled */
++#define       RES_INSECURE2   0x00000800      /* type 2 security disabled */
++#define       RES_NOALIASES   0x00001000      /* shuts off HOSTALIASES 
feature */
++#define       RES_USE_INET6   0x00002000      /* use/map IPv6 in 
gethostbyname() */
++#define RES_ROTATE    0x00004000      /* rotate ns list after each query */
++#define       RES_NOCHECKNAME 0x00008000      /* do not check names for 
sanity (!IMPL) */
++#define       RES_KEEPTSIG    0x00010000      /* do not strip TSIG records */
++#define       RES_BLAST       0x00020000      /* blast all recursive servers 
*/
++#define RES_USEBSTRING        0x00040000      /* IPv6 reverse lookup with byte
++                                         strings */
++#define RES_NOIP6DOTINT       0x00080000      /* Do not use .ip6.int in IPv6
++                                         reverse lookup */
++#define RES_USE_EDNS0 0x00100000      /* Use EDNS0.  */
++#define RES_SNGLKUP   0x00200000      /* one outstanding request at a time */
++#define RES_SNGLKUPREOP       0x00400000      /* -"-, but open new socket for 
each
++                                         request */
++#define RES_USE_DNSSEC        0x00800000      /* use DNSSEC using OK bit in 
OPT */
++#define RES_NOTLDQUERY        0x01000000      /* Do not look up unqualified 
name
++                                         as a TLD.  */
++
++#define RES_DEFAULT   (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
++
++/*
++ * Resolver "pfcode" values.  Used by dig.
++ */
++#define RES_PRF_STATS 0x00000001
++#define RES_PRF_UPDATE        0x00000002
++#define RES_PRF_CLASS   0x00000004
++#define RES_PRF_CMD   0x00000008
++#define RES_PRF_QUES  0x00000010
++#define RES_PRF_ANS   0x00000020
++#define RES_PRF_AUTH  0x00000040
++#define RES_PRF_ADD   0x00000080
++#define RES_PRF_HEAD1 0x00000100
++#define RES_PRF_HEAD2 0x00000200
++#define RES_PRF_TTLID 0x00000400
++#define RES_PRF_HEADX 0x00000800
++#define RES_PRF_QUERY 0x00001000
++#define RES_PRF_REPLY 0x00002000
++#define RES_PRF_INIT  0x00004000
++/*                    0x00008000      */
++
++/* Things involving an internal (static) resolver context. */
++__BEGIN_DECLS
++extern struct __res_state *__res_state(void) __attribute__ ((__const__));
++__END_DECLS
++#define _res (*__res_state())
++
++#ifndef __BIND_NOSTATIC
++#define fp_nquery             __fp_nquery
++#define fp_query              __fp_query
++#define hostalias             __hostalias
++#define p_query                       __p_query
++#define res_close             __res_close
++#define res_init              __res_init
++#define res_isourserver               __res_isourserver
++#define res_mkquery           __res_mkquery
++#define res_query             __res_query
++#define res_querydomain               __res_querydomain
++#define res_search            __res_search
++#define res_send              __res_send
++
++__BEGIN_DECLS
++void          fp_nquery (const u_char *, int, FILE *) __THROW;
++void          fp_query (const u_char *, FILE *) __THROW;
++const char *  hostalias (const char *) __THROW;
++void          p_query (const u_char *) __THROW;
++void          res_close (void) __THROW;
++int           res_init (void) __THROW;
++int           res_isourserver (const struct sockaddr_in *) __THROW;
++int           res_mkquery (int, const char *, int, int, const u_char *,
++                           int, const u_char *, u_char *, int) __THROW;
++int           res_query (const char *, int, int, u_char *, int) __THROW;
++int           res_querydomain (const char *, const char *, int, int,
++                               u_char *, int) __THROW;
++int           res_search (const char *, int, int, u_char *, int) __THROW;
++int           res_send (const u_char *, int, u_char *, int) __THROW;
++__END_DECLS
++#endif
++
++#define b64_ntop              __b64_ntop
++#define b64_pton              __b64_pton
++#define dn_comp                       __dn_comp
++#define dn_count_labels               __dn_count_labels
++#define dn_expand             __dn_expand
++#define dn_skipname           __dn_skipname
++#define fp_resstat            __fp_resstat
++#define loc_aton              __loc_aton
++#define loc_ntoa              __loc_ntoa
++#define p_cdname              __p_cdname
++#define p_cdnname             __p_cdnname
++#define p_class                       __p_class
++#define p_fqname              __p_fqname
++#define p_fqnname             __p_fqnname
++#define p_option              __p_option
++#define p_secstodate          __p_secstodate
++#define p_section             __p_section
++#define p_time                        __p_time
++#define p_type                        __p_type
++#define p_rcode                       __p_rcode
++#define putlong                       __putlong
++#define putshort              __putshort
++#define res_dnok              __res_dnok
++#define res_hnok              __res_hnok
++#define res_hostalias         __res_hostalias
++#define res_mailok            __res_mailok
++#define res_nameinquery               __res_nameinquery
++#define res_nclose            __res_nclose
++#define res_ninit             __res_ninit
++#define res_nmkquery          __res_nmkquery
++#define res_npquery           __res_npquery
++#define res_nquery            __res_nquery
++#define res_nquerydomain      __res_nquerydomain
++#define res_nsearch           __res_nsearch
++#define res_nsend             __res_nsend
++#define res_nisourserver      __res_nisourserver
++#define res_ownok             __res_ownok
++#define res_queriesmatch      __res_queriesmatch
++#define res_randomid          __res_randomid
++#define sym_ntop              __sym_ntop
++#define sym_ntos              __sym_ntos
++#define sym_ston              __sym_ston
++__BEGIN_DECLS
++int           res_hnok (const char *) __THROW;
++int           res_ownok (const char *) __THROW;
++int           res_mailok (const char *) __THROW;
++int           res_dnok (const char *) __THROW;
++int           sym_ston (const struct res_sym *, const char *, int *) __THROW;
++const char *  sym_ntos (const struct res_sym *, int, int *) __THROW;
++const char *  sym_ntop (const struct res_sym *, int, int *) __THROW;
++int           b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
++int           b64_pton (char const *, u_char *, size_t) __THROW;
++int           loc_aton (const char *__ascii, u_char *__binary) __THROW;
++const char *  loc_ntoa (const u_char *__binary, char *__ascii) __THROW;
++int           dn_skipname (const u_char *, const u_char *) __THROW;
++void          putlong (u_int32_t, u_char *) __THROW;
++void          putshort (u_int16_t, u_char *) __THROW;
++const char *  p_class (int) __THROW;
++const char *  p_time (u_int32_t) __THROW;
++const char *  p_type (int) __THROW;
++const char *  p_rcode (int) __THROW;
++const u_char *        p_cdnname (const u_char *, const u_char *, int, FILE *)
++     __THROW;
++const u_char *        p_cdname (const u_char *, const u_char *, FILE *) 
__THROW;
++const u_char *        p_fqnname (const u_char *__cp, const u_char *__msg,
++                         int, char *, int) __THROW;
++const u_char *        p_fqname (const u_char *, const u_char *, FILE *) 
__THROW;
++const char *  p_option (u_long __option) __THROW;
++char *                p_secstodate (u_long) __THROW;
++int           dn_count_labels (const char *) __THROW;
++int           dn_comp (const char *, u_char *, int, u_char **, u_char **)
++     __THROW;
++int           dn_expand (const u_char *, const u_char *, const u_char *,
++                         char *, int) __THROW;
++u_int         res_randomid (void) __THROW;
++int           res_nameinquery (const char *, int, int,
++                               const u_char *, const u_char *) __THROW;
++int           res_queriesmatch (const u_char *, const u_char *,
++                                const u_char *, const u_char *) __THROW;
++const char *  p_section (int __section, int __opcode) __THROW;
++/* Things involving a resolver context. */
++int           res_ninit (res_state) __THROW;
++int           res_nisourserver (const res_state,
++                                const struct sockaddr_in *) __THROW;
++void          fp_resstat (const res_state, FILE *) __THROW;
++void          res_npquery (const res_state, const u_char *, int, FILE *)
++     __THROW;
++const char *  res_hostalias (const res_state, const char *, char *, size_t)
++     __THROW;
++int           res_nquery (res_state, const char *, int, int, u_char *, int)
++     __THROW;
++int           res_nsearch (res_state, const char *, int, int, u_char *, int)
++     __THROW;
++int           res_nquerydomain (res_state, const char *, const char *, int,
++                                int, u_char *, int) __THROW;
++int           res_nmkquery (res_state, int, const char *, int, int,
++                            const u_char *, int, const u_char *, u_char *,
++                            int) __THROW;
++int           res_nsend (res_state, const u_char *, int, u_char *, int)
++     __THROW;
++void          res_nclose (res_state) __THROW;
++__END_DECLS
++#endif
++
++#endif /* !_RESOLV_H_ */
+Index: glibc-2.19/configure
+===================================================================
+--- glibc-2.19.orig/configure
++++ glibc-2.19/configure
+@@ -7387,7 +7387,7 @@ RELEASE=`sed -n -e 's/^#define RELEASE "
+ 
+ 
+ 
+-ac_config_files="$ac_config_files config.make Makefile"
++ac_config_files="$ac_config_files config.make Makefile nss/db-Makefile 
resolv/netdb.h resolv/resolv.h"
+ 
+ ac_config_commands="$ac_config_commands default"
+ 
+@@ -8107,6 +8107,9 @@ do
+     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+     "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;;
+     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++    "nss/db-Makefile") CONFIG_FILES="$CONFIG_FILES nss/db-Makefile" ;;
++    "resolv/netdb.h") CONFIG_FILES="$CONFIG_FILES resolv/netdb.h" ;;
++    "resolv/resolv.h") CONFIG_FILES="$CONFIG_FILES resolv/resolv.h" ;;
+     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ 
+   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

diff --git 
a/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch 
b/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch
new file mode 100644
index 0000000..341d8c5
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch
@@ -0,0 +1,30 @@
+Prevent default-fPIE from confusing configure into thinking
+PIC code is default.  This causes glibc to build both PIC and
+non-PIC code as normal, which on the hardened compiler generates
+PIC and PIE.
+
+Patch by Kevin F. Quinn <[email protected]>
+Fixed for glibc 2.19 by Magnus Granberg <[email protected]>
+
+--- configure.ac
++++ configure.ac
+@@ -2145,7 +2145,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; 
then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 
1>&AS_MESSAGE_LOG_FD"; then
+   libc_cv_pic_default=no
+ fi
+ rm -f conftest.*])
+--- configure
++++ configure
+@@ -7698,7 +7698,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
+   libc_cv_pic_default=no
+ fi
+ rm -f conftest.*

diff --git a/sys-libs/glibc/glibc-2.19-r1.ebuild 
b/sys-libs/glibc/glibc-2.19-r1.ebuild
new file mode 100644
index 0000000..875a8f0
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.19-r1.ebuild
@@ -0,0 +1,230 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.19-r1.ebuild,v 1.11 
2014/10/26 08:05:50 vapier Exp $
+
+inherit eutils versionator toolchain-funcs flag-o-matic gnuconfig multilib 
systemd unpacker multiprocessing
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="http://www.gnu.org/software/libc/libc.html";
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc 
x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+       EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+       EGIT_SOURCEDIRS="${S}"
+       inherit git-2
+       ;;
+*)
+       RELEASE_VER=${PV}
+       ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="3"                                  # Gentoo patchset
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"}       # min kernel version nptl 
requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla 
crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+#  CTARGET - machine that will target the binaries
+#  CHOST   - machine that will host the binaries
+#  CBUILD  - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+#  CBUILD = CHOST = CTARGET    - native build/install
+#  CBUILD != (CHOST = CTARGET) - cross-compile a native build
+#  (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+#  CBUILD != CHOST != CTARGET  - cross-compile a libc for a cross-compiler
+# For install paths:
+#  CHOST = CTARGET  - install into /
+#  CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+       if [[ ${CATEGORY} == cross-* ]] ; then
+               export CTARGET=${CATEGORY#cross-}
+       fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
+
+is_crosscompile() {
+       [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+       !<sys-apps/sandbox-1.6
+       !<sys-apps/portage-2.1.2
+       selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+       selinux? ( sys-libs/libselinux )
+       !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+       DEPEND+=" !crosscompile_opts_headers-only? (
+               >=${CATEGORY}/binutils-2.20
+               >=${CATEGORY}/gcc-4.3
+       )"
+       [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+       DEPEND+="
+               >=sys-devel/binutils-2.20
+               >=sys-devel/gcc-4.3
+               virtual/os-headers
+               !vanilla? ( >=sys-libs/timezone-data-2012c )"
+       RDEPEND+="
+               vanilla? ( !sys-libs/timezone-data )
+               !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+       echo mirror://gnu/glibc/$1 
ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+       local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+       devspace=${devspace//HTTP/http://dev.gentoo.org/}
+       echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+       [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+       [[ -n ${PATCH_VER}      ]] && gentoo_uris 
${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris 
gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+# eblit-include [--skip] <function> [version]
+eblit-include() {
+       local skipable=false
+       [[ $1 == "--skip" ]] && skipable=true && shift
+       [[ $1 == pkg_* ]] && skipable=true
+
+       local e v func=$1 ver=$2
+       [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
+       for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
+               e="${FILESDIR}/eblits/${func}${v}.eblit"
+               if [[ -e ${e} ]] ; then
+                       source "${e}"
+                       return 0
+               fi
+       done
+       ${skipable} && return 0
+       die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
+}
+
+# eblit-run-maybe <function>
+# run the specified function if it is defined
+eblit-run-maybe() {
+       [[ $(type -t "$@") == "function" ]] && "$@"
+}
+
+# eblit-run <function> [version]
+# aka: src_unpack() { eblit-run src_unpack ; }
+eblit-run() {
+       eblit-include --skip common "${*:2}"
+       eblit-include "$@"
+       eblit-run-maybe eblit-$1-pre
+       eblit-${PN}-$1
+       eblit-run-maybe eblit-$1-post
+}
+
+src_unpack()  { eblit-run src_unpack  ; }
+src_compile() { eblit-run src_compile ; }
+src_test()    { eblit-run src_test    ; }
+src_install() { eblit-run src_install ; }
+
+# FILESDIR might not be available during binpkg install
+for x in setup {pre,post}inst ; do
+       e="${FILESDIR}/eblits/pkg_${x}.eblit"
+       if [[ -e ${e} ]] ; then
+               . "${e}"
+               eval "pkg_${x}() { eblit-run pkg_${x} ; }"
+       fi
+done
+
+eblit-src_unpack-pre() {
+       [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack 
gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+}
+
+eblit-src_unpack-post() {
+       cd "${S}"
+
+       if use hardened ; then
+               einfo "Patching to get working PIE binaries on PIE (hardened) 
platforms"
+               gcc-specs-pie && epatch 
"${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+               epatch 
"${FILESDIR}"/2.19/glibc-2.19-hardened-configure-picdefault.patch
+               epatch 
"${FILESDIR}"/2.18/glibc-2.18-hardened-inittls-nosysenter.patch
+
+               einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE 
handler"
+               cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-stack_chk_fail.c \
+                       debug/stack_chk_fail.c || die
+               cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-chk_fail.c \
+                       debug/chk_fail.c || die
+
+               if use debug ; then
+                       # When using Hardened Gentoo stack handler, have 
smashes dump core for
+                       # analysis - debug only, as core could be an 
information leak
+                       # (paranoia).
+                       sed -i \
+                               -e '/^CFLAGS-backtrace.c/ 
iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+                               debug/Makefile \
+                               || die "Failed to modify debug/Makefile for 
debug stack handler"
+                       sed -i \
+                               -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = 
-DSSP_SMASH_DUMPS_CORE' \
+                               debug/Makefile \
+                               || die "Failed to modify debug/Makefile for 
debug fortify handler"
+               fi
+
+               # Build nscd with ssp-all
+               sed -i \
+                       -e 's:-fstack-protector$:-fstack-protector-all:' \
+                       nscd/Makefile \
+                       || die "Failed to ensure nscd builds with ssp-all"
+       fi
+
+       if use rap; then
+               if type -p lsb_release > lsb-loc; then
+                       local lsb_id=$(lsb_release -i)
+                       local lsb_rel=$(lsb_release -r)
+               fi
+
+               if [[ ${lsb_id} == *CentOS ]] || [[ ${lsb_id} == *RedHat* ]]; 
then
+                       if [[ ${lsb_rel} == 5.6 ]]; then
+                               elog "Your kernel is known to have vdso bug, 
disabling this feature"
+                               elog 
"https://bugzilla.redhat.com/show_bug.cgi?id=678613";
+                               epatch 
"${FILESDIR}"/${PV}/${P}-vdso-disable.patch
+                       fi
+               fi
+
+               epatch "${FILESDIR}"/2.17/${PN}-2.17-runtime-prefix.patch
+                       eprefixify 
sysdeps/{{generic,unix/sysv/linux}/paths.h,posix/system.c} \
+                       libio/iopopen.c
+               epatch "${FILESDIR}"/${PV}/${P}-configurable-paths.patch
+       fi
+}
+
+eblit-pkg_preinst-post() {
+       if [[ ${CTARGET} == arm* ]] ; then
+               # Backwards compat support for renaming hardfp ldsos #417287
+               local oldso='/lib/ld-linux.so.3'
+               local nldso='/lib/ld-linux-armhf.so.3'
+               if [[ -e ${D}${nldso} ]] ; then
+                       if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s 
"^${oldso}" ; then
+                               ewarn "Symlinking old ldso (${oldso}) to new 
ldso (${nldso})."
+                               ewarn "Please rebuild all packages using this 
old ldso as compat"
+                               ewarn "support will be dropped in the future."
+                               ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+                       fi
+               fi
+       fi
+}

Reply via email to