View | Details | Raw Unified | Return to bug 219963 | Differences between
and this patch

Collapse All | Expand All

(-)b/Mk/Uses/gecko.mk (-2 / +2 lines)
Lines 37-48 RUN_DEPENDS+= libxul>=45:www/libxul Link Here
37
.elif ${gecko_ARGS:Mfirefox}
37
.elif ${gecko_ARGS:Mfirefox}
38
38
39
_GECKO_DEFAULT_VERSION=	52
39
_GECKO_DEFAULT_VERSION=	52
40
_GECKO_VERSIONS=		52 54
40
_GECKO_VERSIONS=		52 55
41
_GECKO_TYPE=	firefox
41
_GECKO_TYPE=	firefox
42
42
43
# Dependence lines for different Firefox versions
43
# Dependence lines for different Firefox versions
44
52_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox-esr
44
52_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox-esr
45
54_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox
45
55_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox
46
46
47
.if exists(${LOCALBASE}/bin/firefox)
47
.if exists(${LOCALBASE}/bin/firefox)
48
_GECKO_INSTALLED_VER!=	${LOCALBASE}/bin/firefox --version 2>/dev/null
48
_GECKO_INSTALLED_VER!=	${LOCALBASE}/bin/firefox --version 2>/dev/null
(-)b/www/firefox-i18n/Makefile (-2 / +2 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	firefox-i18n
4
PORTNAME=	firefox-i18n
5
PORTVERSION=	54.0.1
5
PORTVERSION=	55.0b9
6
CATEGORIES=	www
6
CATEGORIES=	www
7
MASTER_SITES=	MOZILLA/${PORTNAME:S|-i18n||}/releases/${DISTVERSION}/linux-i686/xpi \
7
MASTER_SITES=	MOZILLA/${PORTNAME:S|-i18n||}/releases/${DISTVERSION}/linux-i686/xpi \
8
		MOZILLA/${PORTNAME:S|-i18n||}/candidates/${DISTVERSION}-candidates/build1/linux-i686/xpi
8
		MOZILLA/${PORTNAME:S|-i18n||}/candidates/${DISTVERSION}-candidates/build1/linux-i686/xpi
Lines 15-21 COMMENT= Localized interface for Firefox Link Here
15
15
16
EXTRACT_DEPENDS=	zip:archivers/zip
16
EXTRACT_DEPENDS=	zip:archivers/zip
17
17
18
USES=		zip:infozip gecko:firefox,54,build
18
USES=		zip:infozip gecko:firefox,55,build
19
USE_XPI=	firefox
19
USE_XPI=	firefox
20
20
21
NO_ARCH=	yes
21
NO_ARCH=	yes
(-)b/www/firefox-i18n/Makefile.lang (-1 / +4 lines)
Lines 1-7 Link Here
1
# Created by: Koji Yokota <yokota@res.otaru-uc.ac.jp>
1
# Created by: Koji Yokota <yokota@res.otaru-uc.ac.jp>
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
FIREFOX_I18N_ALL_=	ach af an ar as ast az bg bn-BD bn-IN br bs ca cak	\
4
FIREFOX_I18N_ALL_=	ach af an ar as ast az be bg bn-BD bn-IN br bs ca cak	\
5
			cs cy da de dsb el en-GB en-US en-ZA eo es-AR es-CL	\
5
			cs cy da de dsb el en-GB en-US en-ZA eo es-AR es-CL	\
6
			es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn	\
6
			es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn	\
7
			gu-IN he hi-IN hr hsb hu hy-AM id is it ja ka kab	\
7
			gu-IN he hi-IN hr hsb hu hy-AM id is it ja ka kab	\
Lines 33-38 FIREFOX_I18N+= ast Link Here
33
.if ${PORT_OPTIONS:MLANG_AZ}
33
.if ${PORT_OPTIONS:MLANG_AZ}
34
FIREFOX_I18N+=  az
34
FIREFOX_I18N+=  az
35
.endif
35
.endif
36
.if ${PORT_OPTIONS:MLANG_BE}
37
FIREFOX_I18N+=	be
38
.endif
36
.if ${PORT_OPTIONS:MLANG_BG}
39
.if ${PORT_OPTIONS:MLANG_BG}
37
FIREFOX_I18N+=  bg
40
FIREFOX_I18N+=  bg
38
.endif
41
.endif
(-)b/www/firefox-i18n/Makefile.option (+1 lines)
Lines 9-14 OPTIONS_DEFINE= LANG_ACH \ Link Here
9
		LANG_AS \
9
		LANG_AS \
10
		LANG_AST \
10
		LANG_AST \
11
		LANG_AZ \
11
		LANG_AZ \
12
		LANG_BE \
12
		LANG_BG \
13
		LANG_BG \
13
		LANG_BB \
14
		LANG_BB \
14
		LANG_BN \
15
		LANG_BN \
(-)b/www/firefox-i18n/distinfo (-189 / +191 lines)
Lines 1-189 Link Here
1
TIMESTAMP = 1498670356
1
TIMESTAMP = 1499984982
2
SHA256 (xpi/firefox-i18n-54.0.1/ach.xpi) = 2ac6571fee99dbb0886e6b4d75d9ed9b793b5a2551413d0969c4b443e797b9a8
2
SHA256 (xpi/firefox-i18n-55.0b9/ach.xpi) = d9e3383b8e2f45491f3b429c51810f7b89961d1c73d8c7f5522e87e273b28b36
3
SIZE (xpi/firefox-i18n-54.0.1/ach.xpi) = 426785
3
SIZE (xpi/firefox-i18n-55.0b9/ach.xpi) = 447506
4
SHA256 (xpi/firefox-i18n-54.0.1/af.xpi) = 86e4a12e511e7a88b7eb762b0755984e72b8774c77398481609237e9ca44b4a5
4
SHA256 (xpi/firefox-i18n-55.0b9/af.xpi) = 9cee3e9c6fe77c2449018f1c2ff210b9308ad6b02d4acf5a4afc15869bd70070
5
SIZE (xpi/firefox-i18n-54.0.1/af.xpi) = 436585
5
SIZE (xpi/firefox-i18n-55.0b9/af.xpi) = 448927
6
SHA256 (xpi/firefox-i18n-54.0.1/an.xpi) = a925947a8d77450357b2e85454c8b02b71f2553a6abc373d6ef865a098acef6a
6
SHA256 (xpi/firefox-i18n-55.0b9/an.xpi) = 743aa0d3b4900b0d3fbf9424811079bba083113e7fa5c3069da8d929d1112248
7
SIZE (xpi/firefox-i18n-54.0.1/an.xpi) = 445344
7
SIZE (xpi/firefox-i18n-55.0b9/an.xpi) = 468639
8
SHA256 (xpi/firefox-i18n-54.0.1/ar.xpi) = 8e7d0af2143a5df4f93fb70d0e240180b897320234d9e0f17274f996c9e7ca29
8
SHA256 (xpi/firefox-i18n-55.0b9/ar.xpi) = 9227408f03b1bf73aacf225a23c48cdc94edeaf0e074fd999853c57f4f8d70bd
9
SIZE (xpi/firefox-i18n-54.0.1/ar.xpi) = 473124
9
SIZE (xpi/firefox-i18n-55.0b9/ar.xpi) = 492762
10
SHA256 (xpi/firefox-i18n-54.0.1/as.xpi) = 3f4f218ce4da291d008630f20b29d032182f8c5356c387be81a55616881585d3
10
SHA256 (xpi/firefox-i18n-55.0b9/as.xpi) = 9ae1c0a2681a42412b1939e3ae78bc49fd00c45be07ae94fce1fd5e5c6fbf8c4
11
SIZE (xpi/firefox-i18n-54.0.1/as.xpi) = 484171
11
SIZE (xpi/firefox-i18n-55.0b9/as.xpi) = 501510
12
SHA256 (xpi/firefox-i18n-54.0.1/ast.xpi) = b215e69042c029156b8e787c03f9504beb5e056ea71f0e8e6eb706205f8eee1f
12
SHA256 (xpi/firefox-i18n-55.0b9/ast.xpi) = 7b81e42d5cd8924aa6633da2d6c1090a2975794907dc23254d7a94364e2312b1
13
SIZE (xpi/firefox-i18n-54.0.1/ast.xpi) = 440269
13
SIZE (xpi/firefox-i18n-55.0b9/ast.xpi) = 460843
14
SHA256 (xpi/firefox-i18n-54.0.1/az.xpi) = a092eb7b69b97e44a375ac1244a8f1bfc48acfd7d99051350803632273164e68
14
SHA256 (xpi/firefox-i18n-55.0b9/az.xpi) = 196bfd443e2ed7b16d507abce0a6b3fb2969d1ce0c0c479b1a51332af2b36011
15
SIZE (xpi/firefox-i18n-54.0.1/az.xpi) = 454243
15
SIZE (xpi/firefox-i18n-55.0b9/az.xpi) = 475369
16
SHA256 (xpi/firefox-i18n-54.0.1/bg.xpi) = 2d12828369f44e8c805e2825946cec5ef040585a92b35c89ff17aceac8a0a83d
16
SHA256 (xpi/firefox-i18n-55.0b9/be.xpi) = 3bf65a2e19618cd53085a9530619d10f8df44cd94ba87ca230f97aa3c8fd9ccd
17
SIZE (xpi/firefox-i18n-54.0.1/bg.xpi) = 485835
17
SIZE (xpi/firefox-i18n-55.0b9/be.xpi) = 522577
18
SHA256 (xpi/firefox-i18n-54.0.1/bn-BD.xpi) = ab3a823e662776edf0aeaf9c4535f451ebe4e8ad5811023377ca88eebef56306
18
SHA256 (xpi/firefox-i18n-55.0b9/bg.xpi) = f0c33195d12d746b8c49d82a3fae540ea8ae65af4994662d80f9bb13ce5b8d39
19
SIZE (xpi/firefox-i18n-54.0.1/bn-BD.xpi) = 508867
19
SIZE (xpi/firefox-i18n-55.0b9/bg.xpi) = 520013
20
SHA256 (xpi/firefox-i18n-54.0.1/bn-IN.xpi) = 0acff03ac54f2a4609c626d4e5b461c0abacb8b24d6df4dc1b3f2cffc6baffa7
20
SHA256 (xpi/firefox-i18n-55.0b9/bn-BD.xpi) = c30f7104d0e015eb9741d11dc280bbc176526d03e657f0f290362a3075a52416
21
SIZE (xpi/firefox-i18n-54.0.1/bn-IN.xpi) = 506168
21
SIZE (xpi/firefox-i18n-55.0b9/bn-BD.xpi) = 535118
22
SHA256 (xpi/firefox-i18n-54.0.1/br.xpi) = e164f7ba23ce3fac8240f9f3cb3b44dd0555c558550d0f9fc98cbfa5eb05de8d
22
SHA256 (xpi/firefox-i18n-55.0b9/bn-IN.xpi) = 9da03fc9aef3722c6be39c16f486a7f8d65bdc5e64df4839689659c3305ce372
23
SIZE (xpi/firefox-i18n-54.0.1/br.xpi) = 434372
23
SIZE (xpi/firefox-i18n-55.0b9/bn-IN.xpi) = 526356
24
SHA256 (xpi/firefox-i18n-54.0.1/bs.xpi) = 7b74a68b66b6763922cfa08ed8c2dab8dad64fe4b8cd8e51f3b023c635d0dddc
24
SHA256 (xpi/firefox-i18n-55.0b9/br.xpi) = 6a9477a9f87743ace82bd3228c0ba151ac5f89dabd5b061f293f7ac8891729c8
25
SIZE (xpi/firefox-i18n-54.0.1/bs.xpi) = 441131
25
SIZE (xpi/firefox-i18n-55.0b9/br.xpi) = 456857
26
SHA256 (xpi/firefox-i18n-54.0.1/ca.xpi) = 104ae2cc9b629669005648e5fb2e7cad06965eb700c6246bacc8874c48180b82
26
SHA256 (xpi/firefox-i18n-55.0b9/bs.xpi) = c60d2e21621be1b1cf671100b16746f3f18216055c2c823ac9db76684b511a1f
27
SIZE (xpi/firefox-i18n-54.0.1/ca.xpi) = 443027
27
SIZE (xpi/firefox-i18n-55.0b9/bs.xpi) = 465027
28
SHA256 (xpi/firefox-i18n-54.0.1/cak.xpi) = aced374c69e3cd85800b685bd1003b290b58f0a37c870e42badce50c740a0a36
28
SHA256 (xpi/firefox-i18n-55.0b9/ca.xpi) = 2413608164d8f8e0e6bd691026a3d46b43dd5451a32eee3ab73abb3bd6f9d55f
29
SIZE (xpi/firefox-i18n-54.0.1/cak.xpi) = 458232
29
SIZE (xpi/firefox-i18n-55.0b9/ca.xpi) = 473019
30
SHA256 (xpi/firefox-i18n-54.0.1/cs.xpi) = 937ab90c522119406605eb0051f81dbe0a0c716826cf222cee532bbaeeb049ac
30
SHA256 (xpi/firefox-i18n-55.0b9/cak.xpi) = e080ed820ac5d124c1d6f662ab0428c475e6829d5ae87a21f3e2228992ab146c
31
SIZE (xpi/firefox-i18n-54.0.1/cs.xpi) = 443929
31
SIZE (xpi/firefox-i18n-55.0b9/cak.xpi) = 481772
32
SHA256 (xpi/firefox-i18n-54.0.1/cy.xpi) = 6a095bdbe2c274da1772c87914aad3ca4a788f6f3a0d3a10d9432cfdf646a6a3
32
SHA256 (xpi/firefox-i18n-55.0b9/cs.xpi) = 1c4645945579f5fb689dd10919abac5931e32833c62ea3cde998a8cde6bd876a
33
SIZE (xpi/firefox-i18n-54.0.1/cy.xpi) = 436310
33
SIZE (xpi/firefox-i18n-55.0b9/cs.xpi) = 476812
34
SHA256 (xpi/firefox-i18n-54.0.1/da.xpi) = 1a0d5e22c79b0f558031b14edc8aa8a4dd1ce0a5c418549c68c8223c5ab7a7f9
34
SHA256 (xpi/firefox-i18n-55.0b9/cy.xpi) = 62bd91b85722e065919725d8761914f61068fd9e1600be71bd2c95729049427c
35
SIZE (xpi/firefox-i18n-54.0.1/da.xpi) = 423766
35
SIZE (xpi/firefox-i18n-55.0b9/cy.xpi) = 458731
36
SHA256 (xpi/firefox-i18n-54.0.1/de.xpi) = 1bc9004a9aa4f41245c610ab0c239496cd649157e8ad7bbb89feb83585889b60
36
SHA256 (xpi/firefox-i18n-55.0b9/da.xpi) = f59ce3f901112b1bac2c4e8c69568b50e2a7a46dfbc13d4c73606bad009defb4
37
SIZE (xpi/firefox-i18n-54.0.1/de.xpi) = 442814
37
SIZE (xpi/firefox-i18n-55.0b9/da.xpi) = 452520
38
SHA256 (xpi/firefox-i18n-54.0.1/dsb.xpi) = 0946b957ff6765bd30171477394ed5e0345cc3c6dadf1fee07b85a57d789515d
38
SHA256 (xpi/firefox-i18n-55.0b9/de.xpi) = 794306d7daf232c0a3fff16c087aebd43a8371f821a9173875a7d5e9085757d6
39
SIZE (xpi/firefox-i18n-54.0.1/dsb.xpi) = 458691
39
SIZE (xpi/firefox-i18n-55.0b9/de.xpi) = 465458
40
SHA256 (xpi/firefox-i18n-54.0.1/el.xpi) = 60f7e95db941c2c2b9bdbbb7b4c601badd2cc92f59c716e3ea82294fb7078e63
40
SHA256 (xpi/firefox-i18n-55.0b9/dsb.xpi) = 3e024740c3fbac5e926333f1de69fb80d6094c229ea244fef69bac156c4bdcf7
41
SIZE (xpi/firefox-i18n-54.0.1/el.xpi) = 511228
41
SIZE (xpi/firefox-i18n-55.0b9/dsb.xpi) = 482082
42
SHA256 (xpi/firefox-i18n-54.0.1/en-GB.xpi) = 50b09222acad38c4d2a878850905b55cd399f5923fa9aa2b2fa118a48560883e
42
SHA256 (xpi/firefox-i18n-55.0b9/el.xpi) = 70a800178d02af136d01078671f881ff0ac894e70d2e41ca79b614a75c56452e
43
SIZE (xpi/firefox-i18n-54.0.1/en-GB.xpi) = 419545
43
SIZE (xpi/firefox-i18n-55.0b9/el.xpi) = 539781
44
SHA256 (xpi/firefox-i18n-54.0.1/en-US.xpi) = 14e0d08ce9fd79cd1b9ade2c19d92b255b758384c7e7e608d573beed36f639a3
44
SHA256 (xpi/firefox-i18n-55.0b9/en-GB.xpi) = 9c6cd3d0b09169250795ae6a40efbe65ec703be37e0a8ffd67550d82721688bf
45
SIZE (xpi/firefox-i18n-54.0.1/en-US.xpi) = 425757
45
SIZE (xpi/firefox-i18n-55.0b9/en-GB.xpi) = 439573
46
SHA256 (xpi/firefox-i18n-54.0.1/en-ZA.xpi) = 1fcea8c4bd696913c4d93fdd8dc3569707de035e6b5ed4808892e85a8945b58f
46
SHA256 (xpi/firefox-i18n-55.0b9/en-US.xpi) = 5caf8ec0abed31549af6d2033d47af428898c3d45d31bc7d1d7968f3a8a2c150
47
SIZE (xpi/firefox-i18n-54.0.1/en-ZA.xpi) = 413431
47
SIZE (xpi/firefox-i18n-55.0b9/en-US.xpi) = 439815
48
SHA256 (xpi/firefox-i18n-54.0.1/eo.xpi) = d32c2f771aea465c62c4b9d782fccc1d22969be3ea827027d7acdb592ee66e19
48
SHA256 (xpi/firefox-i18n-55.0b9/en-ZA.xpi) = 3712d5010c2294bed961182777aa9b710381ccd18a8689d9c9ca47070469fc26
49
SIZE (xpi/firefox-i18n-54.0.1/eo.xpi) = 437027
49
SIZE (xpi/firefox-i18n-55.0b9/en-ZA.xpi) = 438623
50
SHA256 (xpi/firefox-i18n-54.0.1/es-AR.xpi) = c1b6a6ffdf9f74d653f72cf3157b820b95eddf26fabc72be3d2bae84457f5d78
50
SHA256 (xpi/firefox-i18n-55.0b9/eo.xpi) = f37150f3d4a32f6dd295d956bd9b00f49d7ef9e50d7dad5d2bf2cf14345a1177
51
SIZE (xpi/firefox-i18n-54.0.1/es-AR.xpi) = 445558
51
SIZE (xpi/firefox-i18n-55.0b9/eo.xpi) = 459159
52
SHA256 (xpi/firefox-i18n-54.0.1/es-CL.xpi) = 222dd573b6f877926bee2d58963366b670a4d5176c839663073da1bb6ff51eb5
52
SHA256 (xpi/firefox-i18n-55.0b9/es-AR.xpi) = 7ee689b5d7601d93c08b8d02c96ef5b874f637a271a37a484b464fa4b3b6e1c1
53
SIZE (xpi/firefox-i18n-54.0.1/es-CL.xpi) = 445585
53
SIZE (xpi/firefox-i18n-55.0b9/es-AR.xpi) = 467619
54
SHA256 (xpi/firefox-i18n-54.0.1/es-ES.xpi) = 494983532ee064521a37d90cbfbef46d0fab37fe82d4d72b3ade3c539db3585b
54
SHA256 (xpi/firefox-i18n-55.0b9/es-CL.xpi) = 4886dadb81e24257b418f2439b54959b139dac4296549fbbeb0ea7828b12e04d
55
SIZE (xpi/firefox-i18n-54.0.1/es-ES.xpi) = 341281
55
SIZE (xpi/firefox-i18n-55.0b9/es-CL.xpi) = 471602
56
SHA256 (xpi/firefox-i18n-54.0.1/es-MX.xpi) = 3a74d108671f717c3bb5954298eb396c861aa902cf7c426cc2cc02ecc15f6dbf
56
SHA256 (xpi/firefox-i18n-55.0b9/es-ES.xpi) = ea9719950f42b7fbc62d24158388d12f4eafa335ac1d4f67706d101123eb72bd
57
SIZE (xpi/firefox-i18n-54.0.1/es-MX.xpi) = 447976
57
SIZE (xpi/firefox-i18n-55.0b9/es-ES.xpi) = 359825
58
SHA256 (xpi/firefox-i18n-54.0.1/et.xpi) = 4a926107e99dd4bd6a8b6089f08fc53a33f5fb7d55dab8197121558bfc8df1d8
58
SHA256 (xpi/firefox-i18n-55.0b9/es-MX.xpi) = 879dd25a93c0d4eaa52add7337cb1a6805da3b626b5500137f2824e03d7bf7fd
59
SIZE (xpi/firefox-i18n-54.0.1/et.xpi) = 423855
59
SIZE (xpi/firefox-i18n-55.0b9/es-MX.xpi) = 474246
60
SHA256 (xpi/firefox-i18n-54.0.1/eu.xpi) = 17fc4a655d72a25ed1acc41276fcdd22f5c3662c87b61bca48195345d45f5a3a
60
SHA256 (xpi/firefox-i18n-55.0b9/et.xpi) = 7e4bf4cee9dc632b6de4f390c93c16e5991c75077cec343a7601b109ba8d3727
61
SIZE (xpi/firefox-i18n-54.0.1/eu.xpi) = 438025
61
SIZE (xpi/firefox-i18n-55.0b9/et.xpi) = 454473
62
SHA256 (xpi/firefox-i18n-54.0.1/fa.xpi) = 325b3a51f4e5adb0fad02fe050d43d6bfd3b0f6f8bcec24eeccc93df4e2a61da
62
SHA256 (xpi/firefox-i18n-55.0b9/eu.xpi) = 005a9ae4e4df00ec57c79e9395179a604abefe33b706dfff69512de22e904a63
63
SIZE (xpi/firefox-i18n-54.0.1/fa.xpi) = 490360
63
SIZE (xpi/firefox-i18n-55.0b9/eu.xpi) = 460415
64
SHA256 (xpi/firefox-i18n-54.0.1/ff.xpi) = 7f3616ce409ef5a709321b230541236c0654848b943f7f08e538d8f9606290c5
64
SHA256 (xpi/firefox-i18n-55.0b9/fa.xpi) = ef7ec2f65f39197e94655a45e5131046a4fe261e04f2dcaadf4ea79359fdfa6a
65
SIZE (xpi/firefox-i18n-54.0.1/ff.xpi) = 441539
65
SIZE (xpi/firefox-i18n-55.0b9/fa.xpi) = 511562
66
SHA256 (xpi/firefox-i18n-54.0.1/fi.xpi) = 1e124737d0d1a51f8edfa2452e39db0da28068fa0a8ba1de97d8a5a8fceac5d2
66
SHA256 (xpi/firefox-i18n-55.0b9/ff.xpi) = ee965329780e7360da73575f87029fd15dd25f41db7de3a4898c991e4bab6c30
67
SIZE (xpi/firefox-i18n-54.0.1/fi.xpi) = 428998
67
SIZE (xpi/firefox-i18n-55.0b9/ff.xpi) = 455297
68
SHA256 (xpi/firefox-i18n-54.0.1/fr.xpi) = a77a3ff17a868e64fa45f3543a43a7a35b7c2a8b63a83a9f3ab25ade74252c81
68
SHA256 (xpi/firefox-i18n-55.0b9/fi.xpi) = 2b841b56abda7a38fe7e6087844796b226cb43e0619bae0cd35afae63d054a10
69
SIZE (xpi/firefox-i18n-54.0.1/fr.xpi) = 451596
69
SIZE (xpi/firefox-i18n-55.0b9/fi.xpi) = 453948
70
SHA256 (xpi/firefox-i18n-54.0.1/fy-NL.xpi) = c604b47608caaef2101a1465efdbd70519ceef08d06a7527934a5b612a0af65c
70
SHA256 (xpi/firefox-i18n-55.0b9/fr.xpi) = 1f5fb2631956d2ac91b2b14782d833a45e3f50ccb015b5aa93780aeced47509c
71
SIZE (xpi/firefox-i18n-54.0.1/fy-NL.xpi) = 444473
71
SIZE (xpi/firefox-i18n-55.0b9/fr.xpi) = 476671
72
SHA256 (xpi/firefox-i18n-54.0.1/ga-IE.xpi) = 78e5c09e43ae6c8f0ce17e16c26a50e64a5ec6c71f942c3c3fd78c3087ea6dd5
72
SHA256 (xpi/firefox-i18n-55.0b9/fy-NL.xpi) = 3a866da87ca7d1e419afb94863eed6209897b748f6844d57ed707f6afbfb526a
73
SIZE (xpi/firefox-i18n-54.0.1/ga-IE.xpi) = 457484
73
SIZE (xpi/firefox-i18n-55.0b9/fy-NL.xpi) = 469969
74
SHA256 (xpi/firefox-i18n-54.0.1/gd.xpi) = 8ee562188ed70c78e997215c4c00d9a1f97360dcee5ea430cf6830405c69d40f
74
SHA256 (xpi/firefox-i18n-55.0b9/ga-IE.xpi) = a863a5b57745a229523ab0deec6eb0af318196c6bb58aae18f67b050a006758d
75
SIZE (xpi/firefox-i18n-54.0.1/gd.xpi) = 446084
75
SIZE (xpi/firefox-i18n-55.0b9/ga-IE.xpi) = 481442
76
SHA256 (xpi/firefox-i18n-54.0.1/gl.xpi) = d1b440764c3a50c5e69369d459e2ec1be1bded24096d6c33fe09af12b74e0b47
76
SHA256 (xpi/firefox-i18n-55.0b9/gd.xpi) = ec27bdb0129d14ea21249cb80f46e6bf639cd6a7b0ebd09b4c20e9064a2ebced
77
SIZE (xpi/firefox-i18n-54.0.1/gl.xpi) = 443277
77
SIZE (xpi/firefox-i18n-55.0b9/gd.xpi) = 469057
78
SHA256 (xpi/firefox-i18n-54.0.1/gn.xpi) = 1c43832720ff7355b5edc8d95e112395abc18c810840de5c2b768a1756b9a981
78
SHA256 (xpi/firefox-i18n-55.0b9/gl.xpi) = 8597d98d51774bcd81c8f22b4edfbf9fee8e76e18c0695892a7f858fa2815f45
79
SIZE (xpi/firefox-i18n-54.0.1/gn.xpi) = 456068
79
SIZE (xpi/firefox-i18n-55.0b9/gl.xpi) = 459113
80
SHA256 (xpi/firefox-i18n-54.0.1/gu-IN.xpi) = ddcda3eaf8c04d3eccde0a86e3a95642377d9881849599c8150a9751ee129a93
80
SHA256 (xpi/firefox-i18n-55.0b9/gn.xpi) = d23208ec658adfbae1694050cf9b2f134a5d710035b5d5cf858ea3fe918cf595
81
SIZE (xpi/firefox-i18n-54.0.1/gu-IN.xpi) = 487118
81
SIZE (xpi/firefox-i18n-55.0b9/gn.xpi) = 476202
82
SHA256 (xpi/firefox-i18n-54.0.1/he.xpi) = 99b4ea64591e975b5207418812e8b178f1d139fec32d1042d86f69563ca182ae
82
SHA256 (xpi/firefox-i18n-55.0b9/gu-IN.xpi) = edc5e17fd0853fe3765b5e1e035fd7d9b09c711faf19f7feffd7ad5d5364b6c4
83
SIZE (xpi/firefox-i18n-54.0.1/he.xpi) = 454287
83
SIZE (xpi/firefox-i18n-55.0b9/gu-IN.xpi) = 498983
84
SHA256 (xpi/firefox-i18n-54.0.1/hi-IN.xpi) = 4031a32ad3f54f38aac8748839404e3ac9da1c2c46ecfe80c59ed31d5a2dd3ff
84
SHA256 (xpi/firefox-i18n-55.0b9/he.xpi) = b729f53c7ed86fdc65ad700d70eee0da8674558b13ce809c43b319c05f385160
85
SIZE (xpi/firefox-i18n-54.0.1/hi-IN.xpi) = 504632
85
SIZE (xpi/firefox-i18n-55.0b9/he.xpi) = 479884
86
SHA256 (xpi/firefox-i18n-54.0.1/hr.xpi) = 9e9c3133951e1af4c71aa3f0583102a78420aec89c6b5ba270b5695b554d5578
86
SHA256 (xpi/firefox-i18n-55.0b9/hi-IN.xpi) = e0f60f1adf0c649e1f7703efd0bbf50c292fe4a1e50b5bb7f3cc0f7a1564be35
87
SIZE (xpi/firefox-i18n-54.0.1/hr.xpi) = 447780
87
SIZE (xpi/firefox-i18n-55.0b9/hi-IN.xpi) = 530573
88
SHA256 (xpi/firefox-i18n-54.0.1/hsb.xpi) = 3e1756b6ebd88994d14cd46bd93bb83041f2da4e33df22a21c27fcd158dd70a8
88
SHA256 (xpi/firefox-i18n-55.0b9/hr.xpi) = cf723a591824833db35d3c7982589d56d54b3948f52080d9b3e508694d1cafba
89
SIZE (xpi/firefox-i18n-54.0.1/hsb.xpi) = 456528
89
SIZE (xpi/firefox-i18n-55.0b9/hr.xpi) = 467994
90
SHA256 (xpi/firefox-i18n-54.0.1/hu.xpi) = 5050f78682cf02e180005fa305751bf65dc12b76e1b0d15178d553a1ab8aae25
90
SHA256 (xpi/firefox-i18n-55.0b9/hsb.xpi) = c3fe484e5c44cbe3e984a07f5128276a6d5a09eae6afb15a234ae8957327d0c2
91
SIZE (xpi/firefox-i18n-54.0.1/hu.xpi) = 451123
91
SIZE (xpi/firefox-i18n-55.0b9/hsb.xpi) = 479801
92
SHA256 (xpi/firefox-i18n-54.0.1/hy-AM.xpi) = eef38f7bbaf2f6d3ec282931eeb0032951e44db39469cbf532ae8883c887217f
92
SHA256 (xpi/firefox-i18n-55.0b9/hu.xpi) = 750542ddd332aa6a4ef3740f7ba84840884eabe638989cdd404770f688193bf4
93
SIZE (xpi/firefox-i18n-54.0.1/hy-AM.xpi) = 496020
93
SIZE (xpi/firefox-i18n-55.0b9/hu.xpi) = 481629
94
SHA256 (xpi/firefox-i18n-54.0.1/id.xpi) = b5c619719efee4a36e2b5008f6ce2cb4251faa9308f59502909933e14836f36f
94
SHA256 (xpi/firefox-i18n-55.0b9/hy-AM.xpi) = ec2fab1b89512d6d202a6b4e0dd03a4533ed65a275aac04d8e02e2c49130df29
95
SIZE (xpi/firefox-i18n-54.0.1/id.xpi) = 425284
95
SIZE (xpi/firefox-i18n-55.0b9/hy-AM.xpi) = 520884
96
SHA256 (xpi/firefox-i18n-54.0.1/is.xpi) = d4a28ac291cd5e6649800b1babd39ec3e7dd808da15b608b16ac15e4548cd256
96
SHA256 (xpi/firefox-i18n-55.0b9/id.xpi) = 024a10512561c126a761295e1384b570318b683594225bc5d04d9ac77af10fd4
97
SIZE (xpi/firefox-i18n-54.0.1/is.xpi) = 441708
97
SIZE (xpi/firefox-i18n-55.0b9/id.xpi) = 450293
98
SHA256 (xpi/firefox-i18n-54.0.1/it.xpi) = ccadf76ba443e1ee2ce80db7a895dae99b0a7670736b78eb21cd75788b97e278
98
SHA256 (xpi/firefox-i18n-55.0b9/is.xpi) = b0114504fbe48b2221538060946c8aa397b479e810c7cf6ec8ebd61bb3fea83a
99
SIZE (xpi/firefox-i18n-54.0.1/it.xpi) = 335501
99
SIZE (xpi/firefox-i18n-55.0b9/is.xpi) = 464372
100
SHA256 (xpi/firefox-i18n-54.0.1/ja.xpi) = 820b33c1c4675fe59f8bc73328da8718bddcec6fd3b7ceeb171ff1994322dcb3
100
SHA256 (xpi/firefox-i18n-55.0b9/it.xpi) = e40ffbf29cebe5e06ca149773a992e3c79dbf3eb4a7735218964a03a2487a3cc
101
SIZE (xpi/firefox-i18n-54.0.1/ja.xpi) = 486807
101
SIZE (xpi/firefox-i18n-55.0b9/it.xpi) = 352943
102
SHA256 (xpi/firefox-i18n-54.0.1/ka.xpi) = 2d596db623a85e87c45fa698e18ad9e66733f29534be8297ef4c52e7288db8a7
102
SHA256 (xpi/firefox-i18n-55.0b9/ja.xpi) = 84fe2aec484ba82c286691a1725ede8f7757acc097f67ac396fae12a8ad35d75
103
SIZE (xpi/firefox-i18n-54.0.1/ka.xpi) = 473231
103
SIZE (xpi/firefox-i18n-55.0b9/ja.xpi) = 522437
104
SHA256 (xpi/firefox-i18n-54.0.1/kab.xpi) = a0611e7f5bebefb65a7de1b0b80b921ae01a5448c65c7218eabdd31ee292d7e6
104
SHA256 (xpi/firefox-i18n-55.0b9/ka.xpi) = 1128cd506ea8271e86ac3a005b8364dbb0b8d8e9280aa89ed1023c4455c0eb3b
105
SIZE (xpi/firefox-i18n-54.0.1/kab.xpi) = 443917
105
SIZE (xpi/firefox-i18n-55.0b9/ka.xpi) = 493539
106
SHA256 (xpi/firefox-i18n-54.0.1/kk.xpi) = 9f2d4fb392830db601a650ec0a86860a99647150d65f2a3f58d3ca5f86c667bf
106
SHA256 (xpi/firefox-i18n-55.0b9/kab.xpi) = 28154778e4b8c091d6c3c70c7400b9241259c67a612c4b82e5eb5381c299dd83
107
SIZE (xpi/firefox-i18n-54.0.1/kk.xpi) = 493048
107
SIZE (xpi/firefox-i18n-55.0b9/kab.xpi) = 470045
108
SHA256 (xpi/firefox-i18n-54.0.1/km.xpi) = 9ba58f2ad59b02905f39ab52e10c967555f4e9d4efde5832d4fed9d9acbdba06
108
SHA256 (xpi/firefox-i18n-55.0b9/kk.xpi) = e5dc46a33527849630b2fd470d8fececc1d5821f9f642417e632eae479d910a0
109
SIZE (xpi/firefox-i18n-54.0.1/km.xpi) = 517240
109
SIZE (xpi/firefox-i18n-55.0b9/kk.xpi) = 526710
110
SHA256 (xpi/firefox-i18n-54.0.1/kn.xpi) = e4ee165edd2accef0b75e7ac373be81bac94be182d9184477cee7ba72a9eefb0
110
SHA256 (xpi/firefox-i18n-55.0b9/km.xpi) = 6c2c5cb9a92900b88b7dccc8cdfa02a6e8122cf652153887a335d7ef4d3cf6de
111
SIZE (xpi/firefox-i18n-54.0.1/kn.xpi) = 516492
111
SIZE (xpi/firefox-i18n-55.0b9/km.xpi) = 540650
112
SHA256 (xpi/firefox-i18n-54.0.1/ko.xpi) = 34258d81a65b8e8d82992c359c2c864208f9cbe775b6d8503bff73639a4f38de
112
SHA256 (xpi/firefox-i18n-55.0b9/kn.xpi) = 3af51007d753bb58d202a48e50845e240abe20634bb75c658f503adad5ebe28b
113
SIZE (xpi/firefox-i18n-54.0.1/ko.xpi) = 460422
113
SIZE (xpi/firefox-i18n-55.0b9/kn.xpi) = 538863
114
SHA256 (xpi/firefox-i18n-54.0.1/lij.xpi) = 5175475d43dad7033fc3d5ff29bf2ef4b6b7c7c78aa5772494e9e0b076a83b88
114
SHA256 (xpi/firefox-i18n-55.0b9/ko.xpi) = e7ef5a6d1d1fea439c012e0ea39179357a20c09a07de26c7eb2ce0c13594bc7b
115
SIZE (xpi/firefox-i18n-54.0.1/lij.xpi) = 431675
115
SIZE (xpi/firefox-i18n-55.0b9/ko.xpi) = 494549
116
SHA256 (xpi/firefox-i18n-54.0.1/lt.xpi) = 965dac8a258b3f1fa95408f7bb1e4778a4935b0c5259f4b4cadc261a2202b9b0
116
SHA256 (xpi/firefox-i18n-55.0b9/lij.xpi) = 4e93b68af7f1540fdf0eebce9990ec7f57c7ba2e1a2fb6777727aa9793c203c2
117
SIZE (xpi/firefox-i18n-54.0.1/lt.xpi) = 451195
117
SIZE (xpi/firefox-i18n-55.0b9/lij.xpi) = 458701
118
SHA256 (xpi/firefox-i18n-54.0.1/lv.xpi) = 28fa09ca2dfa0e35fa939b1e404b38d247b921fbae83d12e84a75a3fe2d506d9
118
SHA256 (xpi/firefox-i18n-55.0b9/lt.xpi) = 19dcf321eeb4e69197b5f1d23d2e30a2ee12aae74a737a1a32cfd2a5b72c25dd
119
SIZE (xpi/firefox-i18n-54.0.1/lv.xpi) = 447753
119
SIZE (xpi/firefox-i18n-55.0b9/lt.xpi) = 481083
120
SHA256 (xpi/firefox-i18n-54.0.1/mai.xpi) = 549b205729fda9ac5b518e4fd14e482cdf53330195cac9aa5abd7a5960e6bd94
120
SHA256 (xpi/firefox-i18n-55.0b9/lv.xpi) = 671a58601ccdf455e5515364694f024a33b12d307c9fd06cf7430c1a2c2f2f19
121
SIZE (xpi/firefox-i18n-54.0.1/mai.xpi) = 497012
121
SIZE (xpi/firefox-i18n-55.0b9/lv.xpi) = 473738
122
SHA256 (xpi/firefox-i18n-54.0.1/mk.xpi) = bb71fa5d9de5b7f22e9a61846a9712039307d82e410c283ec4c5646eb1722dfc
122
SHA256 (xpi/firefox-i18n-55.0b9/mai.xpi) = 06a22bd790edb768363b2f446c626b0674f4067f9bc8b0ceb973a832b104a06b
123
SIZE (xpi/firefox-i18n-54.0.1/mk.xpi) = 493118
123
SIZE (xpi/firefox-i18n-55.0b9/mai.xpi) = 517897
124
SHA256 (xpi/firefox-i18n-54.0.1/ml.xpi) = cf8fd4617b462f10014b56d058526afe5a21c5d27437e6e7bd2d3972d6a80f5f
124
SHA256 (xpi/firefox-i18n-55.0b9/mk.xpi) = c46db01460f3bde0b2d2421dd8640a10f70548107172e6ee1b981ed95fa53a04
125
SIZE (xpi/firefox-i18n-54.0.1/ml.xpi) = 512264
125
SIZE (xpi/firefox-i18n-55.0b9/mk.xpi) = 500209
126
SHA256 (xpi/firefox-i18n-54.0.1/mr.xpi) = 5721566ae1bb2aab7bcd10ab5d6461d4828c0665e778694bfc41f7dcda7ec46b
126
SHA256 (xpi/firefox-i18n-55.0b9/ml.xpi) = 98c3bf1f1c851fd9a46fc2bef602f6de4b75197f21b79e5da23cab2c436fdc70
127
SIZE (xpi/firefox-i18n-54.0.1/mr.xpi) = 501035
127
SIZE (xpi/firefox-i18n-55.0b9/ml.xpi) = 540984
128
SHA256 (xpi/firefox-i18n-54.0.1/ms.xpi) = 1ae16e71b6fc08b3eb7bd3db4f356300e33a8eb4093587e7c553109774378541
128
SHA256 (xpi/firefox-i18n-55.0b9/mr.xpi) = c065099916792c3d463f90e3bbe2d3dc761d80267e624b36ca1bf05f7823a8d6
129
SIZE (xpi/firefox-i18n-54.0.1/ms.xpi) = 435502
129
SIZE (xpi/firefox-i18n-55.0b9/mr.xpi) = 528251
130
SHA256 (xpi/firefox-i18n-54.0.1/my.xpi) = f634472bbd81089fdcf675d4c05078b6a380b5b32f35efcfd2549ae322062ee5
130
SHA256 (xpi/firefox-i18n-55.0b9/ms.xpi) = c1d9de2123b82f4420daded17f164f56eaaff9dd739bd66f88cd3b6e60f49174
131
SIZE (xpi/firefox-i18n-54.0.1/my.xpi) = 511255
131
SIZE (xpi/firefox-i18n-55.0b9/ms.xpi) = 459507
132
SHA256 (xpi/firefox-i18n-54.0.1/nb-NO.xpi) = 64b19a30823f1ceca9790f91d663569da7e3559f56c91af6d52fe3cb12b42685
132
SHA256 (xpi/firefox-i18n-55.0b9/my.xpi) = 04e0ff8a32e4a62006aa924251d67aecb7296fd7c016a36fdcc295cd9c0d5b55
133
SIZE (xpi/firefox-i18n-54.0.1/nb-NO.xpi) = 433681
133
SIZE (xpi/firefox-i18n-55.0b9/my.xpi) = 528101
134
SHA256 (xpi/firefox-i18n-54.0.1/nl.xpi) = 3a42e931b4f4504e7459f5e976cbb6b23d2660d98751a2307fca4da5bf600579
134
SHA256 (xpi/firefox-i18n-55.0b9/nb-NO.xpi) = 9e8841bf9461349a758083c92a29af905cb4cc9b6b3b96ba43ad2e36808fac78
135
SIZE (xpi/firefox-i18n-54.0.1/nl.xpi) = 431501
135
SIZE (xpi/firefox-i18n-55.0b9/nb-NO.xpi) = 457649
136
SHA256 (xpi/firefox-i18n-54.0.1/nn-NO.xpi) = e423caf98330b9655476c5c6181b5390caccdb73c6c1260788d7d854ce2135d3
136
SHA256 (xpi/firefox-i18n-55.0b9/nl.xpi) = 2584e4557f075f8f26ae2eaea9ed0de8e63f6b942467501f32b875d3123ca06e
137
SIZE (xpi/firefox-i18n-54.0.1/nn-NO.xpi) = 427871
137
SIZE (xpi/firefox-i18n-55.0b9/nl.xpi) = 461513
138
SHA256 (xpi/firefox-i18n-54.0.1/or.xpi) = 21542c795149a5014c762ab5b0d80758228d520fbb29d5da3575bac319efcc20
138
SHA256 (xpi/firefox-i18n-55.0b9/nn-NO.xpi) = fe1649ccd3f90035fba24b4dea0adda0246dcd984bcb16868f946a579f05d554
139
SIZE (xpi/firefox-i18n-54.0.1/or.xpi) = 494082
139
SIZE (xpi/firefox-i18n-55.0b9/nn-NO.xpi) = 458459
140
SHA256 (xpi/firefox-i18n-54.0.1/pa-IN.xpi) = ff23be5a0183b9ab0f508e0454363ccb4d4ea787e234f47f506a59a53b823900
140
SHA256 (xpi/firefox-i18n-55.0b9/or.xpi) = 384ce93c67a564813688ac981040c3deaae9cd5f13729c4d27f86445287d144d
141
SIZE (xpi/firefox-i18n-54.0.1/pa-IN.xpi) = 473517
141
SIZE (xpi/firefox-i18n-55.0b9/or.xpi) = 511357
142
SHA256 (xpi/firefox-i18n-54.0.1/pl.xpi) = f5b54399bde33a78e26ed608a541641cbbd455d6f615ebadaf51a1d4a070c49b
142
SHA256 (xpi/firefox-i18n-55.0b9/pa-IN.xpi) = 74f89d6c7868b55503cd8e3ec0dac561ac86a08676f650d80a486e58709c38f8
143
SIZE (xpi/firefox-i18n-54.0.1/pl.xpi) = 347205
143
SIZE (xpi/firefox-i18n-55.0b9/pa-IN.xpi) = 498455
144
SHA256 (xpi/firefox-i18n-54.0.1/pt-BR.xpi) = d2fec0d257a63098d1815c19cfda9485898671b05cbd04d405d7aea37bab0da6
144
SHA256 (xpi/firefox-i18n-55.0b9/pl.xpi) = 93a388be9de45e6fa2ccb42147eb0bd42021f96fc9c7b2b73b828441f02237fa
145
SIZE (xpi/firefox-i18n-54.0.1/pt-BR.xpi) = 437173
145
SIZE (xpi/firefox-i18n-55.0b9/pl.xpi) = 372764
146
SHA256 (xpi/firefox-i18n-54.0.1/pt-PT.xpi) = 81ab31f6e804bb4000e82d8e5c0f1a523a06017b5c70702080b3d37e69a0cddc
146
SHA256 (xpi/firefox-i18n-55.0b9/pt-BR.xpi) = 9566eca306c31c5e96ceb88e485636f3c8af94b103f9c710fe6bcf1f279dbb4c
147
SIZE (xpi/firefox-i18n-54.0.1/pt-PT.xpi) = 436178
147
SIZE (xpi/firefox-i18n-55.0b9/pt-BR.xpi) = 462719
148
SHA256 (xpi/firefox-i18n-54.0.1/rm.xpi) = 1f97345a398a8debe697c52c1c9470e8e372b27358f03b97c362936961075c42
148
SHA256 (xpi/firefox-i18n-55.0b9/pt-PT.xpi) = 14d3d2080642f9d96b52177432e3dfa3697b8e7224c9f4ea9fc063d81476a9f9
149
SIZE (xpi/firefox-i18n-54.0.1/rm.xpi) = 433406
149
SIZE (xpi/firefox-i18n-55.0b9/pt-PT.xpi) = 465240
150
SHA256 (xpi/firefox-i18n-54.0.1/ro.xpi) = a240485bcc277196ff5d9dc83b0ca3682bdb28eea348de9675d076a0cda90252
150
SHA256 (xpi/firefox-i18n-55.0b9/rm.xpi) = 5011a71d8f5d42412a94427bdd07094c280c4143c0c86cd345f48fbd737f41c0
151
SIZE (xpi/firefox-i18n-54.0.1/ro.xpi) = 449474
151
SIZE (xpi/firefox-i18n-55.0b9/rm.xpi) = 458267
152
SHA256 (xpi/firefox-i18n-54.0.1/ru.xpi) = ed18d1fdb2e0f71bf08a272e80d8954e3cbb67e47656f3c37d94f3368f9d5013
152
SHA256 (xpi/firefox-i18n-55.0b9/ro.xpi) = 90dfdf557b113788141a65fc0f6ae72d8cad178835c9b6a2a38adca771fd3a0b
153
SIZE (xpi/firefox-i18n-54.0.1/ru.xpi) = 487731
153
SIZE (xpi/firefox-i18n-55.0b9/ro.xpi) = 463019
154
SHA256 (xpi/firefox-i18n-54.0.1/si.xpi) = 4dce9708ecdd61c82621d97eb88476a4c13212efa136e1cf2db0f7df7e0c4271
154
SHA256 (xpi/firefox-i18n-55.0b9/ru.xpi) = a98adcef40783b35a4859f48552df0de226d4f7e3bdec7991ee855f865757879
155
SIZE (xpi/firefox-i18n-54.0.1/si.xpi) = 491069
155
SIZE (xpi/firefox-i18n-55.0b9/ru.xpi) = 530903
156
SHA256 (xpi/firefox-i18n-54.0.1/sk.xpi) = fa7d3fdf5448c1fde3d875b1897207e129b04e3338d8e20eb050b65d6db1a383
156
SHA256 (xpi/firefox-i18n-55.0b9/si.xpi) = 44f834eb59d09f1c6dec2afa092a3540023273eb941eb19d2eb0b34a1224c2ec
157
SIZE (xpi/firefox-i18n-54.0.1/sk.xpi) = 455015
157
SIZE (xpi/firefox-i18n-55.0b9/si.xpi) = 508354
158
SHA256 (xpi/firefox-i18n-54.0.1/sl.xpi) = 31795653987c7dc1a1968006b3c8068f6e1089b0f2311d9d53c08cb73d2d3617
158
SHA256 (xpi/firefox-i18n-55.0b9/sk.xpi) = 97266fbf956f98c8e7e9d6d66252c2bf442655feca38bce6fc864f4ebd92d79b
159
SIZE (xpi/firefox-i18n-54.0.1/sl.xpi) = 433176
159
SIZE (xpi/firefox-i18n-55.0b9/sk.xpi) = 487570
160
SHA256 (xpi/firefox-i18n-54.0.1/son.xpi) = f1ee7a8fe539071cd78361d40f1e547ee25d0a5e10a72e040ff56d9f20bc297a
160
SHA256 (xpi/firefox-i18n-55.0b9/sl.xpi) = be3a710c017af33f76efdbb2e1389131fc0a938dd76ee71220a9883bca74464c
161
SIZE (xpi/firefox-i18n-54.0.1/son.xpi) = 435053
161
SIZE (xpi/firefox-i18n-55.0b9/sl.xpi) = 465769
162
SHA256 (xpi/firefox-i18n-54.0.1/sq.xpi) = 4310b19b43b5cd4c841ded13a62c621cf3eea4391e516b08bb70a4ea3e008a9a
162
SHA256 (xpi/firefox-i18n-55.0b9/son.xpi) = 801217151d6c1fb14875435be1404643a9ebd9aba86066792d9421b94e33284c
163
SIZE (xpi/firefox-i18n-54.0.1/sq.xpi) = 448158
163
SIZE (xpi/firefox-i18n-55.0b9/son.xpi) = 456961
164
SHA256 (xpi/firefox-i18n-54.0.1/sr.xpi) = 22a1101556894ea99607cc9e447bf6e54705a906e476245e3f599fd7ffc24484
164
SHA256 (xpi/firefox-i18n-55.0b9/sq.xpi) = 8b3364c04114fe2726856fdb25e0a2e6e11b9f7d78154e33221b9622794ff5c5
165
SIZE (xpi/firefox-i18n-54.0.1/sr.xpi) = 461355
165
SIZE (xpi/firefox-i18n-55.0b9/sq.xpi) = 470634
166
SHA256 (xpi/firefox-i18n-54.0.1/sv-SE.xpi) = 6fbaa53965beac50102a130257e3703ceddc4621744941beace41d172ab8d559
166
SHA256 (xpi/firefox-i18n-55.0b9/sr.xpi) = 4aa34cf8cbf8afad6c431372be3fb45139a064ebc9a284a80154b750ac0769ba
167
SIZE (xpi/firefox-i18n-54.0.1/sv-SE.xpi) = 440479
167
SIZE (xpi/firefox-i18n-55.0b9/sr.xpi) = 494881
168
SHA256 (xpi/firefox-i18n-54.0.1/ta.xpi) = 192fe9dcf242ff01da8e51c216f04d32fe4a91170dbce22e5e40ecfa7f5e0759
168
SHA256 (xpi/firefox-i18n-55.0b9/sv-SE.xpi) = 2cb7ddd298a99cad6486a6147c93ef511af24ecce5b2e6670b9b427d01c2e32e
169
SIZE (xpi/firefox-i18n-54.0.1/ta.xpi) = 493957
169
SIZE (xpi/firefox-i18n-55.0b9/sv-SE.xpi) = 466011
170
SHA256 (xpi/firefox-i18n-54.0.1/te.xpi) = c4e2bef212d4fbc5c250808f92318165db9f3bb0936be28b2517f43f213a3010
170
SHA256 (xpi/firefox-i18n-55.0b9/ta.xpi) = cf6fe253e8fb321b018818163d07b77ecf1e8cb9f881e3ad7dd652f872bf5d70
171
SIZE (xpi/firefox-i18n-54.0.1/te.xpi) = 513339
171
SIZE (xpi/firefox-i18n-55.0b9/ta.xpi) = 519965
172
SHA256 (xpi/firefox-i18n-54.0.1/th.xpi) = be7902e644099d01405198a7f3a7c651494012c26e9729aa63f103a58adb28ba
172
SHA256 (xpi/firefox-i18n-55.0b9/te.xpi) = 35da6b32f10eb6d42f56aad639c1fe7ddd86c4f4da38dcb5cb48b44c5eb9fc18
173
SIZE (xpi/firefox-i18n-54.0.1/th.xpi) = 487219
173
SIZE (xpi/firefox-i18n-55.0b9/te.xpi) = 540338
174
SHA256 (xpi/firefox-i18n-54.0.1/tr.xpi) = 4460fb3b0c3419ccc67de5b81709337e3990bd0f3753e66cbed467b468e58aff
174
SHA256 (xpi/firefox-i18n-55.0b9/th.xpi) = f566fa675c3b1198bcf02bb476081dc0dad93741511ca714112790f3596ff697
175
SIZE (xpi/firefox-i18n-54.0.1/tr.xpi) = 440413
175
SIZE (xpi/firefox-i18n-55.0b9/th.xpi) = 511879
176
SHA256 (xpi/firefox-i18n-54.0.1/uk.xpi) = 9009a1ff5f9e53b2041dd58a47b377d73e0e9dc59d257b49c2ce0f4fe9e15471
176
SHA256 (xpi/firefox-i18n-55.0b9/tr.xpi) = a9a0321da699b8e096194c9865fa92ddc83e1dc2d0b9b2c692ff6e285c587b46
177
SIZE (xpi/firefox-i18n-54.0.1/uk.xpi) = 490758
177
SIZE (xpi/firefox-i18n-55.0b9/tr.xpi) = 472163
178
SHA256 (xpi/firefox-i18n-54.0.1/ur.xpi) = efa36df7c6ccda5551d3be4a0beaff1069310607afb99040b7d586a9abd422e4
178
SHA256 (xpi/firefox-i18n-55.0b9/uk.xpi) = 2ca922162673551507ef938dc6e9c5f6c8026c702207e76c75de8839f9e03c4d
179
SIZE (xpi/firefox-i18n-54.0.1/ur.xpi) = 496584
179
SIZE (xpi/firefox-i18n-55.0b9/uk.xpi) = 526439
180
SHA256 (xpi/firefox-i18n-54.0.1/uz.xpi) = 90b31da2151bbf9c89766074afec716c4cd05bfbae3d30bac1ccf14a0eb1db62
180
SHA256 (xpi/firefox-i18n-55.0b9/ur.xpi) = 68512194641db6bf7ceb34a387ada41a791a89166edd34502bd28e8d27b97985
181
SIZE (xpi/firefox-i18n-54.0.1/uz.xpi) = 448113
181
SIZE (xpi/firefox-i18n-55.0b9/ur.xpi) = 520737
182
SHA256 (xpi/firefox-i18n-54.0.1/vi.xpi) = b971ef91795039963a35e59ab7d653d7f0568760c3a0e2c95dccaf5052fd3750
182
SHA256 (xpi/firefox-i18n-55.0b9/uz.xpi) = ac1e4d70587334dadb1dc5bd876c0cd0b0ae9db313e70981fe808be0f91d05ba
183
SIZE (xpi/firefox-i18n-54.0.1/vi.xpi) = 449655
183
SIZE (xpi/firefox-i18n-55.0b9/uz.xpi) = 467673
184
SHA256 (xpi/firefox-i18n-54.0.1/xh.xpi) = dbb7ca463660d3bf1fc2c079551b6380dc8d238be1a34cd2426cae4b74382bb9
184
SHA256 (xpi/firefox-i18n-55.0b9/vi.xpi) = 7fd4dc72ab78a13c43cd5c4a5172c7b7529dc2927872e2f77f1ce68d7393ad46
185
SIZE (xpi/firefox-i18n-54.0.1/xh.xpi) = 440803
185
SIZE (xpi/firefox-i18n-55.0b9/vi.xpi) = 474773
186
SHA256 (xpi/firefox-i18n-54.0.1/zh-CN.xpi) = 0acf841d128b347c85ceb8fa34dd2dcdb3177b1c4cb9fa2a97666ba0912dd16b
186
SHA256 (xpi/firefox-i18n-55.0b9/xh.xpi) = 990cfea918c879b0dfb465fcc7d74ed1094e9dc0b1eba9e1a8fe9ba58d65d820
187
SIZE (xpi/firefox-i18n-54.0.1/zh-CN.xpi) = 458333
187
SIZE (xpi/firefox-i18n-55.0b9/xh.xpi) = 470722
188
SHA256 (xpi/firefox-i18n-54.0.1/zh-TW.xpi) = bebd2c45d83ba97ebafc3fd463385d3a75d3818bae33bf71e3430594f5f5abbc
188
SHA256 (xpi/firefox-i18n-55.0b9/zh-CN.xpi) = a58a883827be06aeb5bb73b909c75a163e3e40fc30e3fa8c5f993d5fdedeaf7b
189
SIZE (xpi/firefox-i18n-54.0.1/zh-TW.xpi) = 469166
189
SIZE (xpi/firefox-i18n-55.0b9/zh-CN.xpi) = 490381
190
SHA256 (xpi/firefox-i18n-55.0b9/zh-TW.xpi) = 102be0c4f6cedbf8ce003d91c64df82d2d53abe9af47a9ffc505c7285f7731e8
191
SIZE (xpi/firefox-i18n-55.0b9/zh-TW.xpi) = 489349
(-)b/www/firefox/Makefile (-6 / +6 lines)
Lines 2-10 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	firefox
4
PORTNAME=	firefox
5
DISTVERSION=	54.0.1
5
DISTVERSION=	55.0b9
6
DISTVERSIONSUFFIX=.source
6
DISTVERSIONSUFFIX=.source
7
PORTREVISION=	1
8
PORTEPOCH=	1
7
PORTEPOCH=	1
9
CATEGORIES=	www ipv6
8
CATEGORIES=	www ipv6
10
MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
9
MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
Lines 13-27 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ Link Here
13
MAINTAINER=	gecko@FreeBSD.org
12
MAINTAINER=	gecko@FreeBSD.org
14
COMMENT=	Web browser based on the browser portion of Mozilla
13
COMMENT=	Web browser based on the browser portion of Mozilla
15
14
16
BUILD_DEPENDS=	nspr>=4.14:devel/nspr \
15
BUILD_DEPENDS=	nspr>=4.15:devel/nspr \
17
		nss>=3.30.2:security/nss \
16
		nss>=3.31:security/nss \
18
		libevent>=2.0.22:devel/libevent \
17
		libevent>=2.0.22:devel/libevent \
19
		harfbuzz>=1.4.3:print/harfbuzz \
18
		harfbuzz>=1.4.6:print/harfbuzz \
20
		graphite2>=1.3.10:graphics/graphite2 \
19
		graphite2>=1.3.10:graphics/graphite2 \
21
		png>=1.6.28:graphics/png \
20
		png>=1.6.28:graphics/png \
22
		libvorbis>=1.3.5,3:audio/libvorbis \
21
		libvorbis>=1.3.5,3:audio/libvorbis \
23
		libvpx>=1.5.0:multimedia/libvpx \
22
		libvpx>=1.5.0:multimedia/libvpx \
24
		sqlite3>=3.17.0:databases/sqlite3 \
23
		sqlite3>=3.19.2:databases/sqlite3 \
25
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 \
24
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 \
26
		v4l_compat>0:multimedia/v4l_compat \
25
		v4l_compat>0:multimedia/v4l_compat \
27
		autoconf-2.13:devel/autoconf213 \
26
		autoconf-2.13:devel/autoconf213 \
Lines 47-52 MOZ_OPTIONS= --enable-application=browser \ Link Here
47
46
48
OPTIONS_DEFINE=		RUST
47
OPTIONS_DEFINE=		RUST
49
OPTIONS_DEFAULT=	BUNDLED_CAIRO
48
OPTIONS_DEFAULT=	BUNDLED_CAIRO
49
OPTIONS_EXCLUDE=	GNOMEUI
50
# XXX lang/rust and devel/cargo currently build only on these platforms
50
# XXX lang/rust and devel/cargo currently build only on these platforms
51
OPTIONS_DEFAULT_aarch64=RUST
51
OPTIONS_DEFAULT_aarch64=RUST
52
OPTIONS_DEFAULT_amd64=	RUST
52
OPTIONS_DEFAULT_amd64=	RUST
(-)b/www/firefox/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1498670356
1
TIMESTAMP = 1499984982
2
SHA256 (firefox-54.0.1.source.tar.xz) = 07843e68f2f64842bb230b7fe821e45c82944e64dc3f2a3a90d3ea9f1efa7f77
2
SHA256 (firefox-55.0b9.source.tar.xz) = 55783e9f335660eede3449512e247f2d5a162183c34f5ec3f072a599fcbac949
3
SIZE (firefox-54.0.1.source.tar.xz) = 229935420
3
SIZE (firefox-55.0b9.source.tar.xz) = 235365676
(-)b/www/firefox/files/patch-bug1021761 (-22 / +18 lines)
Lines 122-128 index 57bcb4c13652..68be024f4a68 100644 Link Here
122
 
122
 
123
 static int
123
 static int
124
 validate_stream_params(cubeb_stream_params * input_stream_params,
124
 validate_stream_params(cubeb_stream_params * input_stream_params,
125
@@ -138,6 +141,9 @@ cubeb_init(cubeb ** context, char const * context_name)
125
@@ -155,6 +158,10 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
126
 #if defined(USE_KAI)
127
       init_oneshot = kai_init;
128
 #endif
129
+    } else if (!strcmp(backend_name, "oss")) {
130
+#if defined(USE_OSS)
131
+      init_oneshot = oss_init;
132
+#endif
133
     } else {
134
       /* Already set */
135
     }
136
@@ -196,6 +203,9 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
126
 #if defined(USE_KAI)
137
 #if defined(USE_KAI)
127
     kai_init,
138
     kai_init,
128
 #endif
139
 #endif
Lines 246-252 index 05ad27fef53b..3ea78e994f59 100644 Link Here
246
+    char * buftail = stm->buffer + WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->bufframes);
257
+    char * buftail = stm->buffer + WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->bufframes);
247
 
258
 
248
     /* Correct read size to the other stream available frames */
259
     /* Correct read size to the other stream available frames */
249
     if (stm->other_stream && got > stm->other_stream->bufframes) {
260
     if (stm->other_stream && got > (snd_pcm_sframes_t) stm->other_stream->bufframes) {
250
@@ -372,8 +421,8 @@ alsa_process_stream(cubeb_stream * stm)
261
@@ -372,8 +421,8 @@ alsa_process_stream(cubeb_stream * stm)
251
     long drain_frames = avail - stm->bufframes;
262
     long drain_frames = avail - stm->bufframes;
252
     double drain_time = (double) drain_frames / stm->params.rate;
263
     double drain_time = (double) drain_frames / stm->params.rate;
Lines 579-585 index 05ad27fef53b..3ea78e994f59 100644 Link Here
579
+  r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
590
+  r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
580
   assert((nfds_t) r == stm->nfds);
591
   assert((nfds_t) r == stm->nfds);
581
 
592
 
582
   r = pthread_cond_init(&stm->cond, NULL);
593
   if (alsa_register_stream(ctx, stm) != 0) {
583
@@ -1048,7 +1156,7 @@ alsa_stream_destroy(cubeb_stream * stm)
594
@@ -1048,7 +1156,7 @@ alsa_stream_destroy(cubeb_stream * stm)
584
   pthread_mutex_lock(&stm->mutex);
595
   pthread_mutex_lock(&stm->mutex);
585
   if (stm->pcm) {
596
   if (stm->pcm) {
Lines 1182-1210 diff --git media/libcubeb/update.sh media/libcubeb/update.sh Link Here
1182
index b139b8f497fd..d1f8a223c6d8 100755
1193
index b139b8f497fd..d1f8a223c6d8 100755
1183
--- media/libcubeb/update.sh
1194
--- media/libcubeb/update.sh
1184
+++ media/libcubeb/update.sh
1195
+++ media/libcubeb/update.sh
1185
@@ -17,6 +17,7 @@ cp $1/src/cubeb_audiounit.cpp src
1196
@@ -20,6 +20,7 @@ cp $1/src/cubeb_log.h src
1186
 cp $1/src/cubeb_osx_run_loop.h src
1197
 cp $1/src/cubeb_mixer.cpp src
1187
 cp $1/src/cubeb_jack.cpp src
1198
 cp $1/src/cubeb_mixer.h src
1188
 cp $1/src/cubeb_opensl.c src
1199
 cp $1/src/cubeb_opensl.c src
1189
+cp $1/src/cubeb_oss.c src
1200
+cp $1/src/cubeb_oss.c src
1190
 cp $1/src/cubeb_array_queue.h src
1201
 cp $1/src/cubeb_osx_run_loop.h src
1191
 cp $1/src/cubeb_panner.cpp src
1202
 cp $1/src/cubeb_panner.cpp src
1192
 cp $1/src/cubeb_panner.h src
1203
 cp $1/src/cubeb_panner.h src
1193
diff --git media/webrtc/signaling/test/common.build media/webrtc/signaling/test/common.build
1194
index 3e5450f5d63a..dd45427f655a 100644
1195
--- media/webrtc/signaling/test/common.build
1196
+++ media/webrtc/signaling/test/common.build
1197
@@ -99,8 +99,8 @@ USE_LIBS += ['mozglue']
1198
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
1199
 OS_LIBS += CONFIG['REALTIME_LIBS']
1200
 
1201
-if CONFIG['MOZ_ALSA']:
1202
-    OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
1203
+if CONFIG['MOZ_OSS']:
1204
+    OS_LIBS += CONFIG['MOZ_OSS_LIBS']
1205
 
1206
 if CONFIG['MOZ_SYSTEM_JPEG']:
1207
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
1208
diff --git toolkit/library/moz.build toolkit/library/moz.build
1204
diff --git toolkit/library/moz.build toolkit/library/moz.build
1209
index a61c689c83c3..7764df6f8a6b 100644
1205
index a61c689c83c3..7764df6f8a6b 100644
1210
--- toolkit/library/moz.build
1206
--- toolkit/library/moz.build
(-)b/www/firefox/files/patch-bug1312182 (+376 lines)
Added Link Here
1
commit 0d02dac1638ad
2
Author: Alessio Placitelli <alessio.placitelli@gmail.com>
3
Date:   Tue May 30 10:42:42 2017 +0200
4
5
    Bug 1312182 - Consolidate the uses of MOZ_TELEMETRY_REPORTING in the code. r=flod,gfritzsche,jaws
6
    
7
    The MOZ_TELEMETRY_REPORTING define does not control whether or not Telemetry is enabled
8
    but rather if it will send the gathered data to Mozilla servers. We still want to
9
    display the about:preferences options and let developers know about this behaviour.
10
    Please note that this patch is not changing any behaviour: it's only making it explicit
11
    by showing the options as disabled rather than hiding them.
12
    
13
    MozReview-Commit-ID: 7A0y0E0hm0Q
14
    
15
    --HG--
16
    extra : rebase_source : 36d1a7f5ec5c05b43731daf9507d3068fe7674ee
17
---
18
 browser/base/content/baseMenuOverlay.xul           |  2 +-
19
 browser/components/nsBrowserGlue.js                |  8 +--
20
 .../components/preferences/in-content-new/main.xul |  2 -
21
 .../preferences/in-content-new/privacy.js          | 32 +++++------
22
 .../preferences/in-content-new/privacy.xul         | 14 ++---
23
 .../components/preferences/in-content/advanced.js  | 63 +++++++++++-----------
24
 .../components/preferences/in-content/advanced.xul |  7 ++-
25
 .../chrome/browser/preferences-old/advanced.dtd    |  5 ++
26
 .../en-US/chrome/browser/preferences/advanced.dtd  |  5 ++
27
 9 files changed, 67 insertions(+), 71 deletions(-)
28
29
diff --git browser/base/content/baseMenuOverlay.xul browser/base/content/baseMenuOverlay.xul
30
index 1befa2bb66cc..804bbdebb797 100644
31
--- browser/base/content/baseMenuOverlay.xul
32
+++ browser/base/content/baseMenuOverlay.xul
33
@@ -61,7 +61,7 @@
34
                   onclick="checkForMiddleClick(this, event);"
35
                   label="&helpKeyboardShortcuts.label;"
36
                   accesskey="&helpKeyboardShortcuts.accesskey;"/>
37
-#ifdef MOZ_TELEMETRY_REPORTING
38
+#ifdef MOZ_SERVICES_HEALTHREPORT
39
         <menuitem id="healthReport"
40
                   label="&healthReport2.label;"
41
                   accesskey="&healthReport2.accesskey;"
42
diff --git browser/components/nsBrowserGlue.js browser/components/nsBrowserGlue.js
43
index 554c279356b9..1c21bf4c4323 100644
44
--- browser/components/nsBrowserGlue.js
45
+++ browser/components/nsBrowserGlue.js
46
@@ -528,9 +528,7 @@ BrowserGlue.prototype = {
47
     os.addObserver(this, "distribution-customization-complete");
48
     os.addObserver(this, "handle-xul-text-link");
49
     os.addObserver(this, "profile-before-change");
50
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
51
-      os.addObserver(this, "keyword-search");
52
-    }
53
+    os.addObserver(this, "keyword-search");
54
     os.addObserver(this, "browser-search-engine-modified");
55
     os.addObserver(this, "restart-in-safe-mode");
56
     os.addObserver(this, "flash-plugin-hang");
57
@@ -583,9 +581,7 @@ BrowserGlue.prototype = {
58
       os.removeObserver(this, "places-database-locked");
59
     os.removeObserver(this, "handle-xul-text-link");
60
     os.removeObserver(this, "profile-before-change");
61
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
62
-      os.removeObserver(this, "keyword-search");
63
-    }
64
+    os.removeObserver(this, "keyword-search");
65
     os.removeObserver(this, "browser-search-engine-modified");
66
     os.removeObserver(this, "flash-plugin-hang");
67
     os.removeObserver(this, "xpi-signature-changed");
68
diff --git browser/components/preferences/in-content-new/main.xul browser/components/preferences/in-content-new/main.xul
69
index e89ee1891c91..8672557bede2 100644
70
--- browser/components/preferences/in-content-new/main.xul
71
+++ browser/components/preferences/in-content-new/main.xul
72
@@ -183,11 +183,9 @@
73
               name="layout.spellcheckDefault"
74
               type="int"/>
75
 
76
-#ifdef MOZ_TELEMETRY_REPORTING
77
   <preference id="toolkit.telemetry.enabled"
78
               name="toolkit.telemetry.enabled"
79
               type="bool"/>
80
-#endif
81
 
82
   <preference id="browser.preferences.defaultPerformanceSettings.enabled"
83
               name="browser.preferences.defaultPerformanceSettings.enabled"
84
diff --git browser/components/preferences/in-content-new/privacy.js browser/components/preferences/in-content-new/privacy.js
85
index be057bfad611..73f72391b991 100644
86
--- browser/components/preferences/in-content-new/privacy.js
87
+++ browser/components/preferences/in-content-new/privacy.js
88
@@ -321,11 +321,9 @@ var gPrivacyPane = {
89
       this.initSubmitCrashes();
90
     }
91
     this.initTelemetry();
92
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
93
-      this.initSubmitHealthReport();
94
-      setEventListener("submitHealthReportBox", "command",
95
-                       gPrivacyPane.updateSubmitHealthReport);
96
-    }
97
+    this.initSubmitHealthReport();
98
+    setEventListener("submitHealthReportBox", "command",
99
+                     gPrivacyPane.updateSubmitHealthReport);
100
 
101
     // Append search keywords into the elements could open subdialogs.
102
     let bundlePrefs = document.getElementById("bundlePreferences");
103
@@ -1414,8 +1412,10 @@ var gPrivacyPane = {
104
    * In all cases, set up the Learn More link sanely.
105
    */
106
   initTelemetry() {
107
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
108
-      this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
109
+    this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
110
+    // If we're not sending any Telemetry, disable the telemetry upload checkbox as well.
111
+    if (!AppConstants.MOZ_TELEMETRY_REPORTING) {
112
+      document.getElementById("submitTelemetryBox").setAttribute("disabled", "true");
113
     }
114
   },
115
 
116
@@ -1439,9 +1439,6 @@ var gPrivacyPane = {
117
    * @param {Boolean} aEnabled False disables the controls, true enables them.
118
    */
119
   setTelemetrySectionEnabled(aEnabled) {
120
-    if (!AppConstants.MOZ_TELEMETRY_REPORTING) {
121
-      return;
122
-    }
123
     // If FHR is disabled, additional data sharing should be disabled as well.
124
     let disabled = !aEnabled;
125
     document.getElementById("submitTelemetryBox").disabled = disabled;
126
@@ -1456,19 +1453,21 @@ var gPrivacyPane = {
127
    * Initialize the health report service reference and checkbox.
128
    */
129
   initSubmitHealthReport() {
130
-    if (!AppConstants.MOZ_TELEMETRY_REPORTING) {
131
-      return;
132
-    }
133
     this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
134
 
135
     let checkbox = document.getElementById("submitHealthReportBox");
136
 
137
-    if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED)) {
138
+    // Telemetry is only sending data if MOZ_TELEMETRY_REPORTING is defined.
139
+    // We still want to display the preferences panel if that's not the case, but
140
+    // we want it to be disabled and unchecked.
141
+    if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED) ||
142
+        !AppConstants.MOZ_TELEMETRY_REPORTING) {
143
       checkbox.setAttribute("disabled", "true");
144
       return;
145
     }
146
 
147
-    checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED);
148
+    checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED) &&
149
+                       AppConstants.MOZ_TELEMETRY_REPORTING;
150
     this.setTelemetrySectionEnabled(checkbox.checked);
151
   },
152
 
153
@@ -1476,9 +1475,6 @@ var gPrivacyPane = {
154
    * Update the health report preference with state from checkbox.
155
    */
156
   updateSubmitHealthReport() {
157
-    if (!AppConstants.MOZ_TELEMETRY_REPORTING) {
158
-      return;
159
-    }
160
     let checkbox = document.getElementById("submitHealthReportBox");
161
     Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
162
     this.setTelemetrySectionEnabled(checkbox.checked);
163
diff --git browser/components/preferences/in-content-new/privacy.xul browser/components/preferences/in-content-new/privacy.xul
164
index 9d531bd8274b..8030567573f8 100644
165
--- browser/components/preferences/in-content-new/privacy.xul
166
+++ browser/components/preferences/in-content-new/privacy.xul
167
@@ -760,9 +760,14 @@
168
 </groupbox>
169
 
170
 <!-- Data Choices -->
171
-#ifdef MOZ_TELEMETRY_REPORTING
172
-<groupbox id="historyGroup" data-category="panePrivacy" data-subcategory="reports" hidden="true">
173
+#ifdef MOZ_DATA_REPORTING
174
+
175
+<groupbox id="telemetryGroup" data-category="panePrivacy" data-subcategory="reports" hidden="true">
176
 <caption><label>&reports.label;</label></caption>
177
+#ifndef MOZ_TELEMETRY_REPORTING
178
+  <description id="TelemetryDisabledDesc" control="telemetryGroup">&healthReportingDisabled.label;</description>
179
+#endif
180
+
181
   <hbox align="center">
182
     <checkbox id="submitHealthReportBox" label="&enableHealthReport.label;"
183
               accesskey="&enableHealthReport.accesskey;"/>
184
@@ -782,14 +787,9 @@
185
                  class="indent">&telemetryDesc.label;</description>
186
   </vbox>
187
 </groupbox>
188
-#endif
189
 
190
-#ifdef MOZ_DATA_REPORTING
191
 #ifdef MOZ_CRASHREPORTER
192
 <groupbox id="crashReporterGroup" data-category="panePrivacy" data-subcategory="reports" hidden="true">
193
-#ifndef MOZ_TELEMETRY_REPORTING
194
-<caption><label>&reports.label;</label></caption>
195
-#endif
196
   <hbox align="center">
197
     <checkbox id="automaticallySubmitCrashesBox"
198
               preference="browser.crashReports.unsubmittedCheck.autoSubmit"
199
diff --git browser/components/preferences/in-content/advanced.js browser/components/preferences/in-content/advanced.js
200
index a6a2abaad9cf..9c7a2e716403 100644
201
--- browser/components/preferences/in-content/advanced.js
202
+++ browser/components/preferences/in-content/advanced.js
203
@@ -46,9 +46,7 @@ var gAdvancedPane = {
204
       this.initSubmitCrashes();
205
     }
206
     this.initTelemetry();
207
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
208
-      this.initSubmitHealthReport();
209
-    }
210
+    this.initSubmitHealthReport();
211
     this.updateOnScreenKeyboardVisibility();
212
     this.updateCacheSizeInputField();
213
     this.updateActualCacheSize();
214
@@ -78,10 +76,8 @@ var gAdvancedPane = {
215
                      gAdvancedPane.updateHardwareAcceleration);
216
     setEventListener("advancedPrefs", "select",
217
                      gAdvancedPane.tabSelectionChanged);
218
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
219
-      setEventListener("submitHealthReportBox", "command",
220
-                       gAdvancedPane.updateSubmitHealthReport);
221
-    }
222
+    setEventListener("submitHealthReportBox", "command",
223
+                     gAdvancedPane.updateSubmitHealthReport);
224
 
225
     setEventListener("connectionSettings", "command",
226
                      gAdvancedPane.showConnections);
227
@@ -293,8 +289,10 @@ var gAdvancedPane = {
228
    * In all cases, set up the Learn More link sanely.
229
    */
230
   initTelemetry() {
231
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
232
-      this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
233
+    this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
234
+    // If we're not sending any Telemetry, disable the telemetry upload checkbox as well.
235
+    if (!AppConstants.MOZ_TELEMETRY_REPORTING) {
236
+      document.getElementById("submitTelemetryBox").setAttribute("disabled", "true");
237
     }
238
   },
239
 
240
@@ -303,46 +301,45 @@ var gAdvancedPane = {
241
    * @param {Boolean} aEnabled False disables the controls, true enables them.
242
    */
243
   setTelemetrySectionEnabled(aEnabled) {
244
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
245
-      // If FHR is disabled, additional data sharing should be disabled as well.
246
-      let disabled = !aEnabled;
247
-      document.getElementById("submitTelemetryBox").disabled = disabled;
248
-      if (disabled) {
249
-        // If we disable FHR, untick the telemetry checkbox.
250
-        Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
251
-      }
252
-      document.getElementById("telemetryDataDesc").disabled = disabled;
253
+    // If FHR is disabled, additional data sharing should be disabled as well.
254
+    let disabled = !aEnabled;
255
+    document.getElementById("submitTelemetryBox").disabled = disabled;
256
+    if (disabled) {
257
+      // If we disable FHR, untick the telemetry checkbox.
258
+      Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
259
     }
260
+    document.getElementById("telemetryDataDesc").disabled = disabled;
261
   },
262
 
263
   /**
264
    * Initialize the health report service reference and checkbox.
265
    */
266
   initSubmitHealthReport() {
267
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
268
-      this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
269
-
270
-      let checkbox = document.getElementById("submitHealthReportBox");
271
+    this._setupLearnMoreLink("datareporting.healthreport.infoURL", "FHRLearnMore");
272
 
273
-      if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED)) {
274
-        checkbox.setAttribute("disabled", "true");
275
-        return;
276
-      }
277
+    let checkbox = document.getElementById("submitHealthReportBox");
278
 
279
-      checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED);
280
-      this.setTelemetrySectionEnabled(checkbox.checked);
281
+    // Telemetry is only sending data if MOZ_TELEMETRY_REPORTING is defined.
282
+    // We still want to display the preferences panel if that's not the case, but
283
+    // we want it to be disabled and unchecked.
284
+    if (Services.prefs.prefIsLocked(PREF_UPLOAD_ENABLED) ||
285
+        !AppConstants.MOZ_TELEMETRY_REPORTING) {
286
+      checkbox.setAttribute("disabled", "true");
287
+      return;
288
     }
289
+
290
+    checkbox.checked = Services.prefs.getBoolPref(PREF_UPLOAD_ENABLED) &&
291
+                       AppConstants.MOZ_TELEMETRY_REPORTING;
292
+    this.setTelemetrySectionEnabled(checkbox.checked);
293
   },
294
 
295
   /**
296
    * Update the health report preference with state from checkbox.
297
    */
298
   updateSubmitHealthReport() {
299
-    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
300
-      let checkbox = document.getElementById("submitHealthReportBox");
301
-      Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
302
-      this.setTelemetrySectionEnabled(checkbox.checked);
303
-    }
304
+    let checkbox = document.getElementById("submitHealthReportBox");
305
+    Services.prefs.setBoolPref(PREF_UPLOAD_ENABLED, checkbox.checked);
306
+    this.setTelemetrySectionEnabled(checkbox.checked);
307
   },
308
 
309
   updateOnScreenKeyboardVisibility() {
310
diff --git browser/components/preferences/in-content/advanced.xul browser/components/preferences/in-content/advanced.xul
311
index f2330223fb18..1b2c62168a59 100644
312
--- browser/components/preferences/in-content/advanced.xul
313
+++ browser/components/preferences/in-content/advanced.xul
314
@@ -37,12 +37,9 @@
315
   <preference id="layout.spellcheckDefault"
316
               name="layout.spellcheckDefault"
317
               type="int"/>
318
-
319
-#ifdef MOZ_TELEMETRY_REPORTING
320
   <preference id="toolkit.telemetry.enabled"
321
               name="toolkit.telemetry.enabled"
322
               type="bool"/>
323
-#endif
324
 
325
   <!-- Data Choices tab -->
326
 #ifdef MOZ_CRASHREPORTER
327
@@ -189,6 +186,9 @@
328
     <!-- Data Choices -->
329
     <tabpanel id="dataChoicesPanel" orient="vertical">
330
 #ifdef MOZ_TELEMETRY_REPORTING
331
+      <description>&healthReportingDisabled.label;</description>
332
+      <separator class="thin"/>
333
+#endif
334
       <groupbox>
335
         <caption>
336
           <checkbox id="submitHealthReportBox" label="&enableHealthReport.label;"
337
@@ -216,7 +216,6 @@
338
           </hbox>
339
         </vbox>
340
       </groupbox>
341
-#endif
342
 #ifdef MOZ_CRASHREPORTER
343
       <groupbox>
344
         <caption>
345
diff --git browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
346
index 215b800d3385..bf23c4fd251f 100644
347
--- browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
348
+++ browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
349
@@ -28,6 +28,11 @@
350
 
351
 <!ENTITY dataChoicesTab.label            "Data Choices">
352
 
353
+<!-- LOCALIZATION NOTE (healthReportingDisabled.label): This message is displayed above
354
+disabled data sharing options in developer builds or builds with no Telemetry support
355
+available. -->
356
+<!ENTITY healthReportingDisabled.label   "Data reporting is disabled for this build configuration">
357
+
358
 <!ENTITY healthReportDesc.label          "Helps you understand your browser performance and shares data with &vendorShortName; about your browser health">
359
 <!ENTITY enableHealthReport.label        "Enable &brandShortName; Health Report">
360
 <!ENTITY enableHealthReport.accesskey    "R">
361
diff --git browser/locales/en-US/chrome/browser/preferences/advanced.dtd browser/locales/en-US/chrome/browser/preferences/advanced.dtd
362
index 58a6b38630cf..6c478e48244a 100644
363
--- browser/locales/en-US/chrome/browser/preferences/advanced.dtd
364
+++ browser/locales/en-US/chrome/browser/preferences/advanced.dtd
365
@@ -28,6 +28,11 @@
366
 
367
 <!ENTITY dataChoicesTab.label            "Data Choices">
368
 
369
+<!-- LOCALIZATION NOTE (healthReportingDisabled.label): This message is displayed above
370
+disabled data sharing options in developer builds or builds with no Telemetry support
371
+available. -->
372
+<!ENTITY healthReportingDisabled.label   "Data reporting is disabled for this build configuration">
373
+
374
 <!ENTITY healthReportDesc.label          "Helps you understand your browser performance and shares data with &vendorShortName; about your browser health">
375
 <!ENTITY enableHealthReport.label        "Enable &brandShortName; Health Report">
376
 <!ENTITY enableHealthReport.accesskey    "R">
(-)a/www/firefox/files/patch-bug1356709 (-170 lines)
Removed Link Here
1
commit acc36099bfc1
2
Author: Steve Fink <sfink@mozilla.com>
3
Date:   Mon Apr 17 21:04:08 2017 -0700
4
5
    Bug 1356709 - Fix uses of uninitialized values in arm64 code, r=sstangl
6
    
7
    --HG--
8
    extra : rebase_source : 2f9a59c88f21dd467fbc4232e2f6b20850fd53ed
9
    extra : histedit_source : b5110806cf04a3ca056ea89709bcc707368a2e57
10
---
11
 js/src/jit/arm64/MacroAssembler-arm64.cpp   |  4 +++-
12
 js/src/jit/arm64/vixl/Debugger-vixl.cpp     | 10 ++++++----
13
 js/src/jit/arm64/vixl/Decoder-vixl.cpp      | 12 ++++++------
14
 js/src/jit/arm64/vixl/Instrument-vixl.cpp   |  4 +++-
15
 js/src/jit/arm64/vixl/MozSimulator-vixl.cpp |  8 ++++++--
16
 5 files changed, 24 insertions(+), 14 deletions(-)
17
18
diff --git js/src/jit/arm64/MacroAssembler-arm64.cpp js/src/jit/arm64/MacroAssembler-arm64.cpp
19
index 013fefd85e9b..f1704c622cb6 100644
20
--- js/src/jit/arm64/MacroAssembler-arm64.cpp
21
+++ js/src/jit/arm64/MacroAssembler-arm64.cpp
22
@@ -682,7 +682,9 @@ MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm)
23
     *stackAdjust = stackForCall;
24
     reserveStack(*stackAdjust);
25
     {
26
-        moveResolver_.resolve();
27
+        enoughMemory_ &= moveResolver_.resolve();
28
+        if (!enoughMemory_)
29
+            return;
30
         MoveEmitter emitter(*this);
31
         emitter.emit(moveResolver_);
32
         emitter.finish();
33
diff --git js/src/jit/arm64/vixl/Debugger-vixl.cpp js/src/jit/arm64/vixl/Debugger-vixl.cpp
34
index 85097ed5a086..2f4966fbef15 100644
35
--- js/src/jit/arm64/vixl/Debugger-vixl.cpp
36
+++ js/src/jit/arm64/vixl/Debugger-vixl.cpp
37
@@ -30,6 +30,7 @@
38
 
39
 #include "jit/arm64/vixl/Debugger-vixl.h"
40
 
41
+#include "mozilla/Unused.h"
42
 #include "mozilla/Vector.h"
43
 
44
 #include "jsalloc.h"
45
@@ -1109,6 +1110,7 @@ bool DebugCommand::Match(const char* name, const char** aliases) {
46
 
47
 
48
 DebugCommand* DebugCommand::Parse(char* line) {
49
+  using mozilla::Unused;
50
   TokenVector args;
51
 
52
   for (char* chunk = strtok(line, " \t");
53
@@ -1120,15 +1122,15 @@ DebugCommand* DebugCommand::Parse(char* line) {
54
       Token* format = FormatToken::Tokenize(dot + 1);
55
       if (format != NULL) {
56
         *dot = '\0';
57
-        args.append(Token::Tokenize(chunk));
58
-        args.append(format);
59
+        Unused << args.append(Token::Tokenize(chunk));
60
+        Unused << args.append(format);
61
       } else {
62
         // Error while parsing the format, push the UnknownToken so an error
63
         // can be accurately reported.
64
-        args.append(Token::Tokenize(chunk));
65
+        Unused << args.append(Token::Tokenize(chunk));
66
       }
67
     } else {
68
-      args.append(Token::Tokenize(chunk));
69
+      Unused << args.append(Token::Tokenize(chunk));
70
     }
71
   }
72
 
73
diff --git js/src/jit/arm64/vixl/Decoder-vixl.cpp js/src/jit/arm64/vixl/Decoder-vixl.cpp
74
index 5865689ae6fa..c74f71a11b24 100644
75
--- js/src/jit/arm64/vixl/Decoder-vixl.cpp
76
+++ js/src/jit/arm64/vixl/Decoder-vixl.cpp
77
@@ -112,12 +112,12 @@ void Decoder::DecodeInstruction(const Instruction *instr) {
78
 }
79
 
80
 void Decoder::AppendVisitor(DecoderVisitor* new_visitor) {
81
-  visitors_.append(new_visitor);
82
+  MOZ_ALWAYS_TRUE(visitors_.append(new_visitor));
83
 }
84
 
85
 
86
 void Decoder::PrependVisitor(DecoderVisitor* new_visitor) {
87
-  visitors_.insert(visitors_.begin(), new_visitor);
88
+  MOZ_ALWAYS_TRUE(visitors_.insert(visitors_.begin(), new_visitor));
89
 }
90
 
91
 
92
@@ -125,12 +125,12 @@ void Decoder::InsertVisitorBefore(DecoderVisitor* new_visitor,
93
                                   DecoderVisitor* registered_visitor) {
94
   for (auto it = visitors_.begin(); it != visitors_.end(); it++) {
95
     if (*it == registered_visitor) {
96
-      visitors_.insert(it, new_visitor);
97
+      MOZ_ALWAYS_TRUE(visitors_.insert(it, new_visitor));
98
       return;
99
     }
100
   }
101
   // We reached the end of the list without finding registered_visitor.
102
-  visitors_.append(new_visitor);
103
+  MOZ_ALWAYS_TRUE(visitors_.append(new_visitor));
104
 }
105
 
106
 
107
@@ -139,12 +139,12 @@ void Decoder::InsertVisitorAfter(DecoderVisitor* new_visitor,
108
   for (auto it = visitors_.begin(); it != visitors_.end(); it++) {
109
     if (*it == registered_visitor) {
110
       it++;
111
-      visitors_.insert(it, new_visitor);
112
+      MOZ_ALWAYS_TRUE(visitors_.insert(it, new_visitor));
113
       return;
114
     }
115
   }
116
   // We reached the end of the list without finding registered_visitor.
117
-  visitors_.append(new_visitor);
118
+  MOZ_ALWAYS_TRUE(visitors_.append(new_visitor));
119
 }
120
 
121
 
122
diff --git js/src/jit/arm64/vixl/Instrument-vixl.cpp js/src/jit/arm64/vixl/Instrument-vixl.cpp
123
index 7653e0856281..15d143c8ec13 100644
124
--- js/src/jit/arm64/vixl/Instrument-vixl.cpp
125
+++ js/src/jit/arm64/vixl/Instrument-vixl.cpp
126
@@ -26,6 +26,8 @@
127
 
128
 #include "jit/arm64/vixl/Instrument-vixl.h"
129
 
130
+#include "mozilla/Unused.h"
131
+
132
 namespace vixl {
133
 
134
 Counter::Counter(const char* name, CounterType type)
135
@@ -139,7 +141,7 @@ Instrument::Instrument(const char* datafile, uint64_t sample_period)
136
   // Construct Counter objects from counter description array.
137
   for (int i = 0; i < num_counters; i++) {
138
     if (Counter* counter = js_new<Counter>(kCounterList[i].name, kCounterList[i].type))
139
-      counters_.append(counter);
140
+      mozilla::Unused << counters_.append(counter);
141
   }
142
 
143
   DumpCounterNames();
144
diff --git js/src/jit/arm64/vixl/MozSimulator-vixl.cpp js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
145
index 0f8acebf9de6..284413bc5875 100644
146
--- js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
147
+++ js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
148
@@ -29,6 +29,7 @@
149
 #include "jit/arm64/vixl/Debugger-vixl.h"
150
 #include "jit/arm64/vixl/Simulator-vixl.h"
151
 #include "jit/IonTypes.h"
152
+#include "js/Utility.h"
153
 #include "threading/LockGuard.h"
154
 #include "vm/Runtime.h"
155
 #include "wasm/WasmCode.h"
156
@@ -427,9 +428,12 @@ void Simulator::VisitException(const Instruction* instr) {
157
         case kCallRtRedirected:
158
           VisitCallRedirection(instr);
159
           return;
160
-        case kMarkStackPointer:
161
-          spStack_.append(xreg(31, Reg31IsStackPointer));
162
+        case kMarkStackPointer: {
163
+          js::AutoEnterOOMUnsafeRegion oomUnsafe;
164
+          if (!spStack_.append(xreg(31, Reg31IsStackPointer)))
165
+            oomUnsafe.crash("tracking stack for ARM64 simulator");
166
           return;
167
+        }
168
         case kCheckStackPointer: {
169
           int64_t current = xreg(31, Reg31IsStackPointer);
170
           int64_t expected = spStack_.popCopy();
(-)a/www/firefox/files/patch-bug1357874 (-43 lines)
Removed Link Here
1
commit 50d30e203b35
2
Author: Jim Chen <nchen@mozilla.com>
3
Date:   Mon May 1 14:46:00 2017 -0400
4
5
    Bug 1357874 - Add more AArch64 support to JS code; r=luke
6
    
7
    * Fix a parentheses warning when compiling testGCAllocator.cpp.
8
    
9
    * Enable trace logging in TraceLogging.cpp.
10
---
11
 js/src/jsapi-tests/testGCAllocator.cpp |  2 +-
12
 js/src/jsmath.cpp                      |  2 ++
13
 js/src/jsnativestack.cpp               | 10 +++++-----
14
 js/src/vm/TraceLogging.cpp             |  2 +-
15
 js/src/wasm/WasmSignalHandlers.cpp     |  2 ++
16
 5 files changed, 11 insertions(+), 7 deletions(-)
17
18
diff --git js/src/jsapi-tests/testGCAllocator.cpp js/src/jsapi-tests/testGCAllocator.cpp
19
index 229e56422fdf..ec5407e8cca1 100644
20
--- js/src/jsapi-tests/testGCAllocator.cpp
21
+++ js/src/jsapi-tests/testGCAllocator.cpp
22
@@ -315,7 +315,7 @@ mapMemoryAt(void* desired, size_t length)
23
 
24
 #if defined(__ia64__) || defined(__aarch64__) || \
25
     (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
26
-    MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
27
+    MOZ_RELEASE_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0);
28
 #endif
29
     void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
30
     if (region == MAP_FAILED)
31
diff --git js/src/vm/TraceLogging.cpp js/src/vm/TraceLogging.cpp
32
index c7bc6a84b2e9..82fdf7c77e8a 100644
33
--- js/src/vm/TraceLogging.cpp
34
+++ js/src/vm/TraceLogging.cpp
35
@@ -61,7 +61,7 @@ rdtsc(void)
36
     return result;
37
 
38
 }
39
-#elif defined(__arm__)
40
+#elif defined(__arm__) || defined(__aarch64__)
41
 
42
 #include <sys/time.h>
43
 
(-)a/www/firefox/files/patch-bug1360321 (-49 lines)
Removed Link Here
1
commit a2dff5ad917b
2
Author: Jim Chen <nchen@mozilla.com>
3
Date:   Wed May 17 13:06:23 2017 -0400
4
5
    Bug 1360321 - 10. Fix opt build warnings in VIXL; r=me
6
    
7
    Fix an unused variable warning for `visitor` because it's only used in
8
    the assertion macro.
9
    
10
    Fix several no-return-value errors because the compiler cannot assume
11
    the VIXL_UNREACHABLE() macro is actually unreachable.
12
    
13
    r=me for trivial patch.
14
    
15
    MozReview-Commit-ID: 13IlMyUsXUN
16
---
17
 js/src/jit/arm64/vixl/Decoder-vixl.h | 2 ++
18
 js/src/jit/arm64/vixl/Globals-vixl.h | 2 +-
19
 2 files changed, 3 insertions(+), 1 deletion(-)
20
21
diff --git js/src/jit/arm64/vixl/Decoder-vixl.h js/src/jit/arm64/vixl/Decoder-vixl.h
22
index 95dd589e8ab0..742c6f954c72 100644
23
--- js/src/jit/arm64/vixl/Decoder-vixl.h
24
+++ js/src/jit/arm64/vixl/Decoder-vixl.h
25
@@ -151,9 +151,11 @@ class Decoder {
26
 
27
   // Top-level wrappers around the actual decoding function.
28
   void Decode(const Instruction* instr) {
29
+#ifdef DEBUG
30
     for (auto visitor : visitors_) {
31
       VIXL_ASSERT(visitor->IsConstVisitor());
32
     }
33
+#endif
34
     DecodeInstruction(instr);
35
   }
36
   void Decode(Instruction* instr) {
37
diff --git js/src/jit/arm64/vixl/Globals-vixl.h js/src/jit/arm64/vixl/Globals-vixl.h
38
index 8a7418eb8c47..39d9c1d3f37d 100644
39
--- js/src/jit/arm64/vixl/Globals-vixl.h
40
+++ js/src/jit/arm64/vixl/Globals-vixl.h
41
@@ -76,7 +76,7 @@ const int MBytes = 1024 * KBytes;
42
   #define VIXL_ASSERT(condition) ((void) 0)
43
   #define VIXL_CHECK(condition) ((void) 0)
44
   #define VIXL_UNIMPLEMENTED() ((void) 0)
45
-  #define VIXL_UNREACHABLE() ((void) 0)
46
+  #define VIXL_UNREACHABLE() MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE()
47
 #endif
48
 // This is not as powerful as template based assertions, but it is simple.
49
 // It assumes that the descriptions are unique. If this starts being a problem,
(-)a/www/firefox/files/patch-bug1376411 (-9687 lines)
Removed Link Here
1
Update libc crate to 0.2.24 for FreeBSD aarch64 support.
2
3
diff --git js/src/Cargo.lock js/src/Cargo.lock
4
index 8466b5f1a9e5..438516496682 100644
5
--- js/src/Cargo.lock
6
+++ js/src/Cargo.lock
7
@@ -2,7 +2,7 @@
8
 name = "mozjs_sys"
9
 version = "0.0.0"
10
 dependencies = [
11
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
12
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
13
  "libz-sys 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)",
14
 ]
15
 
16
@@ -13,7 +13,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
17
 
18
 [[package]]
19
 name = "libc"
20
-version = "0.2.20"
21
+version = "0.2.24"
22
 source = "registry+https://github.com/rust-lang/crates.io-index"
23
 
24
 [[package]]
25
@@ -22,7 +22,7 @@ version = "1.0.12"
26
 source = "registry+https://github.com/rust-lang/crates.io-index"
27
 dependencies = [
28
  "gcc 0.3.42 (registry+https://github.com/rust-lang/crates.io-index)",
29
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
30
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
31
  "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
32
 ]
33
 
34
@@ -33,6 +33,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
35
 
36
 [metadata]
37
 "checksum gcc 0.3.42 (registry+https://github.com/rust-lang/crates.io-index)" = "291055c78f59ca3d84c99026c9501c469413d386bb46be1e1cf1d285cd1db3b0"
38
-"checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5"
39
+"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc"
40
 "checksum libz-sys 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "7616099a575493da60cddc1174b686fcfb00ece89dc6f61f31ff47c35f07bbe8"
41
 "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
42
diff --git third_party/rust/libc/.cargo-checksum.json third_party/rust/libc/.cargo-checksum.json
43
index e1e2ea34c5e4..3514e55b4293 100644
44
--- third_party/rust/libc/.cargo-checksum.json
45
+++ third_party/rust/libc/.cargo-checksum.json
46
@@ -1 +1 @@
47
-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"7cdd02047a3044fcc50a43aacede564cfbe061bab9ccd143a58e7e92e64750c2","Cargo.toml":"00205808e35bc6a436829e57222639e63a899330cd2fd6303a37d5b2f2335667","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"4222225ac1d974faee08172b0b0773dfe2b312a13054f090f04c651aa1d1e6ef","appveyor.yml":"c0d70c650b6231e6ff78a352224f1a522a9be69d9da4251adbaddb3f0393294d","ci/README.md":"be804f15e2128e5fd4b160cb0b13cff5f19e7d77b55ec5254aa6fd8731c84f0d","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"62ca7317439f9c303990e897450a91cd467be05eb75dfc01456d417932ac8672","ci/docker/arm-linux-androideabi/Dockerfile":"172bac5a76024737847ffdac49f68e2b3d890cb2fc1b5e3f7aaaf19b46916830","ci/docker/arm-linux-androideabi/accept-licenses.sh":"84ad00815f628005ed22c5d6cd14990ebc97812a7163bd275b2877904eddab53","ci/docker/arm-linux-androideabi/install-ndk.sh":"eef063bb01a16c0f90471dbce1b5a395b53141d7704e15a3c9a1c4fc5e06d4b1","ci/docker/arm-linux-androideabi/install-sdk.sh":"42c04b17c4a35bef58757332e960a6e4aba1b5e41f8fc0182265163ff93f6182","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"e349f7caa463adbde8d6ec4d2b9f7720ed81c77f48d75bbfb78c89751f55c2dc","ci/docker/i686-unknown-linux-gnu/Dockerfile":"07e9df6ba91025cbec7ae81ade63f8cfb8a54c5e1e5a8f8def0617e17bd59db0","ci/docker/i686-unknown-linux-musl/Dockerfile":"1a4d064adff4a8f58773305567cfe5d915bcd0762bcb0e101cf6f4ca628a96da","ci/docker/mips-unknown-linux-gnu/Dockerfile":"860299d96ee50ebdbd788e65eb6ba1f561ef66107647bddffcb2567ac350896b","ci/docker/mips-unknown-linux-musl/Dockerfile":"711c43122fa34cee83a69944493213924b0ff1fccd78c7a141cb2b2127526484","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"163776e0fd38f66df7415421202ac29efc7d345a628947434e573c3885594ab5","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"aef213df08da03ab6a723c3e6e5594a0586251950d81482cf53179d8e64e95c7","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"08b846a338c2ee70100f4e80db812668dc58bfb536c44a95cd1cf004d965186b","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"4da285ffd035d16f5da9e3701841eb86049c8cfa417fa81e53da4ef74152eac0","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"44c3107fb30380785aaed6ff73fa334017a5bb4e3b5c7d4876154f09023a2b99","ci/docker/x86_64-unknown-freebsd/Dockerfile":"ef0f9f63065218728d2daafaa5ba71b17e4ccc23d72e859e0a7133fc64c0815e","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"67fabbc8c6ac02376cf9344251ad49ecdac396b71accb572fd1ae65225325bc0","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"f71019fed5204b950843ef5e56144161fda7e27fad68ed0e8bc4353c388c7bcf","ci/docker/x86_64-unknown-openbsd/Dockerfile":"dfa5c23a6cff8c7a9a846668118c71a8406a360801fd3632fb12e8fbda6b7338","ci/dox.sh":"9ea240a4a607036235fd68c01b5d2a59f365768d103d3be774dcf34aa3ff563e","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"7f6c68dbca93788111170ac4678608957a179e76cfe8c5a51d11dfea1742d7f2","ci/run-qemu.sh":"bb859421170871ef23a8940c5e150efec0c01b95e32d2ce2d37b79a45d9d346c","ci/run.sh":"b6a6307ea989b6a84bad0fd7d46c3206b30f7aa06d0b3e92d6cb1c855f4e0c42","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"f732d3c0dcd6ace854ee32d8f898b96ac42204a799c6e386c4ba88f6e58673dc","src/lib.rs":"cc328e10a4c2879e7de1858aabc30e667cb07398e021e0d2d002f4195632127a","src/macros.rs":"bd9802772b0e5c8b3c550d1c24307f06c0d1e4ce656b4ae1cf092142bbe5412c","src/redox.rs":"3dd158ba9fbbabe96ce2607e91dbf07b93b37c0427734118702dcb4901fe8964","src/unix/bsd/apple/b32.rs":"110ecff78da0e8d405d861447904da403d8b3f6da1f0f9dc9987633f3f04fe46","src/unix/bsd/apple/b64.rs":"e6808081c0b276cca3189628716f507c7c0d00b62417cd44addbdaefe848cec7","src/unix/bsd/apple/mod.rs":"1e854694c38e8eee8ce17e93c4c92755b4b4838cf002a7740108605f58e7d029","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"2c65314cfb38c540979facaea9f97596446dffbc0a2efa29db7c1ace5243f6ee","src/unix/bsd/freebsdlike/freebsd/mod.rs":"77b6c96a8b30761c9ed77f55fd39778fa2248b57ca60c59c8a1035c2821ec5ca","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"c7f46b9ae23fde5a9e245a28ed1380066e67f081323b4d253a18e9da3b97b860","src/unix/bsd/freebsdlike/mod.rs":"66ba7ca5a09a893776e955f7632e5c3cb9457bf39e3823f1b337ec841569b776","src/unix/bsd/mod.rs":"55bf99b86abf3149f2b03f73f3dad3b67f6d11e5ddca4adfb550f6f116449fe0","src/unix/bsd/netbsdlike/mod.rs":"b19e7f839bfeb6ae83fcd73574083d80a5b1b90dbd168b33a6ed0e94a5f5e2b3","src/unix/bsd/netbsdlike/netbsd/mod.rs":"d8539c69d1db8e2e8e3126b3dd6f175eb8157530cec21a05578bed66b55efe5b","src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/netbsd/other/mod.rs":"4d9f7091af8e166943ac6f42ce85558909e5b6e61325039bff7adfbcf4b90212","src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs":"f8cd05dacd3a3136c58da5a2fbe26f703767823b28e74fe8a2b57a7bd98d6d5c","src/unix/bsd/netbsdlike/openbsdlike/mod.rs":"48a32d25326ce03aec64ff0eaac4d921b1a1144f48d020a623306ecf986ea52a","src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs":"b1b9cf7be9f0e4d294a57092594074ad03a65fe0eeac9d1104fa874c313e7900","src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs":"f5d8db6f54efd05520b31b764a6bacbf612e1aebce097d2d5bfaaef3b91f37b5","src/unix/haiku/b32.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/haiku/b64.rs":"b422430c550c0ba833c9206d1350861e344e3a2eb33d7d58693efb35044be1cc","src/unix/haiku/mod.rs":"245d5500a1d836974ef407edeadee36a51a486bf9d5566d129aaa8f51741e966","src/unix/mod.rs":"1dd0ac155b99862e2368618e16ceb071a2a9b525e7a02dea5ef91d624b21f7ce","src/unix/notbsd/android/b32.rs":"148e1b4ed8b4f700d5aa24178af925164176e1c18b54db877ced4b55ba9f03d4","src/unix/notbsd/android/b64.rs":"302caf0aa95fa022030717c58de17d85d814b04350eca081a722ec435bc4f217","src/unix/notbsd/android/mod.rs":"d255ba6737efea3c4c3ef7ef499a54bc1875debdfec4233cbe8e2601afadc994","src/unix/notbsd/linux/mips/mips32.rs":"b268f603f71d854614c20cea00431812def9b683d43e6254ae62a8f88a14f7c3","src/unix/notbsd/linux/mips/mips64.rs":"8bce84a47a6ad7fc95234fdd3513ddb8c78634f4ac18209c0276ab705c092ebe","src/unix/notbsd/linux/mips/mod.rs":"5eaf645c3ce69860062adf2df6bf56bdcad955990401dee671d4f5b8fea755a4","src/unix/notbsd/linux/mod.rs":"ed2287e8a77f3c97ea1ae0497832984b1c3d5b306413428f1823d58490ed25bc","src/unix/notbsd/linux/musl/b32/arm.rs":"0ad8c97458743dc7d81200df0e1223f0a20936933ace77fe786477027597dd7b","src/unix/notbsd/linux/musl/b32/asmjs.rs":"085e410f990312de76f74cb9bbf9fcc27d686e94334143b34511f565d1b8bb91","src/unix/notbsd/linux/musl/b32/mips.rs":"01a92b5dc28ca67e41d7791e398f75210208368e53a848297186de5829d158ec","src/unix/notbsd/linux/musl/b32/mod.rs":"fc7e055edbe6fa170c2bda6b3415066c1871b3e60ebb70a6329d008f77100f0b","src/unix/notbsd/linux/musl/b32/x86.rs":"b47963c6bc5fceec96fded47d58e1c0466b190ec7ae207d666d23be35131c638","src/unix/notbsd/linux/musl/b64/aarch64.rs":"4009c7eaf703472daef2a70bdac910d9fc395a33689ef2e8cf1c4e692445d3f0","src/unix/notbsd/linux/musl/b64/mod.rs":"3f7cc45104103ecff4f7ea6cfdc76d2b0132cff31f7e36a0da2f613ac076256c","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"dc28f5b7284235d6cf5519053cac59a1c16dc39223b71cca0871e4880755f852","src/unix/notbsd/linux/musl/b64/x86_64.rs":"43291acc0dfc92c2fec8ba6ce77ee9ca3c20bcdccec18e149f95ba911cee704b","src/unix/notbsd/linux/musl/mod.rs":"926a5e041377406ec3dc869fae42b1cba3b41e163aacbdbb8122f6a41756baaf","src/unix/notbsd/linux/other/b32/arm.rs":"f5cb989075fa3b5f997e7101495532c8d5c9f3577412d4c07e4c8c1a16f7b43c","src/unix/notbsd/linux/other/b32/mod.rs":"6122be151c5d85b9df6a3aaefc5cafd0657b371cafa9cb31ed9b1a394976af45","src/unix/notbsd/linux/other/b32/powerpc.rs":"3b62052bb9741afa5349098e6e9c675b60e822e41fed6b5e1b694be1872097b1","src/unix/notbsd/linux/other/b32/x86.rs":"1eda37736f5966c7968b594f74f5018f56b6b8c67bbdeb31fc3db1b6e4ac31b4","src/unix/notbsd/linux/other/b64/aarch64.rs":"e0637555c38346f264e666bb235e8c53ae2dfa79310eeaee6e7d916e8e9a7aff","src/unix/notbsd/linux/other/b64/mod.rs":"bee90e8d9217ee344d0e99fd483766a1b28e8b1ded930d44a0400a5e5224bb6a","src/unix/notbsd/linux/other/b64/powerpc64.rs":"3653528376afdd267aaa3ae0020d2e4aca16c28303dcf731cfa96a8ff5db1a5c","src/unix/notbsd/linux/other/b64/sparc64.rs":"fbfb3b17da347723ddf15fb490e51acdddc9ca7e6b4db072370ba2619cc2ff97","src/unix/notbsd/linux/other/b64/x86_64.rs":"8c9bad7d14fc787ec7aa943fd552b7f35b74548a122e53711708de809ef1148d","src/unix/notbsd/linux/other/mod.rs":"9d6643fddab3e68dafa1d34424ea04561d3b414530dd9ce0adde5bc6af828b3a","src/unix/notbsd/linux/s390x.rs":"0ed3108cca67cb731f334d6beecbb99fdfc16de475320007d354fe1c4571fbd8","src/unix/notbsd/mod.rs":"da50b86c6649c3dc12e23185def473d4562128470c3037fae648aeeb27eb5569","src/unix/solaris/mod.rs":"f3956d14342be8631806c56f677d8e14178131578bd26f92d5e90a3cf3f5f37d","src/windows.rs":"acccbd341e81206cb1dc66af41762c193ac0dd719d700b64f7e26c967ee7d670"},"package":"684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5"}
48
\ No newline at end of file
49
+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"7150ee9391a955b2ef7e0762fc61c0c1aab167620ca36d88d78062d93b8334ba",".travis.yml":"85d7a35a85a0653ea7072811fd0ba37cf00df4e0b2bcc3781bfc171220046001","Cargo.toml":"7ea5ce66ef7d756befcc155bdeb4135171920a934ecd384eb9f54359a4ce547a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"8a9859c60f78d9075e22bc9f85b40e0b0216cccaeb7025c9f464cc33dcddaf5c","appveyor.yml":"483ae27670e061eb91f055699a9ad88255050b7b300f183b8580340407751bb4","ci/README.md":"be804f15e2128e5fd4b160cb0b13cff5f19e7d77b55ec5254aa6fd8731c84f0d","ci/android-accept-licenses.sh":"84ad00815f628005ed22c5d6cd14990ebc97812a7163bd275b2877904eddab53","ci/android-install-ndk.sh":"73c5f21438c024ce1b8c793184447ff9aecd83c87cbde8de580b782842b3563f","ci/android-install-sdk.sh":"891900fe4e4ceb04717b91a253753858270defc6d6401936d08c09801c1de178","ci/android-sysimage.sh":"901415631752827454c827e8c51906ba4260612e4021eda98eb7fff771c7d0e8","ci/docker/aarch64-linux-android/Dockerfile":"68f375c6e0b3716f8c0b6ed217bc6c3631fa2b86c578b983a0bf60d0344efd74","ci/docker/aarch64-unknown-linux-gnu/Dockerfile":"62ca7317439f9c303990e897450a91cd467be05eb75dfc01456d417932ac8672","ci/docker/arm-linux-androideabi/Dockerfile":"1193bf048efbeb9be3c9fac0836dcf6ae07e12cdf09b36b386dd4cbd62abbffa","ci/docker/arm-unknown-linux-gnueabihf/Dockerfile":"e349f7caa463adbde8d6ec4d2b9f7720ed81c77f48d75bbfb78c89751f55c2dc","ci/docker/i686-linux-android/Dockerfile":"7c353aecdf0b21d8584392cc6ea31d455adad769034c3ea09191a1b26a2521e1","ci/docker/i686-unknown-linux-gnu/Dockerfile":"07e9df6ba91025cbec7ae81ade63f8cfb8a54c5e1e5a8f8def0617e17bd59db0","ci/docker/i686-unknown-linux-musl/Dockerfile":"fcaedc90fbb90375186b36b4324bff0a042aae70695be0f2b632e3cf7479eae6","ci/docker/mips-unknown-linux-gnu/Dockerfile":"860299d96ee50ebdbd788e65eb6ba1f561ef66107647bddffcb2567ac350896b","ci/docker/mips-unknown-linux-musl/Dockerfile":"711c43122fa34cee83a69944493213924b0ff1fccd78c7a141cb2b2127526484","ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile":"163776e0fd38f66df7415421202ac29efc7d345a628947434e573c3885594ab5","ci/docker/mipsel-unknown-linux-musl/Dockerfile":"aef213df08da03ab6a723c3e6e5594a0586251950d81482cf53179d8e64e95c7","ci/docker/powerpc-unknown-linux-gnu/Dockerfile":"08b846a338c2ee70100f4e80db812668dc58bfb536c44a95cd1cf004d965186b","ci/docker/powerpc64-unknown-linux-gnu/Dockerfile":"4da285ffd035d16f5da9e3701841eb86049c8cfa417fa81e53da4ef74152eac0","ci/docker/x86_64-linux-android/Dockerfile":"a73a344c60575b8ef78b0178f93285ffa2e2d9aa5eb0d2e86d4bad3cab63276f","ci/docker/x86_64-rumprun-netbsd/Dockerfile":"44c3107fb30380785aaed6ff73fa334017a5bb4e3b5c7d4876154f09023a2b99","ci/docker/x86_64-unknown-freebsd/Dockerfile":"ef0f9f63065218728d2daafaa5ba71b17e4ccc23d72e859e0a7133fc64c0815e","ci/docker/x86_64-unknown-linux-gnu/Dockerfile":"67fabbc8c6ac02376cf9344251ad49ecdac396b71accb572fd1ae65225325bc0","ci/docker/x86_64-unknown-linux-musl/Dockerfile":"f71019fed5204b950843ef5e56144161fda7e27fad68ed0e8bc4353c388c7bcf","ci/docker/x86_64-unknown-openbsd/Dockerfile":"dfa5c23a6cff8c7a9a846668118c71a8406a360801fd3632fb12e8fbda6b7338","ci/dox.sh":"9ea240a4a607036235fd68c01b5d2a59f365768d103d3be774dcf34aa3ff563e","ci/ios/deploy_and_run_on_ios_simulator.rs":"3175066fd7f82390f6226d881e1a1dda9767ea2705656870e0d7774e2731800e","ci/landing-page-footer.html":"b70b3112c2147f5c967e7481061ef38bc2d79a28dd55a16fb916d9c9426da2c4","ci/landing-page-head.html":"ad69663fac7924f27d0209bc519d55838e86edfc4133713a6fd08caadac1b142","ci/run-docker.sh":"655712ba6127eb2efe2c641cf4cf1246f3e485096d72ec57b423e9d2bff6fb73","ci/run-qemu.sh":"bb859421170871ef23a8940c5e150efec0c01b95e32d2ce2d37b79a45d9d346c","ci/run.sh":"48c0318287f02889cb73a55e3e2058e79c556d11797d47a1ed66d7c55d1be12f","ci/style.rs":"60564abc1d5197ed1598426dd0d6ee9939a16d2875b03373538f58843bb616c4","src/dox.rs":"bb9a85519e0d4a8d3bfb81301759b9b938435d79da9ce2918248fb2b0df19638","src/lib.rs":"651696755aed40230cde8a505a2dfef61bea52d6349c9b9343497a5c7158ec92","src/macros.rs":"bd9802772b0e5c8b3c550d1c24307f06c0d1e4ce656b4ae1cf092142bbe5412c","src/redox.rs":"3dd158ba9fbbabe96ce2607e91dbf07b93b37c0427734118702dcb4901fe8964","src/unix/bsd/apple/b32.rs":"110ecff78da0e8d405d861447904da403d8b3f6da1f0f9dc9987633f3f04fe46","src/unix/bsd/apple/b64.rs":"2c51c1c063bfb5076ecf08fbc9371ce9473878d2e046c186eb9433955f6f8ba6","src/unix/bsd/apple/mod.rs":"8e437addefb32336671f46b93a5a8827260163abcf623c0f1613d4d685faca34","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"54b3b30c4cac35ced9197e7267f209b0f168de8a6899ab0cba290c5ae399f0e7","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"c7f46b9ae23fde5a9e245a28ed1380066e67f081323b4d253a18e9da3b97b860","src/unix/bsd/freebsdlike/freebsd/mod.rs":"ba1bd1487b41be91115a21e3968d15e4d877043ba4946cd11ed2be2ee66afc19","src/unix/bsd/freebsdlike/freebsd/x86.rs":"54311d3ebf2bb091ab22361e377e6ef9224aec2ecfe459fbfcedde4932db9c58","src/unix/bsd/freebsdlike/freebsd/x86_64.rs":"c7f46b9ae23fde5a9e245a28ed1380066e67f081323b4d253a18e9da3b97b860","src/unix/bsd/freebsdlike/mod.rs":"6b184872bf7979e5da042399a8aa3a46fff6716301f3d068912a2d6296c6ab94","src/unix/bsd/mod.rs":"c75c328dc62a621ce2a9408cb8764206e365e6f14db1bfe535a23c4728521d97","src/unix/bsd/netbsdlike/mod.rs":"50ca4e29f06669a0ebff72f2f24b2b08ff55478f580b1684e16a0cf6938a6a50","src/unix/bsd/netbsdlike/netbsd/mod.rs":"51f6f2309d59f8fb5dbd6b29ac4aa7ad431f1dddae151aef2db9f66c5f3362b0","src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/netbsd/other/mod.rs":"4d9f7091af8e166943ac6f42ce85558909e5b6e61325039bff7adfbcf4b90212","src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs":"f8cd05dacd3a3136c58da5a2fbe26f703767823b28e74fe8a2b57a7bd98d6d5c","src/unix/bsd/netbsdlike/openbsdlike/mod.rs":"97a7cdb8824949e6ca7202691bde4e1c46c2cfdeb5f3735a033448b52da1bb59","src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs":"31686679c2df5f11437a338b9281fa0dd4f8d061dcd895d67619992171e115c9","src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs":"927eeccaf3269d299db4c2a55f8010807bf43dfa894aea6a783215f5d3560baa","src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs":"f5d8db6f54efd05520b31b764a6bacbf612e1aebce097d2d5bfaaef3b91f37b5","src/unix/haiku/b32.rs":"bd251a102bed65d5cb3459275f6ec3310fe5803ff4c9651212115548f86256d0","src/unix/haiku/b64.rs":"b422430c550c0ba833c9206d1350861e344e3a2eb33d7d58693efb35044be1cc","src/unix/haiku/mod.rs":"f0daa9910d2beade8be1d67bab652c239e779a27e4be54f93b7bceb7afe45d30","src/unix/mod.rs":"841d523014553865ee35355425da44fe1a31944a991831efc7c046263ad44a89","src/unix/notbsd/android/b32/arm.rs":"d63a234f3a2399bdef1fa13c6a209386cb5ddac04c90f2c6d42badc8235dc49d","src/unix/notbsd/android/b32/mod.rs":"c09b53e42b286a7ec56fb28d0a3e71ec42fecaec39b2015d1d4a3338b172c570","src/unix/notbsd/android/b32/x86.rs":"10e6879dcbf136f0e907337987a0609b357e27e0f24ccb907525fcad881c24c3","src/unix/notbsd/android/b64/aarch64.rs":"d0a25e73f8d02f8412fa9237e41d3f4993b45603a2a8f8d1690bc6624a190d42","src/unix/notbsd/android/b64/mod.rs":"172d704a50d6fb9f67683c7e66ff15b5c9f7b11e7064aa8bd129228ff074393f","src/unix/notbsd/android/b64/x86_64.rs":"a2b048dad18c60ede035645bbfea2ba3dd75197c1ee0d54fb5fcab14d6c35194","src/unix/notbsd/android/mod.rs":"25d09d308f0beb7925a3efdf1fae8412251ea04f595f6852e52114df51b6747e","src/unix/notbsd/linux/mips/mips32.rs":"003b4e204e13380cd7f1ce783a0eded0f520f4e7d25634738e8ee50fc09b07c9","src/unix/notbsd/linux/mips/mips64.rs":"a8d3e38e9f9359233db04c66d7a8de957530ad2b8596661d3ac25ea81ee44a78","src/unix/notbsd/linux/mips/mod.rs":"7157a427fabff6e970288c75cb246981e316f76f3c2bb59b254d613a8389f859","src/unix/notbsd/linux/mod.rs":"c200ff5e7c7ad5d0b4c01531384acd408057665cb49175fba0d453b08c166bcf","src/unix/notbsd/linux/musl/b32/arm.rs":"d43ba5c528926261b1ccd529ab55636254360a084ab84a7ec22a4eb5afddb8f8","src/unix/notbsd/linux/musl/b32/asmjs.rs":"085e410f990312de76f74cb9bbf9fcc27d686e94334143b34511f565d1b8bb91","src/unix/notbsd/linux/musl/b32/mips.rs":"941c88bc413ba2b87eb6a6cfe03355ee148b865f39598456965b3d04b3adbbe6","src/unix/notbsd/linux/musl/b32/mod.rs":"fc7e055edbe6fa170c2bda6b3415066c1871b3e60ebb70a6329d008f77100f0b","src/unix/notbsd/linux/musl/b32/x86.rs":"ffa5781b52a7d2774a34b1e3e2034a498b919fd96eb85e88098dba2e674a3797","src/unix/notbsd/linux/musl/b64/aarch64.rs":"4009c7eaf703472daef2a70bdac910d9fc395a33689ef2e8cf1c4e692445d3f0","src/unix/notbsd/linux/musl/b64/mod.rs":"d9b03a59a54a568b07ffa4380103a926cbb45dbfd87745edef79cd971ef31283","src/unix/notbsd/linux/musl/b64/powerpc64.rs":"dc28f5b7284235d6cf5519053cac59a1c16dc39223b71cca0871e4880755f852","src/unix/notbsd/linux/musl/b64/x86_64.rs":"43291acc0dfc92c2fec8ba6ce77ee9ca3c20bcdccec18e149f95ba911cee704b","src/unix/notbsd/linux/musl/mod.rs":"0bd97702f5c84181c53f45466fb04afb9441f6950580b6ad59257e5c73089796","src/unix/notbsd/linux/other/b32/arm.rs":"d373022fd152341ec8f5d106937c7898dd68fb4c0346bd94a37526542a605e9a","src/unix/notbsd/linux/other/b32/mod.rs":"6122be151c5d85b9df6a3aaefc5cafd0657b371cafa9cb31ed9b1a394976af45","src/unix/notbsd/linux/other/b32/powerpc.rs":"cc85e75675abc37414fc7701dda7c3f6396e7b2d3c52eea7febdc41f7b033ea9","src/unix/notbsd/linux/other/b32/x86.rs":"5a6c789355da5abf64c2a0c867d2dfd4f72f004d0bd6c476fd34172b340ea1c3","src/unix/notbsd/linux/other/b64/aarch64.rs":"ce342b37a4a60c216625c8e177a50b3f328bdfd5c527e32e06c73f4aa5926829","src/unix/notbsd/linux/other/b64/mod.rs":"bee90e8d9217ee344d0e99fd483766a1b28e8b1ded930d44a0400a5e5224bb6a","src/unix/notbsd/linux/other/b64/powerpc64.rs":"fc7131f39a75a9e35d474d70b0bc829c52590dadf472ae5785972a94ffb95f12","src/unix/notbsd/linux/other/b64/sparc64.rs":"0ba7f399349bc586ebb73d0caef5c67f195c9e3a942eabfb2efd133b4cea9872","src/unix/notbsd/linux/other/b64/x86_64.rs":"bf17645b237d8059da5e9cc0f6d2d56bc665b0946a6deb8aedf46e5b44578fa6","src/unix/notbsd/linux/other/mod.rs":"46b060787a60493e71406be35b77c24048cdc54326b65c9961fbb1fb9d354de3","src/unix/notbsd/linux/s390x.rs":"2dec96036cadd8354cd56ef8dd7018e75ae92326ec7b5963bc9cdbba0c7d694b","src/unix/notbsd/mod.rs":"bb4550e749328a3aebc450a1684c136821babc3fc161093eecb231f3998cfe8c","src/unix/solaris/mod.rs":"ba70c4ebd371f2580c1fb8f3f6cd32a391ec017e1eed9812137caa94e5149a03","src/unix/uclibc/mips/mips32.rs":"31b23e466cffb86116421ec9240b86e7419aacd84b0b1b04d23c7142c8717566","src/unix/uclibc/mips/mips64.rs":"e67eec1636a998b047d89a4cda1c99cb6bc3071db017762675179a68201c4438","src/unix/uclibc/mips/mod.rs":"74817a9b1ee3998d8e0b751a555d57225f70fd979c283c94ada344a162a8b856","src/unix/uclibc/mod.rs":"3cef4087b743e5af239a8c699c2eeaeda4e19bb57a3683736c8bd87dc71e0a2d","src/unix/uclibc/x86_64/mod.rs":"98e6685519372f7b247e3bb0008ed2ee8d94fd7cca0ed2f0b9336485c734d8a9","src/windows.rs":"acccbd341e81206cb1dc66af41762c193ac0dd719d700b64f7e26c967ee7d670"},"package":"38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc"}
50
\ No newline at end of file
51
diff --git third_party/rust/libc/.travis.yml third_party/rust/libc/.travis.yml
52
index fa07ffc7c7b6..b7721b5e6049 100644
53
--- third_party/rust/libc/.travis.yml
54
+++ third_party/rust/libc/.travis.yml
55
@@ -4,8 +4,7 @@ dist: trusty
56
 services:
57
   - docker
58
 install:
59
-  - curl https://static.rust-lang.org/rustup.sh |
60
-    sh -s -- --add-target=$TARGET --disable-sudo -y --prefix=`rustc --print sysroot`
61
+  - if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
62
 script:
63
   - cargo build
64
   - cargo build --no-default-features
65
@@ -17,7 +16,6 @@ script:
66
       sh ci/run.sh $TARGET;
67
     fi
68
   - rustc ci/style.rs && ./style src
69
-osx_image: xcode7.3
70
 env:
71
   global:
72
     secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="
73
@@ -25,26 +23,26 @@ matrix:
74
   include:
75
     # 1.0.0 compat
76
     - os: linux
77
-      env: TARGET=x86_64-unknown-linux-gnu
78
+      env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
79
       rust: 1.0.0
80
       script: cargo build
81
       install:
82
 
83
     # build documentation
84
     - os: linux
85
-      env: TARGET=x86_64-unknown-linux-gnu
86
+      env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
87
       rust: nightly
88
       script: sh ci/dox.sh
89
 
90
     # stable compat
91
     - os: linux
92
-      env: TARGET=x86_64-unknown-linux-gnu
93
+      env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
94
       rust: stable
95
     - os: linux
96
       env: TARGET=i686-unknown-linux-gnu
97
       rust: stable
98
     - os: osx
99
-      env: TARGET=x86_64-apple-darwin
100
+      env: TARGET=x86_64-apple-darwin NO_ADD=1
101
       rust: stable
102
     - os: osx
103
       env: TARGET=i686-apple-darwin
104
@@ -53,6 +51,16 @@ matrix:
105
       env: TARGET=arm-linux-androideabi
106
       rust: stable
107
     - os: linux
108
+      env: TARGET=aarch64-linux-android
109
+      rust: stable
110
+    - os: linux
111
+      env: TARGET=i686-linux-android
112
+      rust: stable
113
+    # as of 2017/05/03 x86_64-linux-android are not on stable
114
+    - os: linux
115
+      env: TARGET=x86_64-linux-android
116
+      rust: beta
117
+    - os: linux
118
       env: TARGET=x86_64-unknown-linux-musl
119
       rust: stable
120
     - os: linux
121
@@ -65,9 +73,11 @@ matrix:
122
       env: TARGET=aarch64-unknown-linux-gnu
123
       rust: stable
124
     - os: osx
125
+      osx_image: xcode8.2
126
       env: TARGET=i386-apple-ios
127
       rust: stable
128
     - os: osx
129
+      osx_image: xcode8.2
130
       env: TARGET=x86_64-apple-ios
131
       rust: stable
132
     - os: linux
133
@@ -94,18 +104,18 @@ matrix:
134
 
135
     # beta
136
     - os: linux
137
-      env: TARGET=x86_64-unknown-linux-gnu
138
+      env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
139
       rust: beta
140
     - os: osx
141
-      env: TARGET=x86_64-apple-darwin
142
+      env: TARGET=x86_64-apple-darwin NO_ADD=1
143
       rust: beta
144
 
145
     # nightly
146
     - os: linux
147
-      env: TARGET=x86_64-unknown-linux-gnu
148
+      env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
149
       rust: nightly
150
     - os: osx
151
-      env: TARGET=x86_64-apple-darwin
152
+      env: TARGET=x86_64-apple-darwin NO_ADD=1
153
       rust: nightly
154
 
155
     # QEMU based targets that compile in an emulator
156
diff --git third_party/rust/libc/Cargo.toml third_party/rust/libc/Cargo.toml
157
index 084337e0d30f..ecebaed935bb 100644
158
--- third_party/rust/libc/Cargo.toml
159
+++ third_party/rust/libc/Cargo.toml
160
@@ -1,7 +1,7 @@
161
 [package]
162
 
163
 name = "libc"
164
-version = "0.2.20"
165
+version = "0.2.24"
166
 authors = ["The Rust Project Developers"]
167
 license = "MIT/Apache-2.0"
168
 readme = "README.md"
169
diff --git third_party/rust/libc/README.md third_party/rust/libc/README.md
170
index 255283643508..67535d211e9c 100644
171
--- third_party/rust/libc/README.md
172
+++ third_party/rust/libc/README.md
173
@@ -98,6 +98,25 @@ We have two automated tests running on [Travis](https://travis-ci.org/rust-lang/
174
 2. Style checker
175
   - `rustc ci/style.rs && ./style src`
176
 
177
+### Releasing your change to crates.io
178
+
179
+Now that you've done the amazing job of landing your new API or your new
180
+platform in this crate, the next step is to get that sweet, sweet usage from
181
+crates.io! The only next step is to bump the version of libc and then publish
182
+it. If you'd like to get a release out ASAP you can follow these steps:
183
+
184
+1. Update the version number in `Cargo.toml`, you'll just be bumping the patch
185
+   version number.
186
+2. Run `cargo update` to regenerate the lockfile to encode your version bump in
187
+   the lock file. You may pull in some other updated dependencies, that's ok.
188
+3. Send a PR to this repository. It should [look like this][example], but it'd
189
+   also be nice to fill out the description with a small rationale for the
190
+   release (any rationale is ok though!)
191
+4. Once merged the release will be tagged and published by one of the libc crate
192
+   maintainers.
193
+
194
+[example]: https://github.com/rust-lang/libc/pull/583
195
+
196
 ## Platforms and Documentation
197
 
198
 The following platforms are currently tested and have documentation available:
199
@@ -111,7 +130,7 @@ Tested:
200
   * [`i686-apple-darwin`](https://doc.rust-lang.org/libc/i686-apple-darwin/libc/)
201
   * [`x86_64-apple-darwin`](https://doc.rust-lang.org/libc/x86_64-apple-darwin/libc/)
202
     (OSX)
203
-  * `i686-apple-ios`
204
+  * `i386-apple-ios`
205
   * `x86_64-apple-ios`
206
   * [`i686-unknown-linux-gnu`](https://doc.rust-lang.org/libc/i686-unknown-linux-gnu/libc/)
207
   * [`x86_64-unknown-linux-gnu`](https://doc.rust-lang.org/libc/x86_64-unknown-linux-gnu/libc/)
208
diff --git third_party/rust/libc/appveyor.yml third_party/rust/libc/appveyor.yml
209
index a851bb87b6c3..b6c666c8b538 100644
210
--- third_party/rust/libc/appveyor.yml
211
+++ third_party/rust/libc/appveyor.yml
212
@@ -7,7 +7,7 @@ environment:
213
   - TARGET: x86_64-pc-windows-msvc
214
   - TARGET: i686-pc-windows-msvc
215
 install:
216
-  - curl -sSf -o rustup-init.exe https://win.rustup.rs/
217
+  - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
218
   - rustup-init.exe -y --default-host %TARGET%
219
   - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
220
   - if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
221
diff --git third_party/rust/libc/ci/android-accept-licenses.sh third_party/rust/libc/ci/android-accept-licenses.sh
222
new file mode 100755
223
index 000000000000..8d8f60a5ec26
224
--- /dev/null
225
+++ third_party/rust/libc/ci/android-accept-licenses.sh
226
@@ -0,0 +1,15 @@
227
+#!/usr/bin/expect -f
228
+# ignore-license
229
+
230
+set timeout 1800
231
+set cmd [lindex $argv 0]
232
+set licenses [lindex $argv 1]
233
+
234
+spawn {*}$cmd
235
+expect {
236
+  "Do you accept the license '*'*" {
237
+        exp_send "y\r"
238
+        exp_continue
239
+  }
240
+  eof
241
+}
242
diff --git third_party/rust/libc/ci/android-install-ndk.sh third_party/rust/libc/ci/android-install-ndk.sh
243
new file mode 100644
244
index 000000000000..75bcd20f2f77
245
--- /dev/null
246
+++ third_party/rust/libc/ci/android-install-ndk.sh
247
@@ -0,0 +1,36 @@
248
+#!/bin/sh
249
+# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
250
+# file at the top-level directory of this distribution and at
251
+# http://rust-lang.org/COPYRIGHT.
252
+#
253
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
254
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
255
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
256
+# option. This file may not be copied, modified, or distributed
257
+# except according to those terms.
258
+
259
+set -ex
260
+
261
+curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
262
+unzip -q android-ndk-r13b-linux-x86_64.zip
263
+
264
+case "$1" in
265
+  aarch64)
266
+    arch=arm64
267
+    ;;
268
+
269
+  i686)
270
+    arch=x86
271
+    ;;
272
+
273
+  *)
274
+    arch=$1
275
+    ;;
276
+esac;
277
+
278
+android-ndk-r13b/build/tools/make_standalone_toolchain.py \
279
+        --install-dir /android/ndk-$1 \
280
+        --arch $arch \
281
+        --api 24
282
+
283
+rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
284
diff --git third_party/rust/libc/ci/android-install-sdk.sh third_party/rust/libc/ci/android-install-sdk.sh
285
new file mode 100644
286
index 000000000000..d03b7623bf78
287
--- /dev/null
288
+++ third_party/rust/libc/ci/android-install-sdk.sh
289
@@ -0,0 +1,57 @@
290
+#!/bin/sh
291
+# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
292
+# file at the top-level directory of this distribution and at
293
+# http://rust-lang.org/COPYRIGHT.
294
+#
295
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
296
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
297
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
298
+# option. This file may not be copied, modified, or distributed
299
+# except according to those terms.
300
+
301
+set -ex
302
+
303
+# Prep the SDK and emulator
304
+#
305
+# Note that the update process requires that we accept a bunch of licenses, and
306
+# we can't just pipe `yes` into it for some reason, so we take the same strategy
307
+# located in https://github.com/appunite/docker by just wrapping it in a script
308
+# which apparently magically accepts the licenses.
309
+
310
+mkdir sdk
311
+curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O
312
+unzip -d sdk tools_r25.2.5-linux.zip
313
+
314
+filter="platform-tools,android-24"
315
+
316
+case "$1" in
317
+  arm | armv7)
318
+    abi=armeabi-v7a
319
+    ;;
320
+
321
+  aarch64)
322
+    abi=arm64-v8a
323
+    ;;
324
+
325
+  i686)
326
+    abi=x86
327
+    ;;
328
+
329
+  x86_64)
330
+    abi=x86_64
331
+    ;;
332
+
333
+  *)
334
+    echo "invalid arch: $1"
335
+    exit 1
336
+    ;;
337
+esac;
338
+
339
+filter="$filter,sys-img-$abi-android-24"
340
+
341
+./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
342
+
343
+echo "no" | android create avd \
344
+                --name $1 \
345
+                --target android-24 \
346
+                --abi $abi
347
diff --git third_party/rust/libc/ci/android-sysimage.sh third_party/rust/libc/ci/android-sysimage.sh
348
new file mode 100644
349
index 000000000000..9611dfeb0d52
350
--- /dev/null
351
+++ third_party/rust/libc/ci/android-sysimage.sh
352
@@ -0,0 +1,52 @@
353
+# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
354
+# file at the top-level directory of this distribution and at
355
+# http://rust-lang.org/COPYRIGHT.
356
+#
357
+# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
358
+# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
359
+# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
360
+# option. This file may not be copied, modified, or distributed
361
+# except according to those terms.
362
+
363
+set -ex
364
+
365
+URL=https://dl.google.com/android/repository/sys-img/android
366
+
367
+main() {
368
+    local arch=$1
369
+    local name=$2
370
+    local dest=/system
371
+    local td=$(mktemp -d)
372
+
373
+    apt-get install --no-install-recommends e2tools
374
+
375
+    pushd $td
376
+    curl -O $URL/$name
377
+    unzip -q $name
378
+
379
+    local system=$(find . -name system.img)
380
+    mkdir -p $dest/{bin,lib,lib64}
381
+
382
+    # Extract android linker and libraries to /system
383
+    # This allows android executables to be run directly (or with qemu)
384
+    if [ $arch = "x86_64" -o $arch = "arm64" ]; then
385
+        e2cp -p $system:/bin/linker64 $dest/bin/
386
+        e2cp -p $system:/lib64/libdl.so $dest/lib64/
387
+        e2cp -p $system:/lib64/libc.so $dest/lib64/
388
+        e2cp -p $system:/lib64/libm.so $dest/lib64/
389
+    else
390
+        e2cp -p $system:/bin/linker $dest/bin/
391
+        e2cp -p $system:/lib/libdl.so $dest/lib/
392
+        e2cp -p $system:/lib/libc.so $dest/lib/
393
+        e2cp -p $system:/lib/libm.so $dest/lib/
394
+    fi
395
+
396
+    # clean up
397
+    apt-get purge --auto-remove -y e2tools
398
+
399
+    popd
400
+
401
+    rm -rf $td
402
+}
403
+
404
+main "${@}"
405
diff --git third_party/rust/libc/ci/docker/aarch64-linux-android/Dockerfile third_party/rust/libc/ci/docker/aarch64-linux-android/Dockerfile
406
new file mode 100644
407
index 000000000000..7ad84926bf82
408
--- /dev/null
409
+++ third_party/rust/libc/ci/docker/aarch64-linux-android/Dockerfile
410
@@ -0,0 +1,32 @@
411
+FROM ubuntu:16.04
412
+
413
+RUN dpkg --add-architecture i386 && \
414
+    apt-get update && \
415
+    apt-get install -y --no-install-recommends \
416
+  file \
417
+  curl \
418
+  ca-certificates \
419
+  python \
420
+  unzip \
421
+  expect \
422
+  openjdk-9-jre \
423
+  libstdc++6:i386 \
424
+  libpulse0 \
425
+  gcc \
426
+  libc6-dev
427
+
428
+WORKDIR /android/
429
+COPY android* /android/
430
+
431
+ENV ANDROID_ARCH=aarch64
432
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
433
+
434
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
435
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
436
+RUN mv /root/.android /tmp
437
+RUN chmod 777 -R /tmp/.android
438
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
439
+
440
+ENV PATH=$PATH:/rust/bin \
441
+    CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
442
+    HOME=/tmp
443
diff --git third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
444
index 1911fbd87970..054941416dfb 100644
445
--- third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
446
+++ third_party/rust/libc/ci/docker/arm-linux-androideabi/Dockerfile
447
@@ -11,24 +11,22 @@ RUN dpkg --add-architecture i386 && \
448
   expect \
449
   openjdk-9-jre \
450
   libstdc++6:i386 \
451
+  libpulse0 \
452
   gcc \
453
   libc6-dev
454
 
455
 WORKDIR /android/
456
+COPY android* /android/
457
 
458
-COPY install-ndk.sh /android/
459
-RUN sh /android/install-ndk.sh
460
+ENV ANDROID_ARCH=arm
461
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
462
 
463
-ENV PATH=$PATH:/android/ndk-arm/bin:/android/sdk/tools:/android/sdk/platform-tools
464
-
465
-COPY install-sdk.sh accept-licenses.sh /android/
466
-RUN sh /android/install-sdk.sh
467
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
468
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
469
+RUN mv /root/.android /tmp
470
+RUN chmod 777 -R /tmp/.android
471
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
472
 
473
 ENV PATH=$PATH:/rust/bin \
474
     CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
475
-    ANDROID_EMULATOR_FORCE_32BIT=1 \
476
     HOME=/tmp
477
-RUN chmod 755 /android/sdk/tools/*
478
-
479
-RUN cp -r /root/.android /tmp
480
-RUN chmod 777 -R /tmp/.android
481
diff --git third_party/rust/libc/ci/docker/arm-linux-androideabi/accept-licenses.sh third_party/rust/libc/ci/docker/arm-linux-androideabi/accept-licenses.sh
482
deleted file mode 100755
483
index 8d8f60a5ec26..000000000000
484
--- third_party/rust/libc/ci/docker/arm-linux-androideabi/accept-licenses.sh
485
+++ /dev/null
486
@@ -1,15 +0,0 @@
487
-#!/usr/bin/expect -f
488
-# ignore-license
489
-
490
-set timeout 1800
491
-set cmd [lindex $argv 0]
492
-set licenses [lindex $argv 1]
493
-
494
-spawn {*}$cmd
495
-expect {
496
-  "Do you accept the license '*'*" {
497
-        exp_send "y\r"
498
-        exp_continue
499
-  }
500
-  eof
501
-}
502
diff --git third_party/rust/libc/ci/docker/arm-linux-androideabi/install-ndk.sh third_party/rust/libc/ci/docker/arm-linux-androideabi/install-ndk.sh
503
deleted file mode 100644
504
index 566a3191848a..000000000000
505
--- third_party/rust/libc/ci/docker/arm-linux-androideabi/install-ndk.sh
506
+++ /dev/null
507
@@ -1,21 +0,0 @@
508
-#!/bin/sh
509
-# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
510
-# file at the top-level directory of this distribution and at
511
-# http://rust-lang.org/COPYRIGHT.
512
-#
513
-# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
514
-# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
515
-# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
516
-# option. This file may not be copied, modified, or distributed
517
-# except according to those terms.
518
-
519
-set -ex
520
-
521
-curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
522
-unzip -q android-ndk-r13b-linux-x86_64.zip
523
-android-ndk-r13b/build/tools/make_standalone_toolchain.py \
524
-        --install-dir /android/ndk-arm \
525
-        --arch arm \
526
-        --api 24
527
-
528
-rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
529
diff --git third_party/rust/libc/ci/docker/arm-linux-androideabi/install-sdk.sh third_party/rust/libc/ci/docker/arm-linux-androideabi/install-sdk.sh
530
deleted file mode 100644
531
index 3f20837fe061..000000000000
532
--- third_party/rust/libc/ci/docker/arm-linux-androideabi/install-sdk.sh
533
+++ /dev/null
534
@@ -1,33 +0,0 @@
535
-#!/bin/sh
536
-# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
537
-# file at the top-level directory of this distribution and at
538
-# http://rust-lang.org/COPYRIGHT.
539
-#
540
-# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
541
-# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
542
-# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
543
-# option. This file may not be copied, modified, or distributed
544
-# except according to those terms.
545
-
546
-set -ex
547
-
548
-# Prep the SDK and emulator
549
-#
550
-# Note that the update process requires that we accept a bunch of licenses, and
551
-# we can't just pipe `yes` into it for some reason, so we take the same strategy
552
-# located in https://github.com/appunite/docker by just wrapping it in a script
553
-# which apparently magically accepts the licenses.
554
-
555
-mkdir sdk
556
-curl https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | \
557
-    tar xzf - -C sdk --strip-components=1
558
-
559
-filter="platform-tools,android-21"
560
-filter="$filter,sys-img-armeabi-v7a-android-21"
561
-
562
-./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
563
-
564
-echo "no" | android create avd \
565
-                --name arm-21 \
566
-                --target android-21 \
567
-                --abi armeabi-v7a
568
diff --git third_party/rust/libc/ci/docker/i686-linux-android/Dockerfile third_party/rust/libc/ci/docker/i686-linux-android/Dockerfile
569
new file mode 100644
570
index 000000000000..bee904379645
571
--- /dev/null
572
+++ third_party/rust/libc/ci/docker/i686-linux-android/Dockerfile
573
@@ -0,0 +1,32 @@
574
+FROM ubuntu:16.04
575
+
576
+RUN dpkg --add-architecture i386 && \
577
+    apt-get update && \
578
+    apt-get install -y --no-install-recommends \
579
+  file \
580
+  curl \
581
+  ca-certificates \
582
+  python \
583
+  unzip \
584
+  expect \
585
+  openjdk-9-jre \
586
+  libstdc++6:i386 \
587
+  libpulse0 \
588
+  gcc \
589
+  libc6-dev
590
+
591
+WORKDIR /android/
592
+COPY android* /android/
593
+
594
+ENV ANDROID_ARCH=i686
595
+ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
596
+
597
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
598
+RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
599
+RUN mv /root/.android /tmp
600
+RUN chmod 777 -R /tmp/.android
601
+RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
602
+
603
+ENV PATH=$PATH:/rust/bin \
604
+    CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
605
+    HOME=/tmp
606
diff --git third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
607
index 87459a1672bd..bdc2272a35dc 100644
608
--- third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
609
+++ third_party/rust/libc/ci/docker/i686-unknown-linux-musl/Dockerfile
610
@@ -1,8 +1,9 @@
611
 FROM ubuntu:16.10
612
 
613
+RUN dpkg --add-architecture i386
614
 RUN apt-get update
615
 RUN apt-get install -y --no-install-recommends \
616
-  gcc make libc6-dev git curl ca-certificates
617
+  gcc-multilib make libc6-dev git curl ca-certificates libc6:i386
618
 # Below we're cross-compiling musl for i686 using the system compiler on an
619
 # x86_64 system. This is an awkward thing to be doing and so we have to jump
620
 # through a couple hoops to get musl to be happy. In particular:
621
diff --git third_party/rust/libc/ci/docker/x86_64-linux-android/Dockerfile third_party/rust/libc/ci/docker/x86_64-linux-android/Dockerfile
622
new file mode 100644
623
index 000000000000..dfc0c83dae92
624
--- /dev/null
625
+++ third_party/rust/libc/ci/docker/x86_64-linux-android/Dockerfile
626
@@ -0,0 +1,26 @@
627
+FROM ubuntu:16.04
628
+
629
+RUN apt-get update && \
630
+    apt-get install -y --no-install-recommends \
631
+  ca-certificates \
632
+  curl \
633
+  gcc \
634
+  libc-dev \
635
+  python \
636
+  unzip
637
+
638
+WORKDIR /android/
639
+ENV ANDROID_ARCH=x86_64
640
+COPY android-install-ndk.sh /android/
641
+RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
642
+
643
+# We do not run x86_64-linux-android tests on an android emulator.
644
+# See ci/android-sysimage.sh for informations about how tests are run.
645
+COPY android-sysimage.sh /android/
646
+RUN bash /android/android-sysimage.sh x86_64 x86_64-21_r04.zip
647
+
648
+ENV PATH=$PATH:/rust/bin:/android/ndk-$ANDROID_ARCH/bin \
649
+    CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc \
650
+    CC_x86_64_linux_android=x86_64-linux-android-gcc \
651
+    CXX_x86_64_linux_android=x86_64-linux-android-g++ \
652
+    HOME=/tmp
653
diff --git third_party/rust/libc/ci/ios/deploy_and_run_on_ios_simulator.rs third_party/rust/libc/ci/ios/deploy_and_run_on_ios_simulator.rs
654
new file mode 100644
655
index 000000000000..b14615036d02
656
--- /dev/null
657
+++ third_party/rust/libc/ci/ios/deploy_and_run_on_ios_simulator.rs
658
@@ -0,0 +1,171 @@
659
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
660
+// file at the top-level directory of this distribution and at
661
+// http://rust-lang.org/COPYRIGHT.
662
+//
663
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
664
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
665
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
666
+// option. This file may not be copied, modified, or distributed
667
+// except according to those terms.
668
+
669
+// This is a script to deploy and execute a binary on an iOS simulator.
670
+// The primary use of this is to be able to run unit tests on the simulator and
671
+// retrieve the results.
672
+//
673
+// To do this through Cargo instead, use Dinghy
674
+// (https://github.com/snipsco/dinghy): cargo dinghy install, then cargo dinghy
675
+// test.
676
+
677
+use std::env;
678
+use std::fs::{self, File};
679
+use std::io::Write;
680
+use std::path::Path;
681
+use std::process;
682
+use std::process::Command;
683
+
684
+macro_rules! t {
685
+    ($e:expr) => (match $e {
686
+        Ok(e) => e,
687
+        Err(e) => panic!("{} failed with: {}", stringify!($e), e),
688
+    })
689
+}
690
+
691
+// Step one: Wrap as an app
692
+fn package_as_simulator_app(crate_name: &str, test_binary_path: &Path) {
693
+    println!("Packaging simulator app");
694
+    drop(fs::remove_dir_all("ios_simulator_app"));
695
+    t!(fs::create_dir("ios_simulator_app"));
696
+    t!(fs::copy(test_binary_path,
697
+                Path::new("ios_simulator_app").join(crate_name)));
698
+
699
+    let mut f = t!(File::create("ios_simulator_app/Info.plist"));
700
+    t!(f.write_all(format!(r#"
701
+        <?xml version="1.0" encoding="UTF-8"?>
702
+        <!DOCTYPE plist PUBLIC
703
+                "-//Apple//DTD PLIST 1.0//EN"
704
+                "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
705
+        <plist version="1.0">
706
+            <dict>
707
+                <key>CFBundleExecutable</key>
708
+                <string>{}</string>
709
+                <key>CFBundleIdentifier</key>
710
+                <string>com.rust.unittests</string>
711
+            </dict>
712
+        </plist>
713
+    "#, crate_name).as_bytes()));
714
+}
715
+
716
+// Step two: Start the iOS simulator
717
+fn start_simulator() {
718
+    println!("Looking for iOS simulator");
719
+    let output = t!(Command::new("xcrun").arg("simctl").arg("list").output());
720
+    assert!(output.status.success());
721
+    let mut simulator_exists = false;
722
+    let mut simulator_booted = false;
723
+    let mut found_rust_sim = false;
724
+    let stdout = t!(String::from_utf8(output.stdout));
725
+    for line in stdout.lines() {
726
+        if line.contains("rust_ios") {
727
+            if found_rust_sim {
728
+                panic!("Duplicate rust_ios simulators found. Please \
729
+                        double-check xcrun simctl list.");
730
+            }
731
+            simulator_exists = true;
732
+            simulator_booted = line.contains("(Booted)");
733
+            found_rust_sim = true;
734
+        }
735
+    }
736
+
737
+    if simulator_exists == false {
738
+        println!("Creating iOS simulator");
739
+        Command::new("xcrun")
740
+                .arg("simctl")
741
+                .arg("create")
742
+                .arg("rust_ios")
743
+                .arg("com.apple.CoreSimulator.SimDeviceType.iPhone-SE")
744
+                .arg("com.apple.CoreSimulator.SimRuntime.iOS-10-2")
745
+                .check_status();
746
+    } else if simulator_booted == true {
747
+        println!("Shutting down already-booted simulator");
748
+        Command::new("xcrun")
749
+                .arg("simctl")
750
+                .arg("shutdown")
751
+                .arg("rust_ios")
752
+                .check_status();
753
+    }
754
+
755
+    println!("Starting iOS simulator");
756
+    // We can't uninstall the app (if present) as that will hang if the
757
+    // simulator isn't completely booted; just erase the simulator instead.
758
+    Command::new("xcrun").arg("simctl").arg("erase").arg("rust_ios").check_status();
759
+    Command::new("xcrun").arg("simctl").arg("boot").arg("rust_ios").check_status();
760
+}
761
+
762
+// Step three: Install the app
763
+fn install_app_to_simulator() {
764
+    println!("Installing app to simulator");
765
+    Command::new("xcrun")
766
+            .arg("simctl")
767
+            .arg("install")
768
+            .arg("booted")
769
+            .arg("ios_simulator_app/")
770
+            .check_status();
771
+}
772
+
773
+// Step four: Run the app
774
+fn run_app_on_simulator() {
775
+    println!("Running app");
776
+    let output = t!(Command::new("xcrun")
777
+                    .arg("simctl")
778
+                    .arg("launch")
779
+                    .arg("--console")
780
+                    .arg("booted")
781
+                    .arg("com.rust.unittests")
782
+                    .output());
783
+
784
+    println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout));
785
+    println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr));
786
+
787
+    let stdout = String::from_utf8_lossy(&output.stdout);
788
+    let passed = stdout.lines()
789
+                       .find(|l| l.contains("PASSED"))
790
+                       .map(|l| l.contains("tests"))
791
+                       .unwrap_or(false);
792
+
793
+    println!("Shutting down simulator");
794
+    Command::new("xcrun")
795
+        .arg("simctl")
796
+        .arg("shutdown")
797
+        .arg("rust_ios")
798
+        .check_status();
799
+    if !passed {
800
+        panic!("tests didn't pass");
801
+    }
802
+}
803
+
804
+trait CheckStatus {
805
+    fn check_status(&mut self);
806
+}
807
+
808
+impl CheckStatus for Command {
809
+    fn check_status(&mut self) {
810
+        println!("\trunning: {:?}", self);
811
+        assert!(t!(self.status()).success());
812
+    }
813
+}
814
+
815
+fn main() {
816
+    let args: Vec<String> = env::args().collect();
817
+    if args.len() != 2 {
818
+        println!("Usage: {} <executable>", args[0]);
819
+        process::exit(-1);
820
+    }
821
+
822
+    let test_binary_path = Path::new(&args[1]);
823
+    let crate_name = test_binary_path.file_name().unwrap();
824
+
825
+    package_as_simulator_app(crate_name.to_str().unwrap(), test_binary_path);
826
+    start_simulator();
827
+    install_app_to_simulator();
828
+    run_app_on_simulator();
829
+}
830
diff --git third_party/rust/libc/ci/run-docker.sh third_party/rust/libc/ci/run-docker.sh
831
index a7702ae1dc51..e963078af8c1 100644
832
--- third_party/rust/libc/ci/run-docker.sh
833
+++ third_party/rust/libc/ci/run-docker.sh
834
@@ -5,12 +5,17 @@ set -ex
835
 
836
 run() {
837
     echo $1
838
-    docker build -t libc ci/docker/$1
839
+    # use -f so we can use ci/ as build context
840
+    docker build -t libc -f ci/docker/$1/Dockerfile ci/
841
     mkdir -p target
842
+    if [ -w /dev/kvm ]; then
843
+      kvm="--volume /dev/kvm:/dev/kvm"
844
+    fi
845
     docker run \
846
       --user `id -u`:`id -g` \
847
       --rm \
848
       --volume $HOME/.cargo:/cargo \
849
+      $kvm \
850
       --env CARGO_HOME=/cargo \
851
       --volume `rustc --print sysroot`:/rust:ro \
852
       --volume `pwd`:/checkout:ro \
853
@@ -18,8 +23,6 @@ run() {
854
       --env CARGO_TARGET_DIR=/checkout/target \
855
       --workdir /checkout \
856
       --privileged \
857
-      --interactive \
858
-      --tty \
859
       libc \
860
       ci/run.sh $1
861
 }
862
diff --git third_party/rust/libc/ci/run.sh third_party/rust/libc/ci/run.sh
863
index 179fe7a88532..3ddc7b395476 100755
864
--- third_party/rust/libc/ci/run.sh
865
+++ third_party/rust/libc/ci/run.sh
866
@@ -105,14 +105,36 @@ case "$TARGET" in
867
 esac
868
 
869
 case "$TARGET" in
870
-  arm-linux-androideabi)
871
-    emulator @arm-21 -no-window &
872
+  # Android emulator for x86_64 does not work on travis (missing hardware
873
+  # acceleration). Tests are run on case *). See ci/android-sysimage.sh for
874
+  # informations about how tests are run.
875
+  arm-linux-androideabi | aarch64-linux-android | i686-linux-android)
876
+    # set SHELL so android can detect a 64bits system, see
877
+    # http://stackoverflow.com/a/41789144
878
+    # https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
879
+    export SHELL=/bin/dash
880
+    arch=$(echo $TARGET | cut -d- -f1)
881
+    accel="-no-accel"
882
+    if emulator -accel-check; then
883
+      accel=""
884
+    fi
885
+    emulator @$arch -no-window $accel &
886
     adb wait-for-device
887
-    adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/libc-test
888
-    adb shell /data/libc-test 2>&1 | tee /tmp/out
889
+    adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/local/tmp/libc-test
890
+    adb shell /data/local/tmp/libc-test 2>&1 | tee /tmp/out
891
     grep "^PASSED .* tests" /tmp/out
892
     ;;
893
 
894
+  i386-apple-ios)
895
+    rustc -O ./ci/ios/deploy_and_run_on_ios_simulator.rs
896
+    ./deploy_and_run_on_ios_simulator $CARGO_TARGET_DIR/$TARGET/debug/libc-test
897
+    ;;
898
+
899
+  x86_64-apple-ios)
900
+    rustc -O ./ci/ios/deploy_and_run_on_ios_simulator.rs
901
+    ./deploy_and_run_on_ios_simulator $CARGO_TARGET_DIR/$TARGET/debug/libc-test
902
+    ;;
903
+
904
   arm-unknown-linux-gnueabihf)
905
     qemu-arm -L /usr/arm-linux-gnueabihf $CARGO_TARGET_DIR/$TARGET/debug/libc-test
906
     ;;
907
diff --git third_party/rust/libc/src/dox.rs third_party/rust/libc/src/dox.rs
908
index fbec3f2d4e69..41aac385f47b 100644
909
--- third_party/rust/libc/src/dox.rs
910
+++ third_party/rust/libc/src/dox.rs
911
@@ -26,6 +26,9 @@ mod imp {
912
     #[lang = "copy"]
913
     pub trait Copy {}
914
 
915
+    #[lang = "freeze"]
916
+    pub trait Freeze {}
917
+
918
     #[lang = "sync"]
919
     pub trait Sync {}
920
     impl<T> Sync for T {}
921
diff --git third_party/rust/libc/src/lib.rs third_party/rust/libc/src/lib.rs
922
index 5b80aca66c9d..c17a504787db 100644
923
--- third_party/rust/libc/src/lib.rs
924
+++ third_party/rust/libc/src/lib.rs
925
@@ -243,6 +243,7 @@ extern {
926
     pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
927
     pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
928
     pub fn wcslen(buf: *const wchar_t) -> size_t;
929
+    pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
930
 
931
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
932
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
933
diff --git third_party/rust/libc/src/unix/bsd/apple/b64.rs third_party/rust/libc/src/unix/bsd/apple/b64.rs
934
index 327a4b63116b..3f83230805fe 100644
935
--- third_party/rust/libc/src/unix/bsd/apple/b64.rs
936
+++ third_party/rust/libc/src/unix/bsd/apple/b64.rs
937
@@ -17,3 +17,5 @@ pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
938
 
939
 pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
940
 pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
941
+
942
+pub const FIONREAD: ::c_ulong = 0x4004667f;
943
diff --git third_party/rust/libc/src/unix/bsd/apple/mod.rs third_party/rust/libc/src/unix/bsd/apple/mod.rs
944
index afd2610e1a0a..148188b10705 100644
945
--- third_party/rust/libc/src/unix/bsd/apple/mod.rs
946
+++ third_party/rust/libc/src/unix/bsd/apple/mod.rs
947
@@ -665,6 +665,12 @@ pub const F_ALLOCATEALL: ::c_uint = 0x04;
948
 pub const F_PEOFPOSMODE: ::c_int = 3;
949
 pub const F_VOLPOSMODE: ::c_int = 4;
950
 
951
+pub const AT_FDCWD: ::c_int = -2;
952
+pub const AT_EACCESS: ::c_int = 0x0010;
953
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
954
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
955
+pub const AT_REMOVEDIR: ::c_int = 0x0080;
956
+
957
 pub const O_ACCMODE: ::c_int = 3;
958
 
959
 pub const TIOCMODG: ::c_ulong = 0x40047403;
960
@@ -731,6 +737,32 @@ pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
961
 pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
962
 pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
963
 
964
+pub const B0: speed_t = 0;
965
+pub const B50: speed_t = 50;
966
+pub const B75: speed_t = 75;
967
+pub const B110: speed_t = 110;
968
+pub const B134: speed_t = 134;
969
+pub const B150: speed_t = 150;
970
+pub const B200: speed_t = 200;
971
+pub const B300: speed_t = 300;
972
+pub const B600: speed_t = 600;
973
+pub const B1200: speed_t = 1200;
974
+pub const B1800: speed_t = 1800;
975
+pub const B2400: speed_t = 2400;
976
+pub const B4800: speed_t = 4800;
977
+pub const B9600: speed_t = 9600;
978
+pub const B19200: speed_t = 19200;
979
+pub const B38400: speed_t = 38400;
980
+pub const B7200: speed_t = 7200;
981
+pub const B14400: speed_t = 14400;
982
+pub const B28800: speed_t = 28800;
983
+pub const B57600: speed_t = 57600;
984
+pub const B76800: speed_t = 76800;
985
+pub const B115200: speed_t = 115200;
986
+pub const B230400: speed_t = 230400;
987
+pub const EXTA: speed_t = 19200;
988
+pub const EXTB: speed_t = 38400;
989
+
990
 pub const SIGTRAP: ::c_int = 5;
991
 
992
 pub const GLOB_APPEND  : ::c_int = 0x0001;
993
@@ -819,13 +851,104 @@ pub const MINCORE_MODIFIED: ::c_int = 0x4;
994
 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
995
 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
996
 
997
-pub const AF_UNIX: ::c_int = 1;
998
+pub const AF_UNSPEC: ::c_int = 0;
999
+pub const AF_LOCAL: ::c_int = 1;
1000
+pub const AF_UNIX: ::c_int = AF_LOCAL;
1001
 pub const AF_INET: ::c_int = 2;
1002
+pub const AF_IMPLINK: ::c_int = 3;
1003
+pub const AF_PUP: ::c_int = 4;
1004
+pub const AF_CHAOS: ::c_int = 5;
1005
+pub const AF_NS: ::c_int = 6;
1006
+pub const AF_ISO: ::c_int = 7;
1007
+pub const AF_OSI: ::c_int = AF_ISO;
1008
+pub const AF_ECMA: ::c_int = 8;
1009
+pub const AF_DATAKIT: ::c_int = 9;
1010
+pub const AF_CCITT: ::c_int = 10;
1011
+pub const AF_SNA: ::c_int = 11;
1012
+pub const AF_DECnet: ::c_int = 12;
1013
+pub const AF_DLI: ::c_int = 13;
1014
+pub const AF_LAT: ::c_int = 14;
1015
+pub const AF_HYLINK: ::c_int = 15;
1016
+pub const AF_APPLETALK: ::c_int = 16;
1017
+pub const AF_ROUTE: ::c_int = 17;
1018
+pub const AF_LINK: ::c_int = 18;
1019
+pub const pseudo_AF_XTP: ::c_int = 19;
1020
+pub const AF_COIP: ::c_int = 20;
1021
+pub const AF_CNT: ::c_int = 21;
1022
+pub const pseudo_AF_RTIP: ::c_int = 22;
1023
+pub const AF_IPX: ::c_int = 23;
1024
+pub const AF_SIP: ::c_int = 24;
1025
+pub const pseudo_AF_PIP: ::c_int = 25;
1026
+pub const AF_ISDN: ::c_int = 28;
1027
+pub const AF_E164: ::c_int = AF_ISDN;
1028
+pub const pseudo_AF_KEY: ::c_int = 29;
1029
 pub const AF_INET6: ::c_int = 30;
1030
+pub const AF_NATM: ::c_int = 31;
1031
+pub const AF_SYSTEM: ::c_int = 32;
1032
+pub const AF_NETBIOS: ::c_int = 33;
1033
+pub const AF_PPP: ::c_int = 34;
1034
+pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
1035
+#[doc(hidden)]
1036
+pub const AF_MAX: ::c_int = 40;
1037
+
1038
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1039
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
1040
+pub const PF_UNIX: ::c_int =  PF_LOCAL;
1041
+pub const PF_INET: ::c_int =  AF_INET;
1042
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
1043
+pub const PF_PUP: ::c_int =  AF_PUP;
1044
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
1045
+pub const PF_NS: ::c_int =  AF_NS;
1046
+pub const PF_ISO: ::c_int =  AF_ISO;
1047
+pub const PF_OSI: ::c_int =  AF_ISO;
1048
+pub const PF_ECMA: ::c_int =  AF_ECMA;
1049
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
1050
+pub const PF_CCITT: ::c_int = AF_CCITT;
1051
+pub const PF_SNA: ::c_int =  AF_SNA;
1052
+pub const PF_DECnet: ::c_int = AF_DECnet;
1053
+pub const PF_DLI: ::c_int =  AF_DLI;
1054
+pub const PF_LAT: ::c_int =  AF_LAT;
1055
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
1056
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1057
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
1058
+pub const PF_LINK: ::c_int =  AF_LINK;
1059
+pub const PF_XTP: ::c_int =  pseudo_AF_XTP;
1060
+pub const PF_COIP: ::c_int =  AF_COIP;
1061
+pub const PF_CNT: ::c_int =  AF_CNT;
1062
+pub const PF_SIP: ::c_int =  AF_SIP;
1063
+pub const PF_IPX: ::c_int =  AF_IPX;
1064
+pub const PF_RTIP: ::c_int =  pseudo_AF_RTIP;
1065
+pub const PF_PIP: ::c_int =  pseudo_AF_PIP;
1066
+pub const PF_ISDN: ::c_int =  AF_ISDN;
1067
+pub const PF_KEY: ::c_int =  pseudo_AF_KEY;
1068
+pub const PF_INET6: ::c_int = AF_INET6;
1069
+pub const PF_NATM: ::c_int =  AF_NATM;
1070
+pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
1071
+pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
1072
+pub const PF_PPP: ::c_int =  AF_PPP;
1073
+#[doc(hidden)]
1074
+pub const PF_MAX: ::c_int =  AF_MAX;
1075
+
1076
+#[doc(hidden)]
1077
+pub const NET_MAXID: ::c_int = AF_MAX;
1078
+
1079
+pub const NET_RT_DUMP: ::c_int = 1;
1080
+pub const NET_RT_FLAGS: ::c_int = 2;
1081
+pub const NET_RT_IFLIST: ::c_int = 3;
1082
+#[doc(hidden)]
1083
+pub const NET_RT_MAXID: ::c_int = 10;
1084
+
1085
+pub const SOMAXCONN: ::c_int = 128;
1086
+
1087
+pub const SOCK_MAXADDRLEN: ::c_int = 255;
1088
+
1089
 pub const SOCK_STREAM: ::c_int = 1;
1090
 pub const SOCK_DGRAM: ::c_int = 2;
1091
 pub const SOCK_RAW: ::c_int = 3;
1092
+pub const SOCK_RDM: ::c_int = 4;
1093
 pub const SOCK_SEQPACKET: ::c_int = 5;
1094
+pub const IPPROTO_ICMP: ::c_int = 1;
1095
+pub const IPPROTO_ICMPV6: ::c_int = 58;
1096
 pub const IPPROTO_TCP: ::c_int = 6;
1097
 pub const IPPROTO_IP: ::c_int = 0;
1098
 pub const IPPROTO_IPV6: ::c_int = 41;
1099
@@ -852,6 +975,10 @@ pub const SO_USELOOPBACK: ::c_int = 0x0040;
1100
 pub const SO_LINGER: ::c_int = 0x0080;
1101
 pub const SO_OOBINLINE: ::c_int = 0x0100;
1102
 pub const SO_REUSEPORT: ::c_int = 0x0200;
1103
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
1104
+pub const SO_DONTTRUNC: ::c_int = 0x2000;
1105
+pub const SO_WANTMORE: ::c_int = 0x4000;
1106
+pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
1107
 pub const SO_SNDBUF: ::c_int = 0x1001;
1108
 pub const SO_RCVBUF: ::c_int = 0x1002;
1109
 pub const SO_SNDLOWAT: ::c_int = 0x1003;
1110
@@ -860,8 +987,31 @@ pub const SO_SNDTIMEO: ::c_int = 0x1005;
1111
 pub const SO_RCVTIMEO: ::c_int = 0x1006;
1112
 pub const SO_ERROR: ::c_int = 0x1007;
1113
 pub const SO_TYPE: ::c_int = 0x1008;
1114
+pub const SO_NREAD: ::c_int = 0x1020;
1115
+pub const SO_NKE: ::c_int = 0x1021;
1116
+pub const SO_NOSIGPIPE: ::c_int = 0x1022;
1117
+pub const SO_NOADDRERR: ::c_int = 0x1023;
1118
+pub const SO_NWRITE: ::c_int = 0x1024;
1119
 
1120
+pub const MSG_OOB: ::c_int =  0x1;
1121
 pub const MSG_PEEK: ::c_int = 0x2;
1122
+pub const MSG_DONTROUTE: ::c_int = 0x4;
1123
+pub const MSG_EOR: ::c_int =  0x8;
1124
+pub const MSG_TRUNC: ::c_int = 0x10;
1125
+pub const MSG_CTRUNC: ::c_int = 0x20;
1126
+pub const MSG_WAITALL: ::c_int = 0x40;
1127
+pub const MSG_DONTWAIT: ::c_int = 0x80;
1128
+pub const MSG_EOF: ::c_int =  0x100;
1129
+pub const MSG_FLUSH: ::c_int = 0x400;
1130
+pub const MSG_HOLD: ::c_int = 0x800;
1131
+pub const MSG_SEND: ::c_int = 0x1000;
1132
+pub const MSG_HAVEMORE: ::c_int = 0x2000;
1133
+pub const MSG_RCVMORE: ::c_int = 0x4000;
1134
+// pub const MSG_COMPAT: ::c_int = 0x8000;
1135
+
1136
+pub const SCM_RIGHTS: ::c_int = 0x01;
1137
+pub const SCM_TIMESTAMP: ::c_int = 0x02;
1138
+pub const SCM_CREDS: ::c_int = 0x03;
1139
 
1140
 pub const IFF_LOOPBACK: ::c_int = 0x8;
1141
 
1142
@@ -888,15 +1038,6 @@ pub const MAP_JIT: ::c_int = 0x0800;
1143
 
1144
 pub const IPPROTO_RAW: ::c_int = 255;
1145
 
1146
-pub const SO_NREAD: ::c_int = 0x1020;
1147
-pub const SO_NKE: ::c_int = 0x1021;
1148
-pub const SO_NOSIGPIPE: ::c_int = 0x1022;
1149
-pub const SO_NOADDRERR: ::c_int = 0x1023;
1150
-pub const SO_NWRITE: ::c_int = 0x1024;
1151
-pub const SO_DONTTRUNC: ::c_int = 0x2000;
1152
-pub const SO_WANTMORE: ::c_int = 0x4000;
1153
-pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
1154
-
1155
 pub const _SC_ARG_MAX: ::c_int = 1;
1156
 pub const _SC_CHILD_MAX: ::c_int = 2;
1157
 pub const _SC_CLK_TCK: ::c_int = 3;
1158
@@ -1375,6 +1516,13 @@ pub const P_ALL: idtype_t = 0;
1159
 pub const P_PID: idtype_t = 1;
1160
 pub const P_PGID: idtype_t = 2;
1161
 
1162
+pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
1163
+pub const XATTR_CREATE: ::c_int = 0x0002;
1164
+pub const XATTR_REPLACE: ::c_int = 0x0004;
1165
+pub const XATTR_NOSECURITY: ::c_int = 0x0008;
1166
+pub const XATTR_NODEFAULT: ::c_int = 0x0010;
1167
+pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
1168
+
1169
 f! {
1170
     pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1171
         status >> 8
1172
@@ -1411,6 +1559,8 @@ extern {
1173
     pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
1174
                       nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
1175
 
1176
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1177
+
1178
     pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
1179
 
1180
     pub fn getutxent() -> *mut utmpx;
1181
@@ -1457,6 +1607,14 @@ extern {
1182
     pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
1183
     pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
1184
     pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
1185
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
1186
+                                       pshared: ::c_int) -> ::c_int;
1187
+    pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
1188
+                                       pshared: *mut ::c_int) -> ::c_int;
1189
+    pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
1190
+                                        pshared: ::c_int) -> ::c_int;
1191
+    pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1192
+                                        pshared: *mut ::c_int) -> ::c_int;
1193
     pub fn __error() -> *mut ::c_int;
1194
     pub fn backtrace(buf: *mut *mut ::c_void,
1195
                      sz: ::c_int) -> ::c_int;
1196
@@ -1516,32 +1674,26 @@ extern {
1197
     pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
1198
     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
1199
 
1200
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
1201
-                  flags: ::c_int, ...) -> ::c_int;
1202
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
1203
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
1204
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
1205
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
1206
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
1207
-                    owner: ::uid_t, group: ::gid_t,
1208
+    pub fn getxattr(path: *const ::c_char, name: *const ::c_char,
1209
+                    value: *mut ::c_void, size: ::size_t, position: u32,
1210
+                    flags: ::c_int) -> ::ssize_t;
1211
+    pub fn fgetxattr(filedes: ::c_int, name: *const ::c_char,
1212
+                     value: *mut ::c_void, size: ::size_t, position: u32,
1213
+                     flags: ::c_int) -> ::ssize_t;
1214
+    pub fn setxattr(path: *const ::c_char, name: *const ::c_char,
1215
+                    value: *const ::c_void, size: ::size_t, position: u32,
1216
                     flags: ::c_int) -> ::c_int;
1217
-    #[cfg_attr(target_os = "macos", link_name = "fstatat$INODE64")]
1218
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
1219
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
1220
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
1221
-                  newdirfd: ::c_int, newpath: *const ::c_char,
1222
-                  flags: ::c_int) -> ::c_int;
1223
-   pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
1224
-                  mode: ::mode_t) -> ::c_int;
1225
-   pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1226
-                     buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
1227
-   pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
1228
-                   newdirfd: ::c_int, newpath: *const ::c_char)
1229
-                   -> ::c_int;
1230
-   pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
1231
-                    linkpath: *const ::c_char) -> ::c_int;
1232
-   pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1233
-                   flags: ::c_int) -> ::c_int;
1234
+    pub fn fsetxattr(filedes: ::c_int, name: *const ::c_char,
1235
+                     value: *const ::c_void, size: ::size_t, position: u32,
1236
+                     flags: ::c_int) -> ::c_int;
1237
+    pub fn listxattr(path: *const ::c_char, list: *mut ::c_char,
1238
+                     size: ::size_t, flags: ::c_int) -> ::ssize_t;
1239
+    pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char,
1240
+                      size: ::size_t, flags: ::c_int) -> ::ssize_t;
1241
+    pub fn removexattr(path: *const ::c_char, name: *const ::c_char,
1242
+                       flags: ::c_int) -> ::c_int;
1243
+    pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char,
1244
+                        flags: ::c_int) -> ::c_int;
1245
 
1246
     pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
1247
 
1248
@@ -1549,7 +1701,9 @@ extern {
1249
                link_name = "waitid$UNIX2003")]
1250
     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
1251
                   options: ::c_int) -> ::c_int;
1252
-
1253
+    pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
1254
+    pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
1255
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
1256
 }
1257
 
1258
 cfg_if! {
1259
diff --git third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
1260
index 926cd20af831..e60825a5226a 100644
1261
--- third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
1262
+++ third_party/rust/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
1263
@@ -344,8 +344,34 @@ pub const NOTE_TRACK: ::uint32_t = 0x00000001;
1264
 pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
1265
 pub const NOTE_CHILD: ::uint32_t = 0x00000004;
1266
 
1267
-pub const MSG_PEEK: ::c_int = 0x2;
1268
-pub const MSG_NOSIGNAL: ::c_int = 0x400;
1269
+pub const SO_SNDSPACE: ::c_int = 0x100a;
1270
+pub const SO_CPUHINT: ::c_int = 0x1030;
1271
+
1272
+pub const AF_BLUETOOTH: ::c_int = 33;
1273
+pub const AF_MPLS: ::c_int = 34;
1274
+pub const AF_IEEE80211: ::c_int = 35;
1275
+pub const AF_MAX: ::c_int = 36;
1276
+
1277
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1278
+pub const PF_MAX: ::c_int = AF_MAX;
1279
+
1280
+pub const NET_RT_DUMP: ::c_int = 1;
1281
+pub const NET_RT_FLAGS: ::c_int = 2;
1282
+pub const NET_RT_IFLIST: ::c_int = 3;
1283
+pub const NET_RT_MAXID: ::c_int = 4;
1284
+
1285
+pub const SOMAXOPT_SIZE: ::c_int = 65536;
1286
+
1287
+#[doc(hidden)]
1288
+pub const NET_MAXID: ::c_int = AF_MAX;
1289
+
1290
+pub const MSG_UNUSED09: ::c_int = 0x00000200;
1291
+pub const MSG_NOSIGNAL: ::c_int = 0x00000400;
1292
+pub const MSG_SYNC: ::c_int = 0x00000800;
1293
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000;
1294
+pub const MSG_FBLOCKING: ::c_int = 0x00010000;
1295
+pub const MSG_FNONBLOCKING: ::c_int = 0x00020000;
1296
+pub const MSG_FMASK: ::c_int = 0xFFFF0000;
1297
 
1298
 pub const EMPTY: ::c_short = 0;
1299
 pub const RUN_LVL: ::c_short = 1;
1300
diff --git third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
1301
new file mode 100644
1302
index 000000000000..a2da8452c4d3
1303
--- /dev/null
1304
+++ third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
1305
@@ -0,0 +1,30 @@
1306
+pub type c_long = i64;
1307
+pub type c_ulong = u64;
1308
+pub type time_t = i64;
1309
+pub type suseconds_t = i64;
1310
+
1311
+s! {
1312
+    pub struct stat {
1313
+        pub st_dev: ::dev_t,
1314
+        pub st_ino: ::ino_t,
1315
+        pub st_mode: ::mode_t,
1316
+        pub st_nlink: ::nlink_t,
1317
+        pub st_uid: ::uid_t,
1318
+        pub st_gid: ::gid_t,
1319
+        pub st_rdev: ::dev_t,
1320
+        pub st_atime: ::time_t,
1321
+        pub st_atime_nsec: ::c_long,
1322
+        pub st_mtime: ::time_t,
1323
+        pub st_mtime_nsec: ::c_long,
1324
+        pub st_ctime: ::time_t,
1325
+        pub st_ctime_nsec: ::c_long,
1326
+        pub st_size: ::off_t,
1327
+        pub st_blocks: ::blkcnt_t,
1328
+        pub st_blksize: ::blksize_t,
1329
+        pub st_flags: ::fflags_t,
1330
+        pub st_gen: ::uint32_t,
1331
+        pub st_lspare: ::int32_t,
1332
+        pub st_birthtime: ::time_t,
1333
+        pub st_birthtime_nsec: ::c_long,
1334
+    }
1335
+}
1336
diff --git third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
1337
index 3c454859d6a2..fb113ded33aa 100644
1338
--- third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
1339
+++ third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
1340
@@ -11,6 +11,10 @@ pub type fsblkcnt_t = ::uint64_t;
1341
 pub type fsfilcnt_t = ::uint64_t;
1342
 pub type idtype_t = ::c_uint;
1343
 
1344
+pub type key_t = ::c_long;
1345
+pub type msglen_t = ::c_ulong;
1346
+pub type msgqnum_t = ::c_ulong;
1347
+
1348
 s! {
1349
     pub struct utmpx {
1350
         pub ut_type: ::c_short,
1351
@@ -47,6 +51,17 @@ s! {
1352
         pub d_name: [::c_char; 256],
1353
     }
1354
 
1355
+    pub struct jail {
1356
+        pub version: u32,
1357
+        pub path: *mut ::c_char,
1358
+        pub hostname: *mut ::c_char,
1359
+        pub jailname: *mut ::c_char,
1360
+        pub ip4s: ::c_uint,
1361
+        pub ip6s: ::c_uint,
1362
+        pub ip4: *mut ::in_addr,
1363
+        pub ip6: *mut ::in6_addr,
1364
+    }
1365
+
1366
     pub struct sigevent {
1367
         pub sigev_notify: ::c_int,
1368
         pub sigev_signo: ::c_int,
1369
@@ -77,6 +92,41 @@ s! {
1370
     pub struct _sem {
1371
         data: [u32; 4],
1372
     }
1373
+
1374
+    pub struct ipc_perm {
1375
+        pub cuid: ::uid_t,
1376
+        pub cgid: ::gid_t,
1377
+        pub uid: ::uid_t,
1378
+        pub gid: ::gid_t,
1379
+        pub mode: ::mode_t,
1380
+        pub seq: ::c_ushort,
1381
+        pub key: ::key_t,
1382
+    }
1383
+
1384
+    pub struct msqid_ds {
1385
+        pub msg_perm: ::ipc_perm,
1386
+        __unused1: *mut ::c_void,
1387
+        __unused2: *mut ::c_void,
1388
+        pub msg_cbytes: ::msglen_t,
1389
+        pub msg_qnum: ::msgqnum_t,
1390
+        pub msg_qbytes: ::msglen_t,
1391
+        pub msg_lspid: ::pid_t,
1392
+        pub msg_lrpid: ::pid_t,
1393
+        pub msg_stime: ::time_t,
1394
+        pub msg_rtime: ::time_t,
1395
+        pub msg_ctime: ::time_t,
1396
+    }
1397
+
1398
+    pub struct shmid_ds {
1399
+        pub shm_perm: ::ipc_perm,
1400
+        pub shm_segsz: ::size_t,
1401
+        pub shm_lpid: ::pid_t,
1402
+        pub shm_cpid: ::pid_t,
1403
+        pub shm_nattch: ::c_int,
1404
+        pub shm_atime: ::time_t,
1405
+        pub shm_dtime: ::time_t,
1406
+        pub shm_ctime: ::time_t,
1407
+    }
1408
 }
1409
 
1410
 pub const SIGEV_THREAD_ID: ::c_int = 4;
1411
@@ -322,11 +372,88 @@ pub const TIOCSIG: ::c_uint = 0x2004745f;
1412
 pub const TIOCM_DCD: ::c_int = 0x40;
1413
 pub const H4DISC: ::c_int = 0x7;
1414
 
1415
+pub const JAIL_API_VERSION: u32 = 2;
1416
+pub const JAIL_CREATE: ::c_int = 0x01;
1417
+pub const JAIL_UPDATE: ::c_int = 0x02;
1418
+pub const JAIL_ATTACH: ::c_int = 0x04;
1419
+pub const JAIL_DYING: ::c_int = 0x08;
1420
+pub const JAIL_SET_MASK: ::c_int = 0x0f;
1421
+pub const JAIL_GET_MASK: ::c_int = 0x08;
1422
+pub const JAIL_SYS_DISABLE: ::c_int = 0;
1423
+pub const JAIL_SYS_NEW: ::c_int = 1;
1424
+pub const JAIL_SYS_INHERIT: ::c_int = 2;
1425
+
1426
+pub const SO_BINTIME: ::c_int = 0x2000;
1427
+pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
1428
+pub const SO_NO_DDP: ::c_int = 0x8000;
1429
+pub const SO_LABEL: ::c_int = 0x1009;
1430
+pub const SO_PEERLABEL: ::c_int = 0x1010;
1431
+pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
1432
+pub const SO_LISTENQLEN: ::c_int = 0x1012;
1433
+pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
1434
+pub const SO_SETFIB: ::c_int = 0x1014;
1435
+pub const SO_USER_COOKIE: ::c_int = 0x1015;
1436
+pub const SO_PROTOCOL: ::c_int = 0x1016;
1437
+pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
1438
+pub const SO_VENDOR: ::c_int = 0x80000000;
1439
+
1440
+pub const AF_SLOW: ::c_int = 33;
1441
+pub const AF_SCLUSTER: ::c_int = 34;
1442
+pub const AF_ARP: ::c_int = 35;
1443
+pub const AF_BLUETOOTH: ::c_int = 36;
1444
+pub const AF_IEEE80211: ::c_int = 37;
1445
+pub const AF_INET_SDP: ::c_int = 40;
1446
+pub const AF_INET6_SDP: ::c_int = 42;
1447
+#[doc(hidden)]
1448
+pub const AF_MAX: ::c_int = 42;
1449
+
1450
+pub const IPPROTO_DIVERT: ::c_int = 258;
1451
+
1452
+pub const PF_SLOW: ::c_int = AF_SLOW;
1453
+pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
1454
+pub const PF_ARP: ::c_int = AF_ARP;
1455
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1456
+pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
1457
+pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
1458
+pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
1459
+#[doc(hidden)]
1460
+pub const PF_MAX: ::c_int = AF_MAX;
1461
+
1462
+pub const NET_RT_DUMP: ::c_int = 1;
1463
+pub const NET_RT_FLAGS: ::c_int = 2;
1464
+pub const NET_RT_IFLIST: ::c_int = 3;
1465
+pub const NET_RT_IFMALIST: ::c_int = 4;
1466
+pub const NET_RT_IFLISTL: ::c_int = 5;
1467
+
1468
+// System V IPC
1469
+pub const IPC_PRIVATE: ::key_t = 0;
1470
+pub const IPC_CREAT: ::c_int = 0o1000;
1471
+pub const IPC_EXCL: ::c_int = 0o2000;
1472
+pub const IPC_NOWAIT: ::c_int = 0o4000;
1473
+pub const IPC_RMID: ::c_int = 0;
1474
+pub const IPC_SET: ::c_int = 1;
1475
+pub const IPC_STAT: ::c_int = 2;
1476
+pub const IPC_INFO: ::c_int = 3;
1477
+pub const IPC_R : ::c_int = 0o400;
1478
+pub const IPC_W : ::c_int = 0o200;
1479
+pub const IPC_M : ::c_int = 0o10000;
1480
+pub const MSG_NOERROR: ::c_int = 0o10000;
1481
+pub const SHM_RDONLY: ::c_int = 0o10000;
1482
+pub const SHM_RND: ::c_int = 0o20000;
1483
+pub const SHM_R: ::c_int = 0o400;
1484
+pub const SHM_W: ::c_int = 0o200;
1485
+pub const SHM_LOCK: ::c_int = 11;
1486
+pub const SHM_UNLOCK: ::c_int = 12;
1487
+pub const SHM_STAT: ::c_int = 13;
1488
+pub const SHM_INFO: ::c_int = 14;
1489
+
1490
 // The *_MAXID constants never should've been used outside of the
1491
 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
1492
 // they were all removed in svn r262489.  They remain here for backwards
1493
 // compatibility only, and are scheduled to be removed in libc 1.0.0.
1494
 #[doc(hidden)]
1495
+pub const NET_MAXID: ::c_int = AF_MAX;
1496
+#[doc(hidden)]
1497
 pub const CTL_MAXID: ::c_int = 10;
1498
 #[doc(hidden)]
1499
 pub const KERN_MAXID: ::c_int = 38;
1500
@@ -337,7 +464,10 @@ pub const USER_MAXID: ::c_int = 21;
1501
 #[doc(hidden)]
1502
 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
1503
 
1504
-pub const MSG_PEEK: ::c_int = 0x2;
1505
+pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
1506
+pub const MSG_NBIO: ::c_int = 0x00004000;
1507
+pub const MSG_COMPAT: ::c_int = 0x00008000;
1508
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
1509
 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
1510
 
1511
 pub const EMPTY: ::c_short = 0;
1512
@@ -375,6 +505,9 @@ pub const P_PID: idtype_t = 0;
1513
 pub const P_PGID: idtype_t = 2;
1514
 pub const P_ALL: idtype_t = 7;
1515
 
1516
+pub const B460800: ::speed_t = 460800;
1517
+pub const B921600: ::speed_t = 921600;
1518
+
1519
 extern {
1520
     pub fn __error() -> *mut ::c_int;
1521
 
1522
@@ -385,6 +518,14 @@ extern {
1523
     pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
1524
     pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
1525
 
1526
+    pub fn jail(jail: *mut ::jail) -> ::c_int;
1527
+    pub fn jail_attach(jid: ::c_int) -> ::c_int;
1528
+    pub fn jail_remove(jid: ::c_int) -> ::c_int;
1529
+    pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int)
1530
+                    -> ::c_int;
1531
+    pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int)
1532
+                    -> ::c_int;
1533
+
1534
     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
1535
                            len: ::off_t) -> ::c_int;
1536
     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
1537
@@ -403,6 +544,21 @@ extern {
1538
     pub fn freelocale(loc: ::locale_t) -> ::c_int;
1539
     pub fn waitid(idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t,
1540
                   options: ::c_int) -> ::c_int;
1541
+
1542
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
1543
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
1544
+    pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void,
1545
+        shmflg: ::c_int) -> *mut ::c_void;
1546
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
1547
+    pub fn shmctl(shmid: ::c_int, cmd: ::c_int,
1548
+        buf: *mut ::shmid_ds) -> ::c_int;
1549
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int,
1550
+        buf: *mut ::msqid_ds) -> ::c_int;
1551
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
1552
+    pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
1553
+        msgtyp: ::c_long, msgflg: ::c_int) -> ::c_int;
1554
+    pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
1555
+        msgflg: ::c_int) -> ::c_int;
1556
 }
1557
 
1558
 cfg_if! {
1559
@@ -412,6 +568,9 @@ cfg_if! {
1560
     } else if #[cfg(target_arch = "x86_64")] {
1561
         mod x86_64;
1562
         pub use self::x86_64::*;
1563
+    } else if #[cfg(target_arch = "aarch64")] {
1564
+        mod aarch64;
1565
+        pub use self::aarch64::*;
1566
     } else {
1567
         // Unknown target_arch
1568
     }
1569
diff --git third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
1570
index 875aa8f8ff10..4e635ffbfda0 100644
1571
--- third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
1572
+++ third_party/rust/libc/src/unix/bsd/freebsdlike/mod.rs
1573
@@ -452,6 +452,11 @@ pub const F_SETFD: ::c_int = 2;
1574
 pub const F_GETFL: ::c_int = 3;
1575
 pub const F_SETFL: ::c_int = 4;
1576
 
1577
+pub const AT_EACCESS: ::c_int = 0x100;
1578
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
1579
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1580
+pub const AT_REMOVEDIR: ::c_int = 0x800;
1581
+
1582
 pub const SIGTRAP: ::c_int = 5;
1583
 
1584
 pub const GLOB_APPEND  : ::c_int = 0x0001;
1585
@@ -540,13 +545,100 @@ pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
1586
 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
1587
 pub const MINCORE_SUPER: ::c_int = 0x20;
1588
 
1589
+pub const AF_UNSPEC: ::c_int = 0;
1590
+pub const AF_LOCAL: ::c_int = 1;
1591
+pub const AF_UNIX: ::c_int = AF_LOCAL;
1592
 pub const AF_INET: ::c_int = 2;
1593
+pub const AF_IMPLINK: ::c_int = 3;
1594
+pub const AF_PUP: ::c_int = 4;
1595
+pub const AF_CHAOS: ::c_int = 5;
1596
+pub const AF_NETBIOS: ::c_int = 6;
1597
+pub const AF_ISO: ::c_int = 7;
1598
+pub const AF_OSI: ::c_int = AF_ISO;
1599
+pub const AF_ECMA: ::c_int = 8;
1600
+pub const AF_DATAKIT: ::c_int = 9;
1601
+pub const AF_CCITT: ::c_int = 10;
1602
+pub const AF_SNA: ::c_int = 11;
1603
+pub const AF_DECnet: ::c_int = 12;
1604
+pub const AF_DLI: ::c_int = 13;
1605
+pub const AF_LAT: ::c_int = 14;
1606
+pub const AF_HYLINK: ::c_int = 15;
1607
+pub const AF_APPLETALK: ::c_int = 16;
1608
+pub const AF_ROUTE: ::c_int = 17;
1609
+pub const AF_LINK: ::c_int = 18;
1610
+pub const pseudo_AF_XTP: ::c_int = 19;
1611
+pub const AF_COIP: ::c_int = 20;
1612
+pub const AF_CNT: ::c_int = 21;
1613
+pub const pseudo_AF_RTIP: ::c_int = 22;
1614
+pub const AF_IPX: ::c_int = 23;
1615
+pub const AF_SIP: ::c_int = 24;
1616
+pub const pseudo_AF_PIP: ::c_int = 25;
1617
+pub const AF_ISDN: ::c_int = 26;
1618
+pub const AF_E164: ::c_int = AF_ISDN;
1619
+pub const pseudo_AF_KEY: ::c_int = 27;
1620
 pub const AF_INET6: ::c_int = 28;
1621
-pub const AF_UNIX: ::c_int = 1;
1622
+pub const AF_NATM: ::c_int = 29;
1623
+pub const AF_ATM: ::c_int = 30;
1624
+pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
1625
+pub const AF_NETGRAPH: ::c_int = 32;
1626
+
1627
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1628
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
1629
+pub const PF_UNIX: ::c_int = PF_LOCAL;
1630
+pub const PF_INET: ::c_int = AF_INET;
1631
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
1632
+pub const PF_PUP: ::c_int = AF_PUP;
1633
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
1634
+pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
1635
+pub const PF_ISO: ::c_int = AF_ISO;
1636
+pub const PF_OSI: ::c_int = AF_ISO;
1637
+pub const PF_ECMA: ::c_int = AF_ECMA;
1638
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
1639
+pub const PF_CCITT: ::c_int = AF_CCITT;
1640
+pub const PF_SNA: ::c_int = AF_SNA;
1641
+pub const PF_DECnet: ::c_int = AF_DECnet;
1642
+pub const PF_DLI: ::c_int = AF_DLI;
1643
+pub const PF_LAT: ::c_int = AF_LAT;
1644
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
1645
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1646
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
1647
+pub const PF_LINK: ::c_int = AF_LINK;
1648
+pub const PF_XTP: ::c_int = pseudo_AF_XTP;
1649
+pub const PF_COIP: ::c_int = AF_COIP;
1650
+pub const PF_CNT: ::c_int = AF_CNT;
1651
+pub const PF_SIP: ::c_int = AF_SIP;
1652
+pub const PF_IPX: ::c_int = AF_IPX;
1653
+pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
1654
+pub const PF_PIP: ::c_int = pseudo_AF_PIP;
1655
+pub const PF_ISDN: ::c_int = AF_ISDN;
1656
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
1657
+pub const PF_INET6: ::c_int = AF_INET6;
1658
+pub const PF_NATM: ::c_int = AF_NATM;
1659
+pub const PF_ATM: ::c_int = AF_ATM;
1660
+pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH;
1661
+
1662
+pub const SOMAXCONN: ::c_int = 128;
1663
+
1664
+pub const MSG_OOB: ::c_int = 0x00000001;
1665
+pub const MSG_PEEK: ::c_int = 0x00000002;
1666
+pub const MSG_DONTROUTE: ::c_int = 0x00000004;
1667
+pub const MSG_EOR: ::c_int =  0x00000008;
1668
+pub const MSG_TRUNC: ::c_int = 0x00000010;
1669
+pub const MSG_CTRUNC: ::c_int = 0x00000020;
1670
+pub const MSG_WAITALL: ::c_int = 0x00000040;
1671
+pub const MSG_DONTWAIT: ::c_int = 0x00000080;
1672
+pub const MSG_EOF: ::c_int = 0x00000100;
1673
+
1674
 pub const SOCK_STREAM: ::c_int = 1;
1675
 pub const SOCK_DGRAM: ::c_int = 2;
1676
 pub const SOCK_RAW: ::c_int = 3;
1677
+pub const SOCK_RDM: ::c_int = 4;
1678
 pub const SOCK_SEQPACKET: ::c_int = 5;
1679
+pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
1680
+pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
1681
+pub const SOCK_MAXADDRLEN: ::c_int = 255;
1682
+pub const IPPROTO_ICMP: ::c_int = 1;
1683
+pub const IPPROTO_ICMPV6: ::c_int = 58;
1684
 pub const IPPROTO_TCP: ::c_int = 6;
1685
 pub const IPPROTO_IP: ::c_int = 0;
1686
 pub const IPPROTO_IPV6: ::c_int = 41;
1687
@@ -572,6 +664,9 @@ pub const SO_USELOOPBACK: ::c_int = 0x0040;
1688
 pub const SO_LINGER: ::c_int = 0x0080;
1689
 pub const SO_OOBINLINE: ::c_int = 0x0100;
1690
 pub const SO_REUSEPORT: ::c_int = 0x0200;
1691
+pub const SO_TIMESTAMP: ::c_int = 0x0400;
1692
+pub const SO_NOSIGPIPE: ::c_int = 0x0800;
1693
+pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
1694
 pub const SO_SNDBUF: ::c_int = 0x1001;
1695
 pub const SO_RCVBUF: ::c_int = 0x1002;
1696
 pub const SO_SNDLOWAT: ::c_int = 0x1003;
1697
@@ -751,9 +846,43 @@ pub const SLIPDISC: ::c_int = 0x4;
1698
 pub const PPPDISC: ::c_int = 0x5;
1699
 pub const NETGRAPHDISC: ::c_int = 0x6;
1700
 
1701
+pub const B0: speed_t = 0;
1702
+pub const B50: speed_t = 50;
1703
+pub const B75: speed_t = 75;
1704
+pub const B110: speed_t = 110;
1705
+pub const B134: speed_t = 134;
1706
+pub const B150: speed_t = 150;
1707
+pub const B200: speed_t = 200;
1708
+pub const B300: speed_t = 300;
1709
+pub const B600: speed_t = 600;
1710
+pub const B1200: speed_t = 1200;
1711
+pub const B1800: speed_t = 1800;
1712
+pub const B2400: speed_t = 2400;
1713
+pub const B4800: speed_t = 4800;
1714
+pub const B9600: speed_t = 9600;
1715
+pub const B19200: speed_t = 19200;
1716
+pub const B38400: speed_t = 38400;
1717
+pub const B7200: speed_t = 7200;
1718
+pub const B14400: speed_t = 14400;
1719
+pub const B28800: speed_t = 28800;
1720
+pub const B57600: speed_t = 57600;
1721
+pub const B76800: speed_t = 76800;
1722
+pub const B115200: speed_t = 115200;
1723
+pub const B230400: speed_t = 230400;
1724
+pub const EXTA: speed_t = 19200;
1725
+pub const EXTB: speed_t = 38400;
1726
+
1727
 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
1728
 
1729
+pub const CRTSCTS: ::tcflag_t = 0x00030000;
1730
+
1731
+pub const AT_FDCWD: ::c_int = -100;
1732
+
1733
 f! {
1734
+    pub fn WIFCONTINUED(status: ::c_int) -> bool {
1735
+        status == 0x13
1736
+    }
1737
+
1738
     pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1739
         status >> 8
1740
     }
1741
@@ -789,6 +918,7 @@ extern {
1742
     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1743
     pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
1744
                       nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
1745
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1746
     pub fn getnameinfo(sa: *const ::sockaddr,
1747
                        salen: ::socklen_t,
1748
                        host: *mut ::c_char,
1749
@@ -858,6 +988,8 @@ extern {
1750
                      base: ::locale_t) -> ::locale_t;
1751
     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
1752
     pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
1753
+    pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
1754
+                   addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
1755
     pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
1756
     pub fn pthread_attr_get_np(tid: ::pthread_t,
1757
                                attr: *mut ::pthread_attr_t) -> ::c_int;
1758
@@ -866,38 +998,23 @@ extern {
1759
     pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
1760
                                  stackaddr: *mut *mut ::c_void,
1761
                                  stacksize: *mut ::size_t) -> ::c_int;
1762
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
1763
+                                       pshared: ::c_int) -> ::c_int;
1764
+    pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
1765
+                                       pshared: *mut ::c_int) -> ::c_int;
1766
+    pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
1767
+                                        pshared: ::c_int) -> ::c_int;
1768
+    pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1769
+                                        pshared: *mut ::c_int) -> ::c_int;
1770
     pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
1771
     pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
1772
 
1773
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
1774
-                  flags: ::c_int, ...) -> ::c_int;
1775
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
1776
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
1777
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
1778
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
1779
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
1780
-                    owner: ::uid_t, group: ::gid_t,
1781
-                    flags: ::c_int) -> ::c_int;
1782
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
1783
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
1784
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
1785
-                  newdirfd: ::c_int, newpath: *const ::c_char,
1786
-                  flags: ::c_int) -> ::c_int;
1787
-   pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
1788
-                  mode: ::mode_t) -> ::c_int;
1789
-   pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
1790
-                 mode: ::mode_t, dev: dev_t) -> ::c_int;
1791
-   pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1792
-                     buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
1793
-   pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
1794
-                   newdirfd: ::c_int, newpath: *const ::c_char)
1795
-                   -> ::c_int;
1796
-   pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
1797
-                    linkpath: *const ::c_char) -> ::c_int;
1798
-   pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
1799
-                   flags: ::c_int) -> ::c_int;
1800
-   pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1801
-                   mode: ::mode_t) -> ::c_int;
1802
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
1803
+
1804
+    pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
1805
+                  mode: ::mode_t, dev: dev_t) -> ::c_int;
1806
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1807
+                    mode: ::mode_t) -> ::c_int;
1808
     pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
1809
                                      clock_id: *mut clockid_t) -> ::c_int;
1810
     pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
1811
@@ -907,6 +1024,12 @@ extern {
1812
                          abstime: *const ::timespec) -> ::c_int;
1813
     pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
1814
                                    abstime: *const ::timespec) -> ::c_int;
1815
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
1816
+    pub fn ppoll(fds: *mut ::pollfd,
1817
+                 nfds: ::nfds_t,
1818
+                 timeout: *const ::timespec,
1819
+                 sigmask: *const sigset_t) -> ::c_int;
1820
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
1821
 }
1822
 
1823
 cfg_if! {
1824
diff --git third_party/rust/libc/src/unix/bsd/mod.rs third_party/rust/libc/src/unix/bsd/mod.rs
1825
index 2f7024f8276a..deddca042dc4 100644
1826
--- third_party/rust/libc/src/unix/bsd/mod.rs
1827
+++ third_party/rust/libc/src/unix/bsd/mod.rs
1828
@@ -1,4 +1,4 @@
1829
-use dox::mem;
1830
+use dox::{mem, Option};
1831
 
1832
 pub type c_char = i8;
1833
 pub type wchar_t = i32;
1834
@@ -242,6 +242,8 @@ pub const IXANY: ::tcflag_t = 0x00000800;
1835
 pub const IMAXBEL: ::tcflag_t = 0x00002000;
1836
 pub const OPOST: ::tcflag_t = 0x1;
1837
 pub const ONLCR: ::tcflag_t = 0x2;
1838
+pub const OXTABS: ::tcflag_t = 0x4;
1839
+pub const ONOEOT: ::tcflag_t = 0x8;
1840
 pub const CSIZE: ::tcflag_t = 0x00000300;
1841
 pub const CS5: ::tcflag_t = 0x00000000;
1842
 pub const CS6: ::tcflag_t = 0x00000100;
1843
@@ -273,7 +275,9 @@ pub const WNOHANG: ::c_int = 0x00000001;
1844
 pub const WUNTRACED: ::c_int = 0x00000002;
1845
 
1846
 pub const RTLD_NOW: ::c_int = 0x2;
1847
+pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
1848
 pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
1849
+pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
1850
 
1851
 pub const LOG_CRON: ::c_int = 9 << 3;
1852
 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
1853
@@ -359,6 +363,77 @@ extern {
1854
     pub fn getpeereid(socket: ::c_int,
1855
                       euid: *mut ::uid_t,
1856
                       egid: *mut ::gid_t) -> ::c_int;
1857
+
1858
+    #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
1859
+    #[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
1860
+    pub fn glob(pattern: *const ::c_char,
1861
+                flags: ::c_int,
1862
+                errfunc: Option<extern fn(epath: *const ::c_char,
1863
+                                          errno: ::c_int) -> ::c_int>,
1864
+                pglob: *mut ::glob_t) -> ::c_int;
1865
+    #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
1866
+    pub fn globfree(pglob: *mut ::glob_t);
1867
+
1868
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
1869
+                         -> ::c_int;
1870
+
1871
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
1872
+
1873
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
1874
+               link_name = "seekdir$INODE64")]
1875
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1876
+               link_name = "seekdir$INODE64$UNIX2003")]
1877
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
1878
+
1879
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
1880
+               link_name = "telldir$INODE64")]
1881
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1882
+               link_name = "telldir$INODE64$UNIX2003")]
1883
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
1884
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
1885
+                  -> ::c_int;
1886
+
1887
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1888
+               link_name = "msync$UNIX2003")]
1889
+    #[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
1890
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
1891
+
1892
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1893
+               link_name = "recvfrom$UNIX2003")]
1894
+    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
1895
+                    flags: ::c_int, addr: *mut ::sockaddr,
1896
+                    addrlen: *mut ::socklen_t) -> ::ssize_t;
1897
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
1898
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
1899
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
1900
+
1901
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1902
+               link_name = "bind$UNIX2003")]
1903
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
1904
+                address_len: ::socklen_t) -> ::c_int;
1905
+
1906
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1907
+               link_name = "writev$UNIX2003")]
1908
+    pub fn writev(fd: ::c_int,
1909
+                  iov: *const ::iovec,
1910
+                  iovcnt: ::c_int) -> ::ssize_t;
1911
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1912
+               link_name = "readv$UNIX2003")]
1913
+    pub fn readv(fd: ::c_int,
1914
+                 iov: *const ::iovec,
1915
+                 iovcnt: ::c_int) -> ::ssize_t;
1916
+
1917
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1918
+               link_name = "sendmsg$UNIX2003")]
1919
+    pub fn sendmsg(fd: ::c_int,
1920
+                   msg: *const ::msghdr,
1921
+                   flags: ::c_int) -> ::ssize_t;
1922
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1923
+               link_name = "recvmsg$UNIX2003")]
1924
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
1925
+                   -> ::ssize_t;
1926
+
1927
+    pub fn sync();
1928
 }
1929
 
1930
 cfg_if! {
1931
diff --git third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs
1932
index e8c82883d2bb..1471e6f3841e 100644
1933
--- third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs
1934
+++ third_party/rust/libc/src/unix/bsd/netbsdlike/mod.rs
1935
@@ -356,13 +356,71 @@ pub const MADV_WILLNEED : ::c_int = 3;
1936
 pub const MADV_DONTNEED : ::c_int = 4;
1937
 pub const MADV_FREE : ::c_int = 6;
1938
 
1939
-pub const AF_UNIX: ::c_int = 1;
1940
+pub const AF_UNSPEC: ::c_int = 0;
1941
+pub const AF_LOCAL: ::c_int = 1;
1942
+pub const AF_UNIX: ::c_int = AF_LOCAL;
1943
 pub const AF_INET: ::c_int = 2;
1944
+pub const AF_IMPLINK: ::c_int = 3;
1945
+pub const AF_PUP: ::c_int = 4;
1946
+pub const AF_CHAOS: ::c_int = 5;
1947
+pub const AF_NS: ::c_int = 6;
1948
+pub const AF_ISO: ::c_int = 7;
1949
+pub const AF_OSI: ::c_int = AF_ISO;
1950
+pub const AF_DATAKIT: ::c_int = 9;
1951
+pub const AF_CCITT: ::c_int = 10;
1952
+pub const AF_SNA: ::c_int = 11;
1953
+pub const AF_DECnet: ::c_int = 12;
1954
+pub const AF_DLI: ::c_int = 13;
1955
+pub const AF_LAT: ::c_int = 14;
1956
+pub const AF_HYLINK: ::c_int = 15;
1957
+pub const AF_APPLETALK: ::c_int = 16;
1958
+pub const AF_LINK: ::c_int = 18;
1959
+pub const pseudo_AF_XTP: ::c_int = 19;
1960
+pub const AF_COIP: ::c_int = 20;
1961
+pub const AF_CNT: ::c_int = 21;
1962
+pub const pseudo_AF_RTIP: ::c_int = 22;
1963
+pub const AF_IPX: ::c_int = 23;
1964
 pub const AF_INET6: ::c_int = 24;
1965
+pub const pseudo_AF_PIP: ::c_int = 25;
1966
+pub const AF_ISDN: ::c_int = 26;
1967
+pub const AF_E164: ::c_int = AF_ISDN;
1968
+pub const AF_NATM: ::c_int = 27;
1969
+
1970
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1971
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
1972
+pub const PF_UNIX: ::c_int = PF_LOCAL;
1973
+pub const PF_INET: ::c_int = AF_INET;
1974
+pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
1975
+pub const PF_PUP: ::c_int = AF_PUP;
1976
+pub const PF_CHAOS: ::c_int = AF_CHAOS;
1977
+pub const PF_NS: ::c_int = AF_NS;
1978
+pub const PF_ISO: ::c_int = AF_ISO;
1979
+pub const PF_OSI: ::c_int = AF_ISO;
1980
+pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
1981
+pub const PF_CCITT: ::c_int = AF_CCITT;
1982
+pub const PF_SNA: ::c_int = AF_SNA;
1983
+pub const PF_DECnet: ::c_int = AF_DECnet;
1984
+pub const PF_DLI: ::c_int = AF_DLI;
1985
+pub const PF_LAT: ::c_int = AF_LAT;
1986
+pub const PF_HYLINK: ::c_int = AF_HYLINK;
1987
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1988
+pub const PF_LINK: ::c_int = AF_LINK;
1989
+pub const PF_XTP: ::c_int = pseudo_AF_XTP;
1990
+pub const PF_COIP: ::c_int = AF_COIP;
1991
+pub const PF_CNT: ::c_int = AF_CNT;
1992
+pub const PF_IPX: ::c_int = AF_IPX;
1993
+pub const PF_INET6: ::c_int = AF_INET6;
1994
+pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
1995
+pub const PF_PIP: ::c_int = pseudo_AF_PIP;
1996
+pub const PF_ISDN: ::c_int = AF_ISDN;
1997
+pub const PF_NATM: ::c_int = AF_NATM;
1998
+
1999
 pub const SOCK_STREAM: ::c_int = 1;
2000
 pub const SOCK_DGRAM: ::c_int = 2;
2001
 pub const SOCK_RAW: ::c_int = 3;
2002
 pub const SOCK_SEQPACKET: ::c_int = 5;
2003
+pub const IPPROTO_ICMP: ::c_int = 1;
2004
+pub const IPPROTO_ICMPV6: ::c_int = 58;
2005
 pub const IPPROTO_TCP: ::c_int = 6;
2006
 pub const IPPROTO_IP: ::c_int = 0;
2007
 pub const IPPROTO_IPV6: ::c_int = 41;
2008
@@ -392,8 +450,22 @@ pub const SO_RCVLOWAT: ::c_int = 0x1004;
2009
 pub const SO_ERROR: ::c_int = 0x1007;
2010
 pub const SO_TYPE: ::c_int = 0x1008;
2011
 
2012
+pub const SOMAXCONN: ::c_int = 128;
2013
+
2014
+pub const MSG_OOB: ::c_int = 0x1;
2015
 pub const MSG_PEEK: ::c_int = 0x2;
2016
+pub const MSG_DONTROUTE: ::c_int = 0x4;
2017
+pub const MSG_EOR: ::c_int = 0x8;
2018
+pub const MSG_TRUNC: ::c_int = 0x10;
2019
+pub const MSG_CTRUNC: ::c_int = 0x20;
2020
+pub const MSG_WAITALL: ::c_int = 0x40;
2021
+pub const MSG_DONTWAIT: ::c_int = 0x80;
2022
+pub const MSG_BCAST: ::c_int = 0x100;
2023
+pub const MSG_MCAST: ::c_int = 0x200;
2024
 pub const MSG_NOSIGNAL: ::c_int = 0x400;
2025
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800;
2026
+
2027
+pub const SCM_RIGHTS: ::c_int = 0x01;
2028
 
2029
 pub const IFF_LOOPBACK: ::c_int = 0x8;
2030
 
2031
@@ -449,6 +521,32 @@ pub const LOG_NFACILITIES: ::c_int = 24;
2032
 
2033
 pub const HW_NCPU: ::c_int = 3;
2034
 
2035
+pub const B0: speed_t = 0;
2036
+pub const B50: speed_t = 50;
2037
+pub const B75: speed_t = 75;
2038
+pub const B110: speed_t = 110;
2039
+pub const B134: speed_t = 134;
2040
+pub const B150: speed_t = 150;
2041
+pub const B200: speed_t = 200;
2042
+pub const B300: speed_t = 300;
2043
+pub const B600: speed_t = 600;
2044
+pub const B1200: speed_t = 1200;
2045
+pub const B1800: speed_t = 1800;
2046
+pub const B2400: speed_t = 2400;
2047
+pub const B4800: speed_t = 4800;
2048
+pub const B9600: speed_t = 9600;
2049
+pub const B19200: speed_t = 19200;
2050
+pub const B38400: speed_t = 38400;
2051
+pub const B7200: speed_t = 7200;
2052
+pub const B14400: speed_t = 14400;
2053
+pub const B28800: speed_t = 28800;
2054
+pub const B57600: speed_t = 57600;
2055
+pub const B76800: speed_t = 76800;
2056
+pub const B115200: speed_t = 115200;
2057
+pub const B230400: speed_t = 230400;
2058
+pub const EXTA: speed_t = 19200;
2059
+pub const EXTB: speed_t = 38400;
2060
+
2061
 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
2062
 
2063
 f! {
2064
@@ -499,42 +597,20 @@ extern {
2065
     pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
2066
     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
2067
 
2068
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
2069
-                  flags: ::c_int, ...) -> ::c_int;
2070
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
2071
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
2072
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
2073
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
2074
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
2075
-                    owner: ::uid_t, group: ::gid_t,
2076
-                    flags: ::c_int) -> ::c_int;
2077
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
2078
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
2079
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
2080
-                  newdirfd: ::c_int, newpath: *const ::c_char,
2081
-                  flags: ::c_int) -> ::c_int;
2082
-   pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
2083
-                  mode: ::mode_t) -> ::c_int;
2084
-   pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
2085
-                 mode: ::mode_t, dev: dev_t) -> ::c_int;
2086
-   pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
2087
-                     buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
2088
-   pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
2089
-                   newdirfd: ::c_int, newpath: *const ::c_char)
2090
-                   -> ::c_int;
2091
-   pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
2092
-                    linkpath: *const ::c_char) -> ::c_int;
2093
-   pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
2094
-                   flags: ::c_int) -> ::c_int;
2095
-   pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
2096
-                   mode: ::mode_t) -> ::c_int;
2097
-   pub fn sem_timedwait(sem: *mut sem_t,
2098
-                        abstime: *const ::timespec) -> ::c_int;
2099
-   pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
2100
-                                    clock_id: clockid_t) -> ::c_int;
2101
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
2102
+
2103
+    pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
2104
+                   mode: ::mode_t, dev: dev_t) -> ::c_int;
2105
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
2106
+                    mode: ::mode_t) -> ::c_int;
2107
+    pub fn sem_timedwait(sem: *mut sem_t,
2108
+                         abstime: *const ::timespec) -> ::c_int;
2109
+    pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
2110
+                                     clock_id: clockid_t) -> ::c_int;
2111
     pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
2112
     pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
2113
                                    abstime: *const ::timespec) -> ::c_int;
2114
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
2115
 }
2116
 
2117
 cfg_if! {
2118
diff --git third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
2119
index 2f85513408b2..a02616792b07 100644
2120
--- third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
2121
+++ third_party/rust/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
2122
@@ -246,6 +246,12 @@ s! {
2123
     }
2124
 }
2125
 
2126
+pub const AT_FDCWD: ::c_int = -100;
2127
+pub const AT_EACCESS: ::c_int = 0x100;
2128
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
2129
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
2130
+pub const AT_REMOVEDIR: ::c_int = 0x800;
2131
+
2132
 pub const LC_COLLATE_MASK: ::c_int = (1 << ::LC_COLLATE);
2133
 pub const LC_CTYPE_MASK: ::c_int = (1 << ::LC_CTYPE);
2134
 pub const LC_MONETARY_MASK: ::c_int = (1 << ::LC_MONETARY);
2135
@@ -291,8 +297,50 @@ pub const F_MAXFD: ::c_int = 11;
2136
 pub const IPV6_JOIN_GROUP: ::c_int = 12;
2137
 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
2138
 
2139
+pub const SOCK_CONN_DGRAM: ::c_int = 6;
2140
+pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM;
2141
+pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000;
2142
+pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000;
2143
+
2144
 pub const SO_SNDTIMEO: ::c_int = 0x100b;
2145
 pub const SO_RCVTIMEO: ::c_int = 0x100c;
2146
+pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
2147
+pub const SO_TIMESTAMP: ::c_int = 0x2000;
2148
+pub const SO_OVERFLOWED: ::c_int = 0x1009;
2149
+pub const SO_NOHEADER: ::c_int = 0x100a;
2150
+
2151
+pub const AF_OROUTE: ::c_int = 17;
2152
+pub const AF_ARP: ::c_int = 28;
2153
+pub const pseudo_AF_KEY: ::c_int = 29;
2154
+pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
2155
+pub const AF_BLUETOOTH: ::c_int = 31;
2156
+pub const AF_IEEE80211: ::c_int = 32;
2157
+pub const AF_MPLS: ::c_int = 33;
2158
+pub const AF_ROUTE: ::c_int = 34;
2159
+pub const AF_MAX: ::c_int = 35;
2160
+
2161
+pub const NET_MAXID: ::c_int = AF_MAX;
2162
+pub const NET_RT_DUMP: ::c_int = 1;
2163
+pub const NET_RT_FLAGS: ::c_int = 2;
2164
+pub const NET_RT_OOIFLIST: ::c_int = 3;
2165
+pub const NET_RT_OIFLIST: ::c_int = 4;
2166
+pub const NET_RT_IFLIST: ::c_int = 5;
2167
+pub const NET_RT_MAXID: ::c_int = 6;
2168
+
2169
+pub const PF_OROUTE: ::c_int = AF_OROUTE;
2170
+pub const PF_ARP: ::c_int = AF_ARP;
2171
+pub const PF_KEY: ::c_int = pseudo_AF_KEY;
2172
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
2173
+pub const PF_MPLS: ::c_int = AF_MPLS;
2174
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
2175
+pub const PF_MAX: ::c_int = AF_MAX;
2176
+
2177
+pub const MSG_NBIO: ::c_int = 0x1000;
2178
+pub const MSG_WAITFORONE: ::c_int = 0x2000;
2179
+pub const MSG_NOTIFICATION: ::c_int = 0x4000;
2180
+
2181
+pub const SCM_TIMESTAMP: ::c_int = 0x08;
2182
+pub const SCM_CREDS: ::c_int = 0x10;
2183
 
2184
 pub const O_DSYNC : ::c_int = 0x10000;
2185
 
2186
@@ -593,6 +641,18 @@ pub const P_ALL: idtype_t = 0;
2187
 pub const P_PID: idtype_t = 1;
2188
 pub const P_PGID: idtype_t = 4;
2189
 
2190
+pub const B460800: ::speed_t = 460800;
2191
+pub const B921600: ::speed_t = 921600;
2192
+
2193
+// dirfd() is a macro on netbsd to access
2194
+// the first field of the struct where dirp points to:
2195
+// http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
2196
+f! {
2197
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int {
2198
+        unsafe { *(dirp as *const ::c_int) }
2199
+    }
2200
+}
2201
+
2202
 extern {
2203
     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
2204
     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
2205
@@ -668,6 +728,8 @@ extern {
2206
     pub fn newlocale(mask: ::c_int,
2207
                      locale: *const ::c_char,
2208
                      base: ::locale_t) -> ::locale_t;
2209
+    #[link_name = "__settimeofday50"]
2210
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
2211
 }
2212
 
2213
 mod other;
2214
diff --git third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
2215
index 9d4925083318..76e458c4757e 100644
2216
--- third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
2217
+++ third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
2218
@@ -157,14 +157,64 @@ pub const ELAST : ::c_int = 91;
2219
 
2220
 pub const F_DUPFD_CLOEXEC : ::c_int = 10;
2221
 
2222
+pub const AT_FDCWD: ::c_int = -100;
2223
+pub const AT_EACCESS: ::c_int = 0x01;
2224
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02;
2225
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04;
2226
+pub const AT_REMOVEDIR: ::c_int = 0x08;
2227
+
2228
 pub const RLIM_NLIMITS: ::c_int = 9;
2229
 
2230
 pub const SO_SNDTIMEO: ::c_int = 0x1005;
2231
 pub const SO_RCVTIMEO: ::c_int = 0x1006;
2232
+pub const SO_BINDANY: ::c_int = 0x1000;
2233
+pub const SO_NETPROC: ::c_int = 0x1020;
2234
+pub const SO_RTABLE: ::c_int = 0x1021;
2235
+pub const SO_PEERCRED: ::c_int = 0x1022;
2236
+pub const SO_SPLICE: ::c_int = 0x1023;
2237
+
2238
+pub const AF_ECMA: ::c_int = 8;
2239
+pub const AF_ROUTE: ::c_int = 17;
2240
+pub const AF_ENCAP: ::c_int = 28;
2241
+pub const AF_SIP: ::c_int = 29;
2242
+pub const AF_KEY: ::c_int = 30;
2243
+pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
2244
+pub const AF_BLUETOOTH: ::c_int = 32;
2245
+pub const AF_MPLS: ::c_int = 33;
2246
+pub const pseudo_AF_PFLOW: ::c_int = 34;
2247
+pub const pseudo_AF_PIPEX: ::c_int = 35;
2248
+#[doc(hidden)]
2249
+pub const AF_MAX: ::c_int = 36;
2250
+
2251
+#[doc(hidden)]
2252
+pub const NET_MAXID: ::c_int = AF_MAX;
2253
+pub const NET_RT_DUMP: ::c_int = 1;
2254
+pub const NET_RT_FLAGS: ::c_int = 2;
2255
+pub const NET_RT_IFLIST: ::c_int = 3;
2256
+pub const NET_RT_STATS: ::c_int = 4;
2257
+pub const NET_RT_TABLE: ::c_int = 5;
2258
+pub const NET_RT_IFNAMES: ::c_int = 6;
2259
+#[doc(hidden)]
2260
+pub const NET_RT_MAXID: ::c_int = 7;
2261
 
2262
 pub const IPV6_JOIN_GROUP: ::c_int = 12;
2263
 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
2264
 
2265
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
2266
+pub const PF_ECMA: ::c_int = AF_ECMA;
2267
+pub const PF_ENCAP: ::c_int = AF_ENCAP;
2268
+pub const PF_SIP: ::c_int = AF_SIP;
2269
+pub const PF_KEY: ::c_int = AF_KEY;
2270
+pub const PF_BPF: ::c_int = pseudo_AF_HDRCMPLT;
2271
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
2272
+pub const PF_MPLS: ::c_int = AF_MPLS;
2273
+pub const PF_PFLOW: ::c_int = pseudo_AF_PFLOW;
2274
+pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX;
2275
+#[doc(hidden)]
2276
+pub const PF_MAX: ::c_int = AF_MAX;
2277
+
2278
+pub const SCM_TIMESTAMP: ::c_int = 0x04;
2279
+
2280
 pub const O_DSYNC : ::c_int = 128;
2281
 
2282
 pub const MAP_RENAME : ::c_int = 0x0000;
2283
@@ -407,6 +457,7 @@ pub const KI_MAXLOGNAME: ::c_int = 32;
2284
 pub const KI_EMULNAMELEN: ::c_int = 8;
2285
 
2286
 extern {
2287
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
2288
     pub fn getnameinfo(sa: *const ::sockaddr,
2289
                        salen: ::socklen_t,
2290
                        host: *mut ::c_char,
2291
diff --git third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
2292
index b7fed64ede5b..8b36ee5ce6bd 100644
2293
--- third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
2294
+++ third_party/rust/libc/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
2295
@@ -26,3 +26,8 @@ s! {
2296
         pub int_n_sign_posn: ::c_char,
2297
     }
2298
 }
2299
+
2300
+extern {
2301
+    pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
2302
+                   addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
2303
+}
2304
diff --git third_party/rust/libc/src/unix/haiku/mod.rs third_party/rust/libc/src/unix/haiku/mod.rs
2305
index d62a31ed2d19..e90aa306fddc 100644
2306
--- third_party/rust/libc/src/unix/haiku/mod.rs
2307
+++ third_party/rust/libc/src/unix/haiku/mod.rs
2308
@@ -1,4 +1,4 @@
2309
-use dox::mem;
2310
+use dox::{mem, Option};
2311
 
2312
 pub type rlim_t = ::uintptr_t;
2313
 pub type sa_family_t = u8;
2314
@@ -536,6 +536,8 @@ pub const AF_UNIX: ::c_int = 9;
2315
 pub const AF_INET: ::c_int = 1;
2316
 pub const AF_INET6: ::c_int = 6;
2317
 pub const SOCK_RAW: ::c_int = 3;
2318
+pub const IPPROTO_ICMP: ::c_int = 1;
2319
+pub const IPPROTO_ICMPV6: ::c_int = 58;
2320
 pub const IPPROTO_TCP: ::c_int = 6;
2321
 pub const IPPROTO_IP: ::c_int = 0;
2322
 pub const IPPROTO_IPV6: ::c_int = 41;
2323
@@ -747,6 +749,7 @@ extern {
2324
     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
2325
     pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
2326
                     -> ::c_int;
2327
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
2328
     pub fn getnameinfo(sa: *const ::sockaddr,
2329
                        salen: ::socklen_t,
2330
                        host: *mut ::c_char,
2331
@@ -758,6 +761,50 @@ extern {
2332
                                    abstime: *const ::timespec) -> ::c_int;
2333
     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
2334
                   options: ::c_int) -> ::c_int;
2335
+
2336
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
2337
+    pub fn glob(pattern: *const ::c_char,
2338
+                flags: ::c_int,
2339
+                errfunc: Option<extern fn(epath: *const ::c_char,
2340
+                                          errno: ::c_int) -> ::c_int>,
2341
+                pglob: *mut ::glob_t) -> ::c_int;
2342
+    pub fn globfree(pglob: *mut ::glob_t);
2343
+
2344
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
2345
+                         -> ::c_int;
2346
+
2347
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
2348
+
2349
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
2350
+
2351
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
2352
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
2353
+                  -> ::c_int;
2354
+
2355
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
2356
+
2357
+    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
2358
+                    flags: ::c_int, addr: *mut ::sockaddr,
2359
+                    addrlen: *mut ::socklen_t) -> ::ssize_t;
2360
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
2361
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
2362
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
2363
+
2364
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
2365
+                address_len: ::socklen_t) -> ::c_int;
2366
+
2367
+    pub fn writev(fd: ::c_int,
2368
+                  iov: *const ::iovec,
2369
+                  iovcnt: ::c_int) -> ::ssize_t;
2370
+    pub fn readv(fd: ::c_int,
2371
+                 iov: *const ::iovec,
2372
+                 iovcnt: ::c_int) -> ::ssize_t;
2373
+
2374
+    pub fn sendmsg(fd: ::c_int,
2375
+                   msg: *const ::msghdr,
2376
+                   flags: ::c_int) -> ::ssize_t;
2377
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
2378
+                   -> ::ssize_t;
2379
 }
2380
 
2381
 cfg_if! {
2382
diff --git third_party/rust/libc/src/unix/mod.rs third_party/rust/libc/src/unix/mod.rs
2383
index 427553d13ebf..14bf9c5393e2 100644
2384
--- third_party/rust/libc/src/unix/mod.rs
2385
+++ third_party/rust/libc/src/unix/mod.rs
2386
@@ -124,6 +124,20 @@ s! {
2387
         // Actually a union of an int and a void*
2388
         pub sival_ptr: *mut ::c_void
2389
     }
2390
+
2391
+    // <sys/time.h>
2392
+    pub struct itimerval {
2393
+        pub it_interval: ::timeval,
2394
+        pub it_value: ::timeval,
2395
+    }
2396
+
2397
+    // <sys/times.h>
2398
+    pub struct tms {
2399
+        pub tms_utime: ::clock_t,
2400
+        pub tms_stime: ::clock_t,
2401
+        pub tms_cutime: ::clock_t,
2402
+        pub tms_cstime: ::clock_t,
2403
+    }
2404
 }
2405
 
2406
 pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
2407
@@ -242,6 +256,7 @@ cfg_if! {
2408
         #[link(name = "c")]
2409
         #[link(name = "m")]
2410
         #[link(name = "rt")]
2411
+        #[link(name = "pthread")]
2412
         extern {}
2413
     }
2414
 }
2415
@@ -275,10 +290,6 @@ extern {
2416
     pub fn connect(socket: ::c_int, address: *const sockaddr,
2417
                    len: socklen_t) -> ::c_int;
2418
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2419
-               link_name = "bind$UNIX2003")]
2420
-    pub fn bind(socket: ::c_int, address: *const sockaddr,
2421
-                address_len: socklen_t) -> ::c_int;
2422
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2423
                link_name = "listen$UNIX2003")]
2424
     pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
2425
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2426
@@ -350,8 +361,12 @@ extern {
2427
                link_name = "opendir$INODE64$UNIX2003")]
2428
     #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
2429
     pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
2430
+    #[cfg_attr(target_os = "macos", link_name = "readdir$INODE64")]
2431
+    #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
2432
+    pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
2433
     #[cfg_attr(target_os = "macos", link_name = "readdir_r$INODE64")]
2434
     #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
2435
+    #[cfg_attr(target_os = "solaris", link_name = "__posix_readdir_r")]
2436
     pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
2437
                      result: *mut *mut ::dirent) -> ::c_int;
2438
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2439
@@ -363,6 +378,36 @@ extern {
2440
                link_name = "rewinddir$INODE64$UNIX2003")]
2441
     pub fn rewinddir(dirp: *mut ::DIR);
2442
 
2443
+    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
2444
+                  flags: ::c_int, ...) -> ::c_int;
2445
+    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
2446
+                     mode: ::c_int, flags: ::c_int) -> ::c_int;
2447
+    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
2448
+                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
2449
+    pub fn fchown(fd: ::c_int,
2450
+                  owner: ::uid_t,
2451
+                  group: ::gid_t) -> ::c_int;
2452
+    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
2453
+                    owner: ::uid_t, group: ::gid_t,
2454
+                    flags: ::c_int) -> ::c_int;
2455
+    #[cfg_attr(target_os = "macos", link_name = "fstatat$INODE64")]
2456
+    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
2457
+                   buf: *mut stat, flags: ::c_int) -> ::c_int;
2458
+    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
2459
+                  newdirfd: ::c_int, newpath: *const ::c_char,
2460
+                  flags: ::c_int) -> ::c_int;
2461
+    pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
2462
+                   mode: ::mode_t) -> ::c_int;
2463
+    pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
2464
+                      buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
2465
+    pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
2466
+                    newdirfd: ::c_int, newpath: *const ::c_char)
2467
+                    -> ::c_int;
2468
+    pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
2469
+                     linkpath: *const ::c_char) -> ::c_int;
2470
+    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
2471
+                    flags: ::c_int) -> ::c_int;
2472
+
2473
     pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
2474
     pub fn alarm(seconds: ::c_uint) -> ::c_uint;
2475
     pub fn chdir(dir: *const c_char) -> ::c_int;
2476
@@ -374,7 +419,9 @@ extern {
2477
     pub fn lchown(path: *const c_char, uid: uid_t,
2478
                   gid: gid_t) -> ::c_int;
2479
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2480
-               link_name = "close$UNIX2003")]
2481
+               link_name = "close$NOCANCEL$UNIX2003")]
2482
+    #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
2483
+               link_name = "close$NOCANCEL")]
2484
     pub fn close(fd: ::c_int) -> ::c_int;
2485
     pub fn dup(fd: ::c_int) -> ::c_int;
2486
     pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
2487
@@ -425,6 +472,7 @@ extern {
2488
     pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
2489
                 -> ::ssize_t;
2490
     pub fn rmdir(path: *const c_char) -> ::c_int;
2491
+    pub fn seteuid(uid: uid_t) -> ::c_int;
2492
     pub fn setgid(gid: gid_t) -> ::c_int;
2493
     pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
2494
     pub fn setsid() -> pid_t;
2495
@@ -535,6 +583,8 @@ extern {
2496
     #[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
2497
     pub fn gettimeofday(tp: *mut ::timeval,
2498
                         tz: *mut ::c_void) -> ::c_int;
2499
+    #[cfg_attr(target_os = "netbsd", link_name = "__times13")]
2500
+    pub fn times(buf: *mut ::tms) -> ::clock_t;
2501
 
2502
     pub fn pthread_self() -> ::pthread_t;
2503
     pub fn pthread_create(native: *mut ::pthread_t,
2504
@@ -545,6 +595,10 @@ extern {
2505
                link_name = "pthread_join$UNIX2003")]
2506
     pub fn pthread_join(native: ::pthread_t,
2507
                         value: *mut *mut ::c_void) -> ::c_int;
2508
+    pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
2509
+                          parent: Option<unsafe extern fn()>,
2510
+                          child: Option<unsafe extern fn()>) -> ::c_int;
2511
+    pub fn pthread_exit(value: *mut ::c_void);
2512
     pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
2513
     pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
2514
     pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t,
2515
@@ -638,6 +692,7 @@ extern {
2516
                        oss: *mut stack_t) -> ::c_int;
2517
     #[cfg_attr(all(target_os = "macos", target_arch ="x86"),
2518
                link_name = "sigwait$UNIX2003")]
2519
+    #[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
2520
     pub fn sigwait(set: *const sigset_t,
2521
                    sig: *mut ::c_int) -> ::c_int;
2522
 
2523
@@ -658,6 +713,14 @@ extern {
2524
                        res: *mut *mut addrinfo) -> ::c_int;
2525
     pub fn freeaddrinfo(res: *mut addrinfo);
2526
     pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
2527
+    #[cfg_attr(any(
2528
+                   all(target_os = "linux", not(target_env = "musl")),
2529
+                   target_os = "freebsd",
2530
+                   target_os = "dragonfly"),
2531
+               link_name = "__res_init")]
2532
+    #[cfg_attr(any(target_os = "macos", target_os = "ios"),
2533
+               link_name = "res_9_init")]
2534
+    pub fn res_init() -> ::c_int;
2535
 
2536
     #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
2537
     pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
2538
@@ -669,22 +732,14 @@ extern {
2539
     pub fn mktime(tm: *mut tm) -> time_t;
2540
     #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
2541
     pub fn time(time: *mut time_t) -> time_t;
2542
+    #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
2543
+    pub fn gmtime(time_p: *const time_t) -> *mut tm;
2544
     #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
2545
-    pub fn localtime(time: *const time_t) -> *mut tm;
2546
+    pub fn localtime(time_p: *const time_t) -> *mut tm;
2547
 
2548
     #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
2549
     pub fn mknod(pathname: *const ::c_char, mode: ::mode_t,
2550
                  dev: ::dev_t) -> ::c_int;
2551
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2552
-               link_name = "writev$UNIX2003")]
2553
-    pub fn writev(fd: ::c_int,
2554
-                  iov: *const ::iovec,
2555
-                  iovcnt: ::c_int) -> ::ssize_t;
2556
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2557
-               link_name = "readv$UNIX2003")]
2558
-    pub fn readv(fd: ::c_int,
2559
-                 iov: *const ::iovec,
2560
-                 iovcnt: ::c_int) -> ::ssize_t;
2561
     pub fn uname(buf: *mut ::utsname) -> ::c_int;
2562
     pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
2563
     pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
2564
@@ -705,14 +760,6 @@ extern {
2565
     #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")]
2566
     pub fn putenv(string: *mut c_char) -> ::c_int;
2567
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2568
-               link_name = "sendmsg$UNIX2003")]
2569
-    pub fn sendmsg(fd: ::c_int,
2570
-                   msg: *const msghdr,
2571
-                   flags: ::c_int) -> ::ssize_t;
2572
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2573
-               link_name = "recvmsg$UNIX2003")]
2574
-    pub fn recvmsg(fd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
2575
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2576
                link_name = "poll$UNIX2003")]
2577
     pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
2578
     #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
2579
@@ -743,58 +790,14 @@ extern {
2580
                     pshared: ::c_int,
2581
                     value: ::c_uint)
2582
                     -> ::c_int;
2583
-}
2584
-
2585
-// TODO: get rid of this cfg(not(...))
2586
-#[cfg(not(target_os = "android"))] // " if " -- appease style checker
2587
-extern {
2588
-    #[cfg_attr(target_os = "macos", link_name = "glob$INODE64")]
2589
-    #[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
2590
-    pub fn glob(pattern: *const c_char,
2591
-                flags: ::c_int,
2592
-                errfunc: Option<extern fn(epath: *const c_char,
2593
-                                          errno: ::c_int) -> ::c_int>,
2594
-                pglob: *mut glob_t) -> ::c_int;
2595
-    #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
2596
-    pub fn globfree(pglob: *mut glob_t);
2597
-
2598
-    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
2599
-                         -> ::c_int;
2600
-
2601
-    pub fn shm_unlink(name: *const c_char) -> ::c_int;
2602
-
2603
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
2604
-               link_name = "seekdir$INODE64")]
2605
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2606
-               link_name = "seekdir$INODE64$UNIX2003")]
2607
-    pub fn seekdir(dirp: *mut ::DIR, loc: c_long);
2608
-
2609
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
2610
-               link_name = "telldir$INODE64")]
2611
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2612
-               link_name = "telldir$INODE64$UNIX2003")]
2613
-    pub fn telldir(dirp: *mut ::DIR) -> c_long;
2614
+    pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
2615
+    pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
2616
 
2617
-    pub fn getsid(pid: pid_t) -> pid_t;
2618
-    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
2619
-                   -> ::c_int;
2620
     pub fn readlink(path: *const c_char,
2621
                     buf: *mut c_char,
2622
                     bufsz: ::size_t)
2623
                     -> ::ssize_t;
2624
 
2625
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2626
-               link_name = "msync$UNIX2003")]
2627
-    #[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
2628
-    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
2629
-    pub fn sysconf(name: ::c_int) -> c_long;
2630
-    #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2631
-               link_name = "recvfrom$UNIX2003")]
2632
-    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
2633
-                    flags: ::c_int, addr: *mut sockaddr,
2634
-                    addrlen: *mut socklen_t) -> ::ssize_t;
2635
-    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
2636
-
2637
     #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
2638
     pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
2639
     #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
2640
@@ -805,6 +808,24 @@ extern {
2641
     pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
2642
     #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")]
2643
     pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
2644
+
2645
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")]
2646
+    pub fn sigprocmask(how: ::c_int,
2647
+                       set: *const sigset_t,
2648
+                       oldset: *mut sigset_t)
2649
+                       -> ::c_int;
2650
+    #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
2651
+    pub fn sigpending(set: *mut sigset_t) -> ::c_int;
2652
+
2653
+    #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
2654
+    pub fn timegm(tm: *mut ::tm) -> time_t;
2655
+
2656
+    pub fn getsid(pid: pid_t) -> pid_t;
2657
+
2658
+    pub fn sysconf(name: ::c_int) -> ::c_long;
2659
+
2660
+    pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
2661
+
2662
     #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
2663
                link_name = "pselect$1050")]
2664
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2665
@@ -820,17 +841,15 @@ extern {
2666
                   offset: ::off_t,
2667
                   whence: ::c_int) -> ::c_int;
2668
     pub fn ftello(stream: *mut ::FILE) -> ::off_t;
2669
-    #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
2670
-    pub fn timegm(tm: *mut ::tm) -> time_t;
2671
-    pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
2672
-    pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
2673
     #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2674
                link_name = "tcdrain$UNIX2003")]
2675
     pub fn tcdrain(fd: ::c_int) -> ::c_int;
2676
     pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
2677
     pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
2678
+    pub fn cfmakeraw(termios: *mut ::termios);
2679
     pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
2680
     pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
2681
+    pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
2682
     pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
2683
     pub fn tcsetattr(fd: ::c_int,
2684
                      optional_actions: ::c_int,
2685
@@ -839,10 +858,9 @@ extern {
2686
     pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
2687
     pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
2688
     pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
2689
-    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
2690
     pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
2691
-    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
2692
-    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
2693
+
2694
+    pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
2695
 
2696
     pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
2697
     pub fn closelog();
2698
@@ -859,10 +877,13 @@ extern {
2699
 }
2700
 
2701
 cfg_if! {
2702
-    if #[cfg(any(target_os = "linux",
2703
-                 target_os = "android",
2704
-                 target_os = "emscripten",
2705
-                 target_os = "fuchsia"))] {
2706
+    if #[cfg(target_env = "uclibc")] {
2707
+        mod uclibc;
2708
+        pub use self::uclibc::*;
2709
+    } else if #[cfg(any(target_os = "linux",
2710
+                        target_os = "android",
2711
+                        target_os = "emscripten",
2712
+                        target_os = "fuchsia"))] {
2713
         mod notbsd;
2714
         pub use self::notbsd::*;
2715
     } else if #[cfg(any(target_os = "macos",
2716
diff --git third_party/rust/libc/src/unix/notbsd/android/b32.rs third_party/rust/libc/src/unix/notbsd/android/b32.rs
2717
deleted file mode 100644
2718
index bd69ccf37d57..000000000000
2719
--- third_party/rust/libc/src/unix/notbsd/android/b32.rs
2720
+++ /dev/null
2721
@@ -1,151 +0,0 @@
2722
-pub type c_long = i32;
2723
-pub type c_ulong = u32;
2724
-pub type mode_t = u16;
2725
-pub type off64_t = ::c_longlong;
2726
-
2727
-s! {
2728
-    pub struct sigaction {
2729
-        pub sa_sigaction: ::sighandler_t,
2730
-        pub sa_mask: ::sigset_t,
2731
-        pub sa_flags: ::c_ulong,
2732
-        pub sa_restorer: ::dox::Option<extern fn()>,
2733
-    }
2734
-
2735
-    pub struct stat {
2736
-        pub st_dev: ::c_ulonglong,
2737
-        __pad0: [::c_uchar; 4],
2738
-        __st_ino: ::ino_t,
2739
-        pub st_mode: ::c_uint,
2740
-        pub st_nlink: ::c_uint,
2741
-        pub st_uid: ::uid_t,
2742
-        pub st_gid: ::gid_t,
2743
-        pub st_rdev: ::c_ulonglong,
2744
-        __pad3: [::c_uchar; 4],
2745
-        pub st_size: ::c_longlong,
2746
-        pub st_blksize: ::blksize_t,
2747
-        pub st_blocks: ::c_ulonglong,
2748
-        pub st_atime: ::c_ulong,
2749
-        pub st_atime_nsec: ::c_ulong,
2750
-        pub st_mtime: ::c_ulong,
2751
-        pub st_mtime_nsec: ::c_ulong,
2752
-        pub st_ctime: ::c_ulong,
2753
-        pub st_ctime_nsec: ::c_ulong,
2754
-        pub st_ino: ::c_ulonglong,
2755
-    }
2756
-
2757
-    pub struct stat64 {
2758
-        pub st_dev: ::c_ulonglong,
2759
-        __pad0: [::c_uchar; 4],
2760
-        __st_ino: ::ino_t,
2761
-        pub st_mode: ::c_uint,
2762
-        pub st_nlink: ::c_uint,
2763
-        pub st_uid: ::uid_t,
2764
-        pub st_gid: ::gid_t,
2765
-        pub st_rdev: ::c_ulonglong,
2766
-        __pad3: [::c_uchar; 4],
2767
-        pub st_size: ::c_longlong,
2768
-        pub st_blksize: ::blksize_t,
2769
-        pub st_blocks: ::c_ulonglong,
2770
-        pub st_atime: ::c_ulong,
2771
-        pub st_atime_nsec: ::c_ulong,
2772
-        pub st_mtime: ::c_ulong,
2773
-        pub st_mtime_nsec: ::c_ulong,
2774
-        pub st_ctime: ::c_ulong,
2775
-        pub st_ctime_nsec: ::c_ulong,
2776
-        pub st_ino: ::c_ulonglong,
2777
-    }
2778
-
2779
-    pub struct pthread_attr_t {
2780
-        pub flags: ::uint32_t,
2781
-        pub stack_base: *mut ::c_void,
2782
-        pub stack_size: ::size_t,
2783
-        pub guard_size: ::size_t,
2784
-        pub sched_policy: ::int32_t,
2785
-        pub sched_priority: ::int32_t,
2786
-    }
2787
-
2788
-    pub struct pthread_mutex_t { value: ::c_int }
2789
-
2790
-    pub struct pthread_cond_t { value: ::c_int }
2791
-
2792
-    pub struct pthread_rwlock_t {
2793
-        lock: pthread_mutex_t,
2794
-        cond: pthread_cond_t,
2795
-        numLocks: ::c_int,
2796
-        writerThreadId: ::c_int,
2797
-        pendingReaders: ::c_int,
2798
-        pendingWriters: ::c_int,
2799
-        attr: i32,
2800
-        __reserved: [::c_char; 12],
2801
-    }
2802
-
2803
-    pub struct passwd {
2804
-        pub pw_name: *mut ::c_char,
2805
-        pub pw_passwd: *mut ::c_char,
2806
-        pub pw_uid: ::uid_t,
2807
-        pub pw_gid: ::gid_t,
2808
-        pub pw_dir: *mut ::c_char,
2809
-        pub pw_shell: *mut ::c_char,
2810
-    }
2811
-
2812
-    pub struct statfs {
2813
-        pub f_type: ::uint32_t,
2814
-        pub f_bsize: ::uint32_t,
2815
-        pub f_blocks: ::uint64_t,
2816
-        pub f_bfree: ::uint64_t,
2817
-        pub f_bavail: ::uint64_t,
2818
-        pub f_files: ::uint64_t,
2819
-        pub f_ffree: ::uint64_t,
2820
-        pub f_fsid: ::__fsid_t,
2821
-        pub f_namelen: ::uint32_t,
2822
-        pub f_frsize: ::uint32_t,
2823
-        pub f_flags: ::uint32_t,
2824
-        pub f_spare: [::uint32_t; 4],
2825
-    }
2826
-
2827
-    pub struct sysinfo {
2828
-        pub uptime: ::c_long,
2829
-        pub loads: [::c_ulong; 3],
2830
-        pub totalram: ::c_ulong,
2831
-        pub freeram: ::c_ulong,
2832
-        pub sharedram: ::c_ulong,
2833
-        pub bufferram: ::c_ulong,
2834
-        pub totalswap: ::c_ulong,
2835
-        pub freeswap: ::c_ulong,
2836
-        pub procs: ::c_ushort,
2837
-        pub pad: ::c_ushort,
2838
-        pub totalhigh: ::c_ulong,
2839
-        pub freehigh: ::c_ulong,
2840
-        pub mem_unit: ::c_uint,
2841
-        pub _f: [::c_char; 8],
2842
-    }
2843
-}
2844
-
2845
-pub const SYS_gettid: ::c_long = 224;
2846
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2847
-    value: 0,
2848
-};
2849
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2850
-    value: 0,
2851
-};
2852
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2853
-    lock: PTHREAD_MUTEX_INITIALIZER,
2854
-    cond: PTHREAD_COND_INITIALIZER,
2855
-    numLocks: 0,
2856
-    writerThreadId: 0,
2857
-    pendingReaders: 0,
2858
-    pendingWriters: 0,
2859
-    attr: 0,
2860
-    __reserved: [0; 12],
2861
-};
2862
-pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2;
2863
-pub const CPU_SETSIZE: ::size_t = 32;
2864
-pub const __CPU_BITS: ::size_t = 32;
2865
-
2866
-pub const UT_LINESIZE: usize = 8;
2867
-pub const UT_NAMESIZE: usize = 8;
2868
-pub const UT_HOSTSIZE: usize = 16;
2869
-
2870
-extern {
2871
-    pub fn timegm64(tm: *const ::tm) -> ::time64_t;
2872
-}
2873
diff --git third_party/rust/libc/src/unix/notbsd/android/b32/arm.rs third_party/rust/libc/src/unix/notbsd/android/b32/arm.rs
2874
new file mode 100644
2875
index 000000000000..1c9d033d17db
2876
--- /dev/null
2877
+++ third_party/rust/libc/src/unix/notbsd/android/b32/arm.rs
2878
@@ -0,0 +1,6 @@
2879
+pub type c_char = u8;
2880
+pub type wchar_t = u32;
2881
+
2882
+pub const O_DIRECT: ::c_int = 0x10000;
2883
+pub const O_DIRECTORY: ::c_int = 0x4000;
2884
+pub const O_NOFOLLOW: ::c_int = 0x8000;
2885
diff --git third_party/rust/libc/src/unix/notbsd/android/b32/mod.rs third_party/rust/libc/src/unix/notbsd/android/b32/mod.rs
2886
new file mode 100644
2887
index 000000000000..32f88e4987ba
2888
--- /dev/null
2889
+++ third_party/rust/libc/src/unix/notbsd/android/b32/mod.rs
2890
@@ -0,0 +1,199 @@
2891
+// The following definitions are correct for arm and i686,
2892
+// but may be wrong for mips
2893
+
2894
+pub type c_long = i32;
2895
+pub type c_ulong = u32;
2896
+pub type mode_t = u16;
2897
+pub type off64_t = ::c_longlong;
2898
+pub type sigset_t = ::c_ulong;
2899
+pub type socklen_t = i32;
2900
+pub type time64_t = i64;
2901
+
2902
+s! {
2903
+    pub struct sigaction {
2904
+        pub sa_sigaction: ::sighandler_t,
2905
+        pub sa_mask: ::sigset_t,
2906
+        pub sa_flags: ::c_ulong,
2907
+        pub sa_restorer: ::dox::Option<extern fn()>,
2908
+    }
2909
+
2910
+    pub struct rlimit64 {
2911
+        pub rlim_cur: u64,
2912
+        pub rlim_max: u64,
2913
+    }
2914
+
2915
+    pub struct stat {
2916
+        pub st_dev: ::c_ulonglong,
2917
+        __pad0: [::c_uchar; 4],
2918
+        __st_ino: ::ino_t,
2919
+        pub st_mode: ::c_uint,
2920
+        pub st_nlink: ::c_uint,
2921
+        pub st_uid: ::uid_t,
2922
+        pub st_gid: ::gid_t,
2923
+        pub st_rdev: ::c_ulonglong,
2924
+        __pad3: [::c_uchar; 4],
2925
+        pub st_size: ::c_longlong,
2926
+        pub st_blksize: ::blksize_t,
2927
+        pub st_blocks: ::c_ulonglong,
2928
+        pub st_atime: ::c_ulong,
2929
+        pub st_atime_nsec: ::c_ulong,
2930
+        pub st_mtime: ::c_ulong,
2931
+        pub st_mtime_nsec: ::c_ulong,
2932
+        pub st_ctime: ::c_ulong,
2933
+        pub st_ctime_nsec: ::c_ulong,
2934
+        pub st_ino: ::c_ulonglong,
2935
+    }
2936
+
2937
+    pub struct stat64 {
2938
+        pub st_dev: ::c_ulonglong,
2939
+        __pad0: [::c_uchar; 4],
2940
+        __st_ino: ::ino_t,
2941
+        pub st_mode: ::c_uint,
2942
+        pub st_nlink: ::c_uint,
2943
+        pub st_uid: ::uid_t,
2944
+        pub st_gid: ::gid_t,
2945
+        pub st_rdev: ::c_ulonglong,
2946
+        __pad3: [::c_uchar; 4],
2947
+        pub st_size: ::c_longlong,
2948
+        pub st_blksize: ::blksize_t,
2949
+        pub st_blocks: ::c_ulonglong,
2950
+        pub st_atime: ::c_ulong,
2951
+        pub st_atime_nsec: ::c_ulong,
2952
+        pub st_mtime: ::c_ulong,
2953
+        pub st_mtime_nsec: ::c_ulong,
2954
+        pub st_ctime: ::c_ulong,
2955
+        pub st_ctime_nsec: ::c_ulong,
2956
+        pub st_ino: ::c_ulonglong,
2957
+    }
2958
+
2959
+    pub struct pthread_attr_t {
2960
+        pub flags: ::uint32_t,
2961
+        pub stack_base: *mut ::c_void,
2962
+        pub stack_size: ::size_t,
2963
+        pub guard_size: ::size_t,
2964
+        pub sched_policy: ::int32_t,
2965
+        pub sched_priority: ::int32_t,
2966
+    }
2967
+
2968
+    pub struct pthread_mutex_t { value: ::c_int }
2969
+
2970
+    pub struct pthread_cond_t { value: ::c_int }
2971
+
2972
+    pub struct pthread_rwlock_t {
2973
+        lock: pthread_mutex_t,
2974
+        cond: pthread_cond_t,
2975
+        numLocks: ::c_int,
2976
+        writerThreadId: ::c_int,
2977
+        pendingReaders: ::c_int,
2978
+        pendingWriters: ::c_int,
2979
+        attr: i32,
2980
+        __reserved: [::c_char; 12],
2981
+    }
2982
+
2983
+    pub struct passwd {
2984
+        pub pw_name: *mut ::c_char,
2985
+        pub pw_passwd: *mut ::c_char,
2986
+        pub pw_uid: ::uid_t,
2987
+        pub pw_gid: ::gid_t,
2988
+        pub pw_dir: *mut ::c_char,
2989
+        pub pw_shell: *mut ::c_char,
2990
+    }
2991
+
2992
+    pub struct statfs {
2993
+        pub f_type: ::uint32_t,
2994
+        pub f_bsize: ::uint32_t,
2995
+        pub f_blocks: ::uint64_t,
2996
+        pub f_bfree: ::uint64_t,
2997
+        pub f_bavail: ::uint64_t,
2998
+        pub f_files: ::uint64_t,
2999
+        pub f_ffree: ::uint64_t,
3000
+        pub f_fsid: ::__fsid_t,
3001
+        pub f_namelen: ::uint32_t,
3002
+        pub f_frsize: ::uint32_t,
3003
+        pub f_flags: ::uint32_t,
3004
+        pub f_spare: [::uint32_t; 4],
3005
+    }
3006
+
3007
+    pub struct sysinfo {
3008
+        pub uptime: ::c_long,
3009
+        pub loads: [::c_ulong; 3],
3010
+        pub totalram: ::c_ulong,
3011
+        pub freeram: ::c_ulong,
3012
+        pub sharedram: ::c_ulong,
3013
+        pub bufferram: ::c_ulong,
3014
+        pub totalswap: ::c_ulong,
3015
+        pub freeswap: ::c_ulong,
3016
+        pub procs: ::c_ushort,
3017
+        pub pad: ::c_ushort,
3018
+        pub totalhigh: ::c_ulong,
3019
+        pub freehigh: ::c_ulong,
3020
+        pub mem_unit: ::c_uint,
3021
+        pub _f: [::c_char; 8],
3022
+    }
3023
+}
3024
+
3025
+pub const RTLD_GLOBAL: ::c_int = 2;
3026
+pub const RTLD_NOW: ::c_int = 0;
3027
+pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
3028
+
3029
+pub const PTRACE_GETFPREGS: ::c_int = 14;
3030
+pub const PTRACE_SETFPREGS: ::c_int = 15;
3031
+pub const PTRACE_GETREGS: ::c_int = 12;
3032
+pub const PTRACE_SETREGS: ::c_int = 13;
3033
+
3034
+pub const SYS_gettid: ::c_long = 224;
3035
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
3036
+    value: 0,
3037
+};
3038
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
3039
+    value: 0,
3040
+};
3041
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
3042
+    lock: PTHREAD_MUTEX_INITIALIZER,
3043
+    cond: PTHREAD_COND_INITIALIZER,
3044
+    numLocks: 0,
3045
+    writerThreadId: 0,
3046
+    pendingReaders: 0,
3047
+    pendingWriters: 0,
3048
+    attr: 0,
3049
+    __reserved: [0; 12],
3050
+};
3051
+pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2;
3052
+pub const CPU_SETSIZE: ::size_t = 32;
3053
+pub const __CPU_BITS: ::size_t = 32;
3054
+
3055
+pub const UT_LINESIZE: usize = 8;
3056
+pub const UT_NAMESIZE: usize = 8;
3057
+pub const UT_HOSTSIZE: usize = 16;
3058
+
3059
+extern {
3060
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
3061
+                address_len: socklen_t) -> ::c_int;
3062
+
3063
+    pub fn writev(fd: ::c_int,
3064
+                  iov: *const ::iovec,
3065
+                  iovcnt: ::c_int) -> ::ssize_t;
3066
+    pub fn readv(fd: ::c_int,
3067
+                 iov: *const ::iovec,
3068
+                 iovcnt: ::c_int) -> ::ssize_t;
3069
+
3070
+    pub fn sendmsg(fd: ::c_int,
3071
+                   msg: *const ::msghdr,
3072
+                   flags: ::c_int) -> ::ssize_t;
3073
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
3074
+                   -> ::ssize_t;
3075
+
3076
+    pub fn timegm64(tm: *const ::tm) -> ::time64_t;
3077
+}
3078
+
3079
+cfg_if! {
3080
+    if #[cfg(target_arch = "x86")] {
3081
+        mod x86;
3082
+        pub use self::x86::*;
3083
+    } else if #[cfg(target_arch = "arm")] {
3084
+        mod arm;
3085
+        pub use self::arm::*;
3086
+    } else {
3087
+        // Unknown target_arch
3088
+    }
3089
+}
3090
diff --git third_party/rust/libc/src/unix/notbsd/android/b32/x86.rs third_party/rust/libc/src/unix/notbsd/android/b32/x86.rs
3091
new file mode 100644
3092
index 000000000000..c4b8197de55b
3093
--- /dev/null
3094
+++ third_party/rust/libc/src/unix/notbsd/android/b32/x86.rs
3095
@@ -0,0 +1,6 @@
3096
+pub type c_char = i8;
3097
+pub type wchar_t = i32;
3098
+
3099
+pub const O_DIRECT: ::c_int = 0x4000;
3100
+pub const O_DIRECTORY: ::c_int = 0x10000;
3101
+pub const O_NOFOLLOW: ::c_int = 0x20000;
3102
diff --git third_party/rust/libc/src/unix/notbsd/android/b64.rs third_party/rust/libc/src/unix/notbsd/android/b64.rs
3103
deleted file mode 100644
3104
index b35dde421605..000000000000
3105
--- third_party/rust/libc/src/unix/notbsd/android/b64.rs
3106
+++ /dev/null
3107
@@ -1,161 +0,0 @@
3108
-// The following definitions are correct for aarch64 and may be wrong for x86_64
3109
-
3110
-pub type c_long = i64;
3111
-pub type c_ulong = u64;
3112
-pub type mode_t = u32;
3113
-pub type off64_t = i64;
3114
-
3115
-s! {
3116
-    pub struct sigaction {
3117
-        pub sa_flags: ::c_uint,
3118
-        pub sa_sigaction: ::sighandler_t,
3119
-        pub sa_mask: ::sigset_t,
3120
-        _restorer: *mut ::c_void,
3121
-    }
3122
-
3123
-    pub struct stat {
3124
-        pub st_dev: ::dev_t,
3125
-        pub st_ino: ::ino_t,
3126
-        pub st_mode: ::c_uint,
3127
-        pub st_nlink: ::c_uint,
3128
-        pub st_uid: ::uid_t,
3129
-        pub st_gid: ::gid_t,
3130
-        pub st_rdev: ::dev_t,
3131
-        __pad1: ::c_ulong,
3132
-        pub st_size: ::off64_t,
3133
-        pub st_blksize: ::c_int,
3134
-        __pad2: ::c_int,
3135
-        pub st_blocks: ::c_long,
3136
-        pub st_atime: ::time_t,
3137
-        pub st_atime_nsec: ::c_ulong,
3138
-        pub st_mtime: ::time_t,
3139
-        pub st_mtime_nsec: ::c_ulong,
3140
-        pub st_ctime: ::time_t,
3141
-        pub st_ctime_nsec: ::c_ulong,
3142
-        __unused4: ::c_uint,
3143
-        __unused5: ::c_uint,
3144
-    }
3145
-
3146
-    pub struct stat64 {
3147
-        pub st_dev: ::dev_t,
3148
-        pub st_ino: ::ino_t,
3149
-        pub st_mode: ::c_uint,
3150
-        pub st_nlink: ::c_uint,
3151
-        pub st_uid: ::uid_t,
3152
-        pub st_gid: ::gid_t,
3153
-        pub st_rdev: ::dev_t,
3154
-        __pad1: ::c_ulong,
3155
-        pub st_size: ::off64_t,
3156
-        pub st_blksize: ::c_int,
3157
-        __pad2: ::c_int,
3158
-        pub st_blocks: ::c_long,
3159
-        pub st_atime: ::time_t,
3160
-        pub st_atime_nsec: ::c_ulong,
3161
-        pub st_mtime: ::time_t,
3162
-        pub st_mtime_nsec: ::c_ulong,
3163
-        pub st_ctime: ::time_t,
3164
-        pub st_ctime_nsec: ::c_ulong,
3165
-        __unused4: ::c_uint,
3166
-        __unused5: ::c_uint,
3167
-    }
3168
-
3169
-    pub struct pthread_attr_t {
3170
-        pub flags: ::uint32_t,
3171
-        pub stack_base: *mut ::c_void,
3172
-        pub stack_size: ::size_t,
3173
-        pub guard_size: ::size_t,
3174
-        pub sched_policy: ::int32_t,
3175
-        pub sched_priority: ::int32_t,
3176
-        __reserved: [::c_char; 16],
3177
-    }
3178
-
3179
-    pub struct pthread_mutex_t {
3180
-        value: ::c_int,
3181
-        __reserved: [::c_char; 36],
3182
-    }
3183
-
3184
-    pub struct pthread_cond_t {
3185
-        value: ::c_int,
3186
-        __reserved: [::c_char; 44],
3187
-    }
3188
-
3189
-    pub struct pthread_rwlock_t {
3190
-        numLocks: ::c_int,
3191
-        writerThreadId: ::c_int,
3192
-        pendingReaders: ::c_int,
3193
-        pendingWriters: ::c_int,
3194
-        attr: i32,
3195
-        __reserved: [::c_char; 36],
3196
-    }
3197
-
3198
-    pub struct passwd {
3199
-        pub pw_name: *mut ::c_char,
3200
-        pub pw_passwd: *mut ::c_char,
3201
-        pub pw_uid: ::uid_t,
3202
-        pub pw_gid: ::gid_t,
3203
-        pub pw_gecos: *mut ::c_char,
3204
-        pub pw_dir: *mut ::c_char,
3205
-        pub pw_shell: *mut ::c_char,
3206
-    }
3207
-
3208
-    pub struct statfs {
3209
-        pub f_type: ::uint64_t,
3210
-        pub f_bsize: ::uint64_t,
3211
-        pub f_blocks: ::uint64_t,
3212
-        pub f_bfree: ::uint64_t,
3213
-        pub f_bavail: ::uint64_t,
3214
-        pub f_files: ::uint64_t,
3215
-        pub f_ffree: ::uint64_t,
3216
-        pub f_fsid: ::__fsid_t,
3217
-        pub f_namelen: ::uint64_t,
3218
-        pub f_frsize: ::uint64_t,
3219
-        pub f_flags: ::uint64_t,
3220
-        pub f_spare: [::uint64_t; 4],
3221
-    }
3222
-
3223
-    pub struct sysinfo {
3224
-        pub uptime: ::c_long,
3225
-        pub loads: [::c_ulong; 3],
3226
-        pub totalram: ::c_ulong,
3227
-        pub freeram: ::c_ulong,
3228
-        pub sharedram: ::c_ulong,
3229
-        pub bufferram: ::c_ulong,
3230
-        pub totalswap: ::c_ulong,
3231
-        pub freeswap: ::c_ulong,
3232
-        pub procs: ::c_ushort,
3233
-        pub pad: ::c_ushort,
3234
-        pub totalhigh: ::c_ulong,
3235
-        pub freehigh: ::c_ulong,
3236
-        pub mem_unit: ::c_uint,
3237
-        pub _f: [::c_char; 0],
3238
-    }
3239
-}
3240
-
3241
-pub const SYS_gettid: ::c_long = 178;
3242
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
3243
-    value: 0,
3244
-    __reserved: [0; 36],
3245
-};
3246
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
3247
-    value: 0,
3248
-    __reserved: [0; 44],
3249
-};
3250
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
3251
-    numLocks: 0,
3252
-    writerThreadId: 0,
3253
-    pendingReaders: 0,
3254
-    pendingWriters: 0,
3255
-    attr: 0,
3256
-    __reserved: [0; 36],
3257
-};
3258
-pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 4;
3259
-pub const CPU_SETSIZE: ::size_t = 1024;
3260
-pub const __CPU_BITS: ::size_t = 64;
3261
-
3262
-pub const UT_LINESIZE: usize = 32;
3263
-pub const UT_NAMESIZE: usize = 32;
3264
-pub const UT_HOSTSIZE: usize = 256;
3265
-
3266
-extern {
3267
-    pub fn timegm(tm: *const ::tm) -> ::time64_t;
3268
-}
3269
diff --git third_party/rust/libc/src/unix/notbsd/android/b64/aarch64.rs third_party/rust/libc/src/unix/notbsd/android/b64/aarch64.rs
3270
new file mode 100644
3271
index 000000000000..89c505d06f2e
3272
--- /dev/null
3273
+++ third_party/rust/libc/src/unix/notbsd/android/b64/aarch64.rs
3274
@@ -0,0 +1,56 @@
3275
+pub type c_char = u8;
3276
+pub type wchar_t = u32;
3277
+
3278
+s! {
3279
+    pub struct stat {
3280
+        pub st_dev: ::dev_t,
3281
+        pub st_ino: ::ino_t,
3282
+        pub st_mode: ::c_uint,
3283
+        pub st_nlink: ::c_uint,
3284
+        pub st_uid: ::uid_t,
3285
+        pub st_gid: ::gid_t,
3286
+        pub st_rdev: ::dev_t,
3287
+        __pad1: ::c_ulong,
3288
+        pub st_size: ::off64_t,
3289
+        pub st_blksize: ::c_int,
3290
+        __pad2: ::c_int,
3291
+        pub st_blocks: ::c_long,
3292
+        pub st_atime: ::time_t,
3293
+        pub st_atime_nsec: ::c_ulong,
3294
+        pub st_mtime: ::time_t,
3295
+        pub st_mtime_nsec: ::c_ulong,
3296
+        pub st_ctime: ::time_t,
3297
+        pub st_ctime_nsec: ::c_ulong,
3298
+        __unused4: ::c_uint,
3299
+        __unused5: ::c_uint,
3300
+    }
3301
+
3302
+    pub struct stat64 {
3303
+        pub st_dev: ::dev_t,
3304
+        pub st_ino: ::ino_t,
3305
+        pub st_mode: ::c_uint,
3306
+        pub st_nlink: ::c_uint,
3307
+        pub st_uid: ::uid_t,
3308
+        pub st_gid: ::gid_t,
3309
+        pub st_rdev: ::dev_t,
3310
+        __pad1: ::c_ulong,
3311
+        pub st_size: ::off64_t,
3312
+        pub st_blksize: ::c_int,
3313
+        __pad2: ::c_int,
3314
+        pub st_blocks: ::c_long,
3315
+        pub st_atime: ::time_t,
3316
+        pub st_atime_nsec: ::c_ulong,
3317
+        pub st_mtime: ::time_t,
3318
+        pub st_mtime_nsec: ::c_ulong,
3319
+        pub st_ctime: ::time_t,
3320
+        pub st_ctime_nsec: ::c_ulong,
3321
+        __unused4: ::c_uint,
3322
+        __unused5: ::c_uint,
3323
+    }
3324
+}
3325
+
3326
+pub const O_DIRECT: ::c_int = 0x10000;
3327
+pub const O_DIRECTORY: ::c_int = 0x4000;
3328
+pub const O_NOFOLLOW: ::c_int = 0x8000;
3329
+
3330
+pub const SYS_gettid: ::c_long = 178;
3331
diff --git third_party/rust/libc/src/unix/notbsd/android/b64/mod.rs third_party/rust/libc/src/unix/notbsd/android/b64/mod.rs
3332
new file mode 100644
3333
index 000000000000..98a2f39fbd20
3334
--- /dev/null
3335
+++ third_party/rust/libc/src/unix/notbsd/android/b64/mod.rs
3336
@@ -0,0 +1,162 @@
3337
+// The following definitions are correct for aarch64 and x86_64,
3338
+// but may be wrong for mips64
3339
+
3340
+pub type c_long = i64;
3341
+pub type c_ulong = u64;
3342
+pub type mode_t = u32;
3343
+pub type off64_t = i64;
3344
+pub type socklen_t = u32;
3345
+
3346
+s! {
3347
+    pub struct sigset_t {
3348
+        __val: [::c_ulong; 1],
3349
+    }
3350
+
3351
+    pub struct sigaction {
3352
+        pub sa_flags: ::c_uint,
3353
+        pub sa_sigaction: ::sighandler_t,
3354
+        pub sa_mask: ::sigset_t,
3355
+        pub sa_restorer: ::dox::Option<extern fn()>,
3356
+    }
3357
+
3358
+    pub struct rlimit64 {
3359
+        pub rlim_cur: ::c_ulonglong,
3360
+        pub rlim_max: ::c_ulonglong,
3361
+    }
3362
+
3363
+    pub struct pthread_attr_t {
3364
+        pub flags: ::uint32_t,
3365
+        pub stack_base: *mut ::c_void,
3366
+        pub stack_size: ::size_t,
3367
+        pub guard_size: ::size_t,
3368
+        pub sched_policy: ::int32_t,
3369
+        pub sched_priority: ::int32_t,
3370
+        __reserved: [::c_char; 16],
3371
+    }
3372
+
3373
+    pub struct pthread_mutex_t {
3374
+        value: ::c_int,
3375
+        __reserved: [::c_char; 36],
3376
+    }
3377
+
3378
+    pub struct pthread_cond_t {
3379
+        value: ::c_int,
3380
+        __reserved: [::c_char; 44],
3381
+    }
3382
+
3383
+    pub struct pthread_rwlock_t {
3384
+        numLocks: ::c_int,
3385
+        writerThreadId: ::c_int,
3386
+        pendingReaders: ::c_int,
3387
+        pendingWriters: ::c_int,
3388
+        attr: i32,
3389
+        __reserved: [::c_char; 36],
3390
+    }
3391
+
3392
+    pub struct passwd {
3393
+        pub pw_name: *mut ::c_char,
3394
+        pub pw_passwd: *mut ::c_char,
3395
+        pub pw_uid: ::uid_t,
3396
+        pub pw_gid: ::gid_t,
3397
+        pub pw_gecos: *mut ::c_char,
3398
+        pub pw_dir: *mut ::c_char,
3399
+        pub pw_shell: *mut ::c_char,
3400
+    }
3401
+
3402
+    pub struct statfs {
3403
+        pub f_type: ::uint64_t,
3404
+        pub f_bsize: ::uint64_t,
3405
+        pub f_blocks: ::uint64_t,
3406
+        pub f_bfree: ::uint64_t,
3407
+        pub f_bavail: ::uint64_t,
3408
+        pub f_files: ::uint64_t,
3409
+        pub f_ffree: ::uint64_t,
3410
+        pub f_fsid: ::__fsid_t,
3411
+        pub f_namelen: ::uint64_t,
3412
+        pub f_frsize: ::uint64_t,
3413
+        pub f_flags: ::uint64_t,
3414
+        pub f_spare: [::uint64_t; 4],
3415
+    }
3416
+
3417
+    pub struct sysinfo {
3418
+        pub uptime: ::c_long,
3419
+        pub loads: [::c_ulong; 3],
3420
+        pub totalram: ::c_ulong,
3421
+        pub freeram: ::c_ulong,
3422
+        pub sharedram: ::c_ulong,
3423
+        pub bufferram: ::c_ulong,
3424
+        pub totalswap: ::c_ulong,
3425
+        pub freeswap: ::c_ulong,
3426
+        pub procs: ::c_ushort,
3427
+        pub pad: ::c_ushort,
3428
+        pub totalhigh: ::c_ulong,
3429
+        pub freehigh: ::c_ulong,
3430
+        pub mem_unit: ::c_uint,
3431
+        pub _f: [::c_char; 0],
3432
+    }
3433
+}
3434
+
3435
+pub const RTLD_GLOBAL: ::c_int = 0x00100;
3436
+pub const RTLD_NOW: ::c_int = 2;
3437
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
3438
+
3439
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
3440
+    value: 0,
3441
+    __reserved: [0; 36],
3442
+};
3443
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
3444
+    value: 0,
3445
+    __reserved: [0; 44],
3446
+};
3447
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
3448
+    numLocks: 0,
3449
+    writerThreadId: 0,
3450
+    pendingReaders: 0,
3451
+    pendingWriters: 0,
3452
+    attr: 0,
3453
+    __reserved: [0; 36],
3454
+};
3455
+pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 4;
3456
+pub const CPU_SETSIZE: ::size_t = 1024;
3457
+pub const __CPU_BITS: ::size_t = 64;
3458
+
3459
+pub const UT_LINESIZE: usize = 32;
3460
+pub const UT_NAMESIZE: usize = 32;
3461
+pub const UT_HOSTSIZE: usize = 256;
3462
+
3463
+// Some weirdness in Android
3464
+extern {
3465
+    // address_len should be socklen_t, but it is c_int!
3466
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
3467
+                address_len: ::c_int) -> ::c_int;
3468
+
3469
+    // the return type should be ::ssize_t, but it is c_int!
3470
+    pub fn writev(fd: ::c_int,
3471
+                  iov: *const ::iovec,
3472
+                  iovcnt: ::c_int) -> ::c_int;
3473
+
3474
+    // the return type should be ::ssize_t, but it is c_int!
3475
+    pub fn readv(fd: ::c_int,
3476
+                 iov: *const ::iovec,
3477
+                 iovcnt: ::c_int) -> ::c_int;
3478
+
3479
+    // the return type should be ::ssize_t, but it is c_int!
3480
+    pub fn sendmsg(fd: ::c_int,
3481
+                   msg: *const ::msghdr,
3482
+                   flags: ::c_int) -> ::c_int;
3483
+
3484
+    // the return type should be ::ssize_t, but it is c_int!
3485
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::c_int;
3486
+}
3487
+
3488
+cfg_if! {
3489
+    if #[cfg(target_arch = "x86_64")] {
3490
+        mod x86_64;
3491
+        pub use self::x86_64::*;
3492
+    } else if #[cfg(target_arch = "aarch64")] {
3493
+        mod aarch64;
3494
+        pub use self::aarch64::*;
3495
+    } else {
3496
+        // Unknown target_arch
3497
+    }
3498
+}
3499
diff --git third_party/rust/libc/src/unix/notbsd/android/b64/x86_64.rs third_party/rust/libc/src/unix/notbsd/android/b64/x86_64.rs
3500
new file mode 100644
3501
index 000000000000..58d07e104dba
3502
--- /dev/null
3503
+++ third_party/rust/libc/src/unix/notbsd/android/b64/x86_64.rs
3504
@@ -0,0 +1,50 @@
3505
+pub type c_char = i8;
3506
+pub type wchar_t = i32;
3507
+
3508
+s! {
3509
+    pub struct stat {
3510
+        pub st_dev: ::dev_t,
3511
+        pub st_ino: ::ino_t,
3512
+        pub st_nlink: ::c_ulong,
3513
+        pub st_mode: ::c_uint,
3514
+        pub st_uid: ::uid_t,
3515
+        pub st_gid: ::gid_t,
3516
+        pub st_rdev: ::dev_t,
3517
+        pub st_size: ::off64_t,
3518
+        pub st_blksize: ::c_long,
3519
+        pub st_blocks: ::c_long,
3520
+        pub st_atime: ::c_ulong,
3521
+        pub st_atime_nsec: ::c_ulong,
3522
+        pub st_mtime: ::c_ulong,
3523
+        pub st_mtime_nsec: ::c_ulong,
3524
+        pub st_ctime: ::c_ulong,
3525
+        pub st_ctime_nsec: ::c_ulong,
3526
+        __unused: [::c_long; 3],
3527
+    }
3528
+
3529
+    pub struct stat64 {
3530
+        pub st_dev: ::dev_t,
3531
+        pub st_ino: ::ino_t,
3532
+        pub st_nlink: ::c_ulong,
3533
+        pub st_mode: ::c_uint,
3534
+        pub st_uid: ::uid_t,
3535
+        pub st_gid: ::gid_t,
3536
+        pub st_rdev: ::dev_t,
3537
+        pub st_size: ::off64_t,
3538
+        pub st_blksize: ::c_long,
3539
+        pub st_blocks: ::c_long,
3540
+        pub st_atime: ::c_ulong,
3541
+        pub st_atime_nsec: ::c_ulong,
3542
+        pub st_mtime: ::c_ulong,
3543
+        pub st_mtime_nsec: ::c_ulong,
3544
+        pub st_ctime: ::c_ulong,
3545
+        pub st_ctime_nsec: ::c_ulong,
3546
+        __unused: [::c_long; 3],
3547
+    }
3548
+}
3549
+
3550
+pub const O_DIRECT: ::c_int = 0x4000;
3551
+pub const O_DIRECTORY: ::c_int = 0x10000;
3552
+pub const O_NOFOLLOW: ::c_int = 0x20000;
3553
+
3554
+pub const SYS_gettid: ::c_long = 186;
3555
diff --git third_party/rust/libc/src/unix/notbsd/android/mod.rs third_party/rust/libc/src/unix/notbsd/android/mod.rs
3556
index 4b4e26222ad6..2a7d572dc5cc 100644
3557
--- third_party/rust/libc/src/unix/notbsd/android/mod.rs
3558
+++ third_party/rust/libc/src/unix/notbsd/android/mod.rs
3559
@@ -2,22 +2,17 @@
3560
 
3561
 use dox::mem;
3562
 
3563
-pub type c_char = u8;
3564
 pub type clock_t = ::c_long;
3565
 pub type time_t = ::c_long;
3566
 pub type suseconds_t = ::c_long;
3567
-pub type wchar_t = u32;
3568
 pub type off_t = ::c_long;
3569
 pub type blkcnt_t = ::c_ulong;
3570
 pub type blksize_t = ::c_ulong;
3571
 pub type nlink_t = u32;
3572
 pub type useconds_t = u32;
3573
-pub type socklen_t = i32;
3574
 pub type pthread_t = ::c_long;
3575
 pub type pthread_mutexattr_t = ::c_long;
3576
 pub type pthread_condattr_t = ::c_long;
3577
-pub type sigset_t = ::c_ulong;
3578
-pub type time64_t = i64; // N/A on android
3579
 pub type fsfilcnt_t = ::c_ulong;
3580
 pub type fsblkcnt_t = ::c_ulong;
3581
 pub type nfds_t = ::c_uint;
3582
@@ -44,11 +39,6 @@ s! {
3583
         pub d_name: [::c_char; 256],
3584
     }
3585
 
3586
-    pub struct rlimit64 {
3587
-        pub rlim_cur: u64,
3588
-        pub rlim_max: u64,
3589
-    }
3590
-
3591
     pub struct stack_t {
3592
         pub ss_sp: *mut ::c_void,
3593
         pub ss_flags: ::c_int,
3594
@@ -60,6 +50,7 @@ s! {
3595
         pub si_errno: ::c_int,
3596
         pub si_code: ::c_int,
3597
         pub _pad: [::c_int; 29],
3598
+        _align: [usize; 0],
3599
     }
3600
 
3601
     pub struct __fsid_t {
3602
@@ -68,7 +59,7 @@ s! {
3603
 
3604
     pub struct msghdr {
3605
         pub msg_name: *mut ::c_void,
3606
-        pub msg_namelen: ::c_int,
3607
+        pub msg_namelen: ::socklen_t,
3608
         pub msg_iov: *mut ::iovec,
3609
         pub msg_iovlen: ::size_t,
3610
         pub msg_control: *mut ::c_void,
3611
@@ -108,6 +99,8 @@ s! {
3612
 
3613
     pub struct sem_t {
3614
         count: ::c_uint,
3615
+        #[cfg(target_pointer_width = "64")]
3616
+        __reserved: [::c_int; 3],
3617
     }
3618
 
3619
     pub struct lastlog {
3620
@@ -136,6 +129,22 @@ s! {
3621
         pub ut_addr_v6: [::int32_t; 4],
3622
         unused: [::c_char; 20],
3623
     }
3624
+
3625
+    pub struct statvfs {
3626
+        pub f_bsize: ::c_ulong,
3627
+        pub f_frsize: ::c_ulong,
3628
+        pub f_blocks: ::fsblkcnt_t,
3629
+        pub f_bfree: ::fsblkcnt_t,
3630
+        pub f_bavail: ::fsblkcnt_t,
3631
+        pub f_files: ::fsfilcnt_t,
3632
+        pub f_ffree: ::fsfilcnt_t,
3633
+        pub f_favail: ::fsfilcnt_t,
3634
+        pub f_fsid: ::c_ulong,
3635
+        pub f_flag: ::c_ulong,
3636
+        pub f_namemax: ::c_ulong,
3637
+        #[cfg(target_pointer_width = "64")]
3638
+        __f_reserved: [u32; 6],
3639
+    }
3640
 }
3641
 
3642
 pub const O_TRUNC: ::c_int = 512;
3643
@@ -163,6 +172,7 @@ pub const SA_RESTART: ::c_int = 0x10000000;
3644
 pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
3645
 
3646
 pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
3647
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
3648
 
3649
 pub const EFD_CLOEXEC: ::c_int = 0x80000;
3650
 
3651
@@ -408,6 +418,18 @@ pub const SOCK_DGRAM: ::c_int = 2;
3652
 pub const SOCK_SEQPACKET: ::c_int = 5;
3653
 
3654
 pub const SOL_SOCKET: ::c_int = 1;
3655
+pub const SOL_UDP: ::c_int = 17;
3656
+pub const SOL_SCTP: ::c_int = 132;
3657
+pub const SOL_IPX: ::c_int = 256;
3658
+pub const SOL_AX25: ::c_int = 257;
3659
+pub const SOL_ATALK: ::c_int = 258;
3660
+pub const SOL_NETROM: ::c_int = 259;
3661
+pub const SOL_ROSE: ::c_int = 260;
3662
+
3663
+#[doc(hidden)]
3664
+pub const AF_MAX: ::c_int = 39;
3665
+#[doc(hidden)]
3666
+pub const PF_MAX: ::c_int = AF_MAX;
3667
 
3668
 pub const SO_REUSEADDR: ::c_int = 2;
3669
 pub const SO_TYPE: ::c_int = 3;
3670
@@ -433,9 +455,6 @@ pub const O_EXCL: ::c_int = 128;
3671
 pub const O_NOCTTY: ::c_int = 256;
3672
 pub const O_NONBLOCK: ::c_int = 2048;
3673
 pub const O_SYNC: ::c_int = 0x101000;
3674
-pub const O_DIRECT: ::c_int = 0x10000;
3675
-pub const O_DIRECTORY: ::c_int = 0x4000;
3676
-pub const O_NOFOLLOW: ::c_int = 0x8000;
3677
 pub const O_ASYNC: ::c_int = 0x2000;
3678
 pub const O_NDELAY: ::c_int = 0x800;
3679
 
3680
@@ -446,7 +465,6 @@ pub const TCSBRKP: ::c_int = 0x5425;
3681
 pub const TCSANOW: ::c_int = 0;
3682
 pub const TCSADRAIN: ::c_int = 0x1;
3683
 pub const TCSAFLUSH: ::c_int = 0x2;
3684
-pub const IUTF8: ::tcflag_t = 0x00004000;
3685
 pub const VEOF: usize = 4;
3686
 pub const VEOL: usize = 11;
3687
 pub const VEOL2: usize = 16;
3688
@@ -503,10 +521,6 @@ pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
3689
 pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
3690
 pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
3691
 pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
3692
-pub const PTRACE_GETFPREGS: ::c_int = 14;
3693
-pub const PTRACE_SETFPREGS: ::c_int = 15;
3694
-pub const PTRACE_GETREGS: ::c_int = 12;
3695
-pub const PTRACE_SETREGS: ::c_int = 13;
3696
 
3697
 pub const EFD_NONBLOCK: ::c_int = 0x800;
3698
 
3699
@@ -548,10 +562,7 @@ pub const TIOCMSET: ::c_int = 0x5418;
3700
 pub const FIONREAD: ::c_int = 0x541B;
3701
 pub const TIOCCONS: ::c_int = 0x541D;
3702
 
3703
-pub const RTLD_GLOBAL: ::c_int = 0x2;
3704
 pub const RTLD_NOLOAD: ::c_int = 0x4;
3705
-pub const RTLD_NOW: ::c_int = 0;
3706
-pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
3707
 
3708
 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
3709
 
3710
@@ -574,6 +585,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
3711
 pub const MCL_FUTURE: ::c_int = 0x0002;
3712
 
3713
 pub const SIGSTKSZ: ::size_t = 8192;
3714
+pub const MINSIGSTKSZ: ::size_t = 2048;
3715
 pub const CBAUD: ::tcflag_t = 0o0010017;
3716
 pub const TAB1: ::c_int = 0x00000800;
3717
 pub const TAB2: ::c_int = 0x00001000;
3718
@@ -615,6 +627,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
3719
 pub const PENDIN: ::tcflag_t = 0x00004000;
3720
 pub const NOFLSH: ::tcflag_t = 0x00000080;
3721
 
3722
+pub const B0: ::speed_t = 0o000000;
3723
+pub const B50: ::speed_t = 0o000001;
3724
+pub const B75: ::speed_t = 0o000002;
3725
+pub const B110: ::speed_t = 0o000003;
3726
+pub const B134: ::speed_t = 0o000004;
3727
+pub const B150: ::speed_t = 0o000005;
3728
+pub const B200: ::speed_t = 0o000006;
3729
+pub const B300: ::speed_t = 0o000007;
3730
+pub const B600: ::speed_t = 0o000010;
3731
+pub const B1200: ::speed_t = 0o000011;
3732
+pub const B1800: ::speed_t = 0o000012;
3733
+pub const B2400: ::speed_t = 0o000013;
3734
+pub const B4800: ::speed_t = 0o000014;
3735
+pub const B9600: ::speed_t = 0o000015;
3736
+pub const B19200: ::speed_t = 0o000016;
3737
+pub const B38400: ::speed_t = 0o000017;
3738
+pub const EXTA: ::speed_t = B19200;
3739
+pub const EXTB: ::speed_t = B38400;
3740
+pub const B57600: ::speed_t = 0o010001;
3741
+pub const B115200: ::speed_t = 0o010002;
3742
+pub const B230400: ::speed_t = 0o010003;
3743
+pub const B460800: ::speed_t = 0o010004;
3744
+pub const B500000: ::speed_t = 0o010005;
3745
+pub const B576000: ::speed_t = 0o010006;
3746
+pub const B921600: ::speed_t = 0o010007;
3747
+pub const B1000000: ::speed_t = 0o010010;
3748
+pub const B1152000: ::speed_t = 0o010011;
3749
+pub const B1500000: ::speed_t = 0o010012;
3750
+pub const B2000000: ::speed_t = 0o010013;
3751
+pub const B2500000: ::speed_t = 0o010014;
3752
+pub const B3000000: ::speed_t = 0o010015;
3753
+pub const B3500000: ::speed_t = 0o010016;
3754
+pub const B4000000: ::speed_t = 0o010017;
3755
+
3756
 pub const EAI_SYSTEM: ::c_int = 11;
3757
 
3758
 pub const NETLINK_ROUTE: ::c_int = 0;
3759
@@ -679,59 +725,6 @@ pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
3760
 pub const SIGEV_THREAD_ID: ::c_int = 4;
3761
 
3762
 f! {
3763
-    pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
3764
-        *set = 0;
3765
-        return 0
3766
-    }
3767
-    pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int {
3768
-        *set |= signum as sigset_t;
3769
-        return 0
3770
-    }
3771
-    pub fn sigfillset(set: *mut sigset_t) -> ::c_int {
3772
-        *set = !0;
3773
-        return 0
3774
-    }
3775
-    pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int {
3776
-        *set &= !(signum as sigset_t);
3777
-        return 0
3778
-    }
3779
-    pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int {
3780
-        (*set & (signum as sigset_t)) as ::c_int
3781
-    }
3782
-    pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t {
3783
-        (*termios).c_cflag & ::CBAUD
3784
-    }
3785
-    pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t {
3786
-        (*termios).c_cflag & ::CBAUD
3787
-    }
3788
-    pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
3789
-        let cbaud = ::CBAUD;
3790
-        (*termios).c_cflag = ((*termios).c_cflag & !cbaud) | (speed & cbaud);
3791
-        return 0
3792
-    }
3793
-    pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
3794
-        let cbaud = ::CBAUD;
3795
-        (*termios).c_cflag = ((*termios).c_cflag & !cbaud) | (speed & cbaud);
3796
-        return 0
3797
-    }
3798
-    pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int {
3799
-        ioctl(fd, ::TCGETS, termios)
3800
-    }
3801
-    pub fn tcsetattr(fd: ::c_int,
3802
-                     optional_actions: ::c_int,
3803
-                     termios: *const ::termios) -> ::c_int {
3804
-        ioctl(fd, optional_actions, termios)
3805
-    }
3806
-    pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int {
3807
-        ioctl(fd, ::TCXONC, action as *mut ::c_void)
3808
-    }
3809
-    pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int {
3810
-        ioctl(fd, ::TCFLSH, action as *mut ::c_void)
3811
-    }
3812
-    pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int {
3813
-        ioctl(fd, TCSBRKP, duration as *mut ::c_void)
3814
-    }
3815
-
3816
     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
3817
         for slot in cpuset.__bits.iter_mut() {
3818
             *slot = 0;
3819
@@ -761,6 +754,17 @@ f! {
3820
     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
3821
         set1.__bits == set2.__bits
3822
     }
3823
+    pub fn major(dev: ::dev_t) -> ::c_int {
3824
+        ((dev >> 8) & 0xfff) as ::c_int
3825
+    }
3826
+    pub fn minor(dev: ::dev_t) -> ::c_int {
3827
+        ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int
3828
+    }
3829
+    pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t {
3830
+        let ma = ma as ::dev_t;
3831
+        let mi = mi as ::dev_t;
3832
+        ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12)
3833
+    }
3834
 }
3835
 
3836
 extern {
3837
@@ -771,15 +775,10 @@ extern {
3838
     pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
3839
                    -> ::c_int;
3840
     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
3841
-    pub fn readlink(path: *const ::c_char,
3842
-                    buf: *mut ::c_char,
3843
-                    bufsz: ::size_t)
3844
-                    -> ::c_int;
3845
     pub fn msync(addr: *const ::c_void, len: ::size_t,
3846
                  flags: ::c_int) -> ::c_int;
3847
     pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
3848
                     -> ::c_int;
3849
-    pub fn sysconf(name: ::c_int) -> ::c_long;
3850
     pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
3851
                     flags: ::c_int, addr: *const ::sockaddr,
3852
                     addrlen: *mut ::socklen_t) -> ::ssize_t;
3853
@@ -801,6 +800,9 @@ extern {
3854
     pub fn utmpname(name: *const ::c_char) -> ::c_int;
3855
     pub fn setutent();
3856
     pub fn getutent() -> *mut utmp;
3857
+
3858
+    pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
3859
+                           len: ::off_t) -> ::c_int;
3860
 }
3861
 
3862
 cfg_if! {
3863
diff --git third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs
3864
index 22bb33b7231f..59c2486efefe 100644
3865
--- third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs
3866
+++ third_party/rust/libc/src/unix/notbsd/linux/mips/mips32.rs
3867
@@ -10,9 +10,6 @@ pub type ino_t = u32;
3868
 pub type blkcnt_t = i32;
3869
 pub type blksize_t = i32;
3870
 pub type nlink_t = u32;
3871
-pub type fsblkcnt_t = ::c_ulong;
3872
-pub type fsfilcnt_t = ::c_ulong;
3873
-pub type rlim_t = c_ulong;
3874
 
3875
 s! {
3876
     pub struct aiocb {
3877
@@ -86,7 +83,7 @@ s! {
3878
         pub sa_flags: ::c_int,
3879
         pub sa_sigaction: ::sighandler_t,
3880
         pub sa_mask: sigset_t,
3881
-        _restorer: *mut ::c_void,
3882
+        pub sa_restorer: ::dox::Option<extern fn()>,
3883
         _resv: [::c_int; 1],
3884
     }
3885
 
3886
@@ -107,19 +104,6 @@ s! {
3887
         pub _pad: [::c_int; 29],
3888
     }
3889
 
3890
-    pub struct glob64_t {
3891
-        pub gl_pathc: ::size_t,
3892
-        pub gl_pathv: *mut *mut ::c_char,
3893
-        pub gl_offs: ::size_t,
3894
-        pub gl_flags: ::c_int,
3895
-
3896
-        __unused1: *mut ::c_void,
3897
-        __unused2: *mut ::c_void,
3898
-        __unused3: *mut ::c_void,
3899
-        __unused4: *mut ::c_void,
3900
-        __unused5: *mut ::c_void,
3901
-    }
3902
-
3903
     pub struct ipc_perm {
3904
         pub __key: ::key_t,
3905
         pub uid: ::uid_t,
3906
@@ -238,15 +222,6 @@ s! {
3907
         pub mem_unit: ::c_uint,
3908
         pub _f: [::c_char; 8],
3909
     }
3910
-
3911
-    // FIXME this is actually a union
3912
-    pub struct sem_t {
3913
-        #[cfg(target_pointer_width = "32")]
3914
-        __size: [::c_char; 16],
3915
-        #[cfg(target_pointer_width = "64")]
3916
-        __size: [::c_char; 32],
3917
-        __align: [::c_long; 0],
3918
-    }
3919
 }
3920
 
3921
 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
3922
@@ -257,31 +232,3 @@ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
3923
 pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
3924
 
3925
 pub const SYS_gettid: ::c_long = 4222;   // Valid for O32
3926
-
3927
-#[link(name = "util")]
3928
-extern {
3929
-    pub fn sysctl(name: *mut ::c_int,
3930
-                  namelen: ::c_int,
3931
-                  oldp: *mut ::c_void,
3932
-                  oldlenp: *mut ::size_t,
3933
-                  newp: *mut ::c_void,
3934
-                  newlen: ::size_t)
3935
-                  -> ::c_int;
3936
-    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
3937
-    pub fn backtrace(buf: *mut *mut ::c_void,
3938
-                     sz: ::c_int) -> ::c_int;
3939
-    pub fn glob64(pattern: *const ::c_char,
3940
-                  flags: ::c_int,
3941
-                  errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
3942
-                                                   errno: ::c_int)
3943
-                                                   -> ::c_int>,
3944
-                  pglob: *mut glob64_t) -> ::c_int;
3945
-    pub fn globfree64(pglob: *mut glob64_t);
3946
-    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
3947
-    pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
3948
-                                       cpusetsize: ::size_t,
3949
-                                       cpuset: *mut ::cpu_set_t) -> ::c_int;
3950
-    pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
3951
-                                       cpusetsize: ::size_t,
3952
-                                       cpuset: *const ::cpu_set_t) -> ::c_int;
3953
-}
3954
diff --git third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs
3955
index 947859998d33..1f28ea81f003 100644
3956
--- third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs
3957
+++ third_party/rust/libc/src/unix/notbsd/linux/mips/mips64.rs
3958
@@ -3,15 +3,13 @@ pub type blksize_t = i64;
3959
 pub type c_char = i8;
3960
 pub type c_long = i64;
3961
 pub type c_ulong = u64;
3962
-pub type fsblkcnt_t = ::c_ulong;
3963
-pub type fsfilcnt_t = ::c_ulong;
3964
 pub type ino_t = u64;
3965
 pub type nlink_t = u64;
3966
 pub type off_t = i64;
3967
-pub type rlim_t = ::c_ulong;
3968
 pub type suseconds_t = i64;
3969
 pub type time_t = i64;
3970
 pub type wchar_t = i32;
3971
+pub type clock_t = i64;
3972
 
3973
 s! {
3974
     pub struct aiocb {
3975
@@ -85,7 +83,7 @@ s! {
3976
         pub sa_flags: ::c_int,
3977
         pub sa_sigaction: ::sighandler_t,
3978
         pub sa_mask: sigset_t,
3979
-        _restorer: *mut ::c_void,
3980
+        pub sa_restorer: ::dox::Option<extern fn()>,
3981
     }
3982
 
3983
     pub struct stack_t {
3984
@@ -186,6 +184,14 @@ s! {
3985
         pub c_cc: [::cc_t; ::NCCS],
3986
     }
3987
 
3988
+    pub struct flock {
3989
+        pub l_type: ::c_short,
3990
+        pub l_whence: ::c_short,
3991
+        pub l_start: ::off_t,
3992
+        pub l_len: ::off_t,
3993
+        pub l_pid: ::pid_t,
3994
+    }
3995
+
3996
     pub struct sysinfo {
3997
         pub uptime: ::c_long,
3998
         pub loads: [::c_ulong; 3],
3999
@@ -202,12 +208,6 @@ s! {
4000
         pub mem_unit: ::c_uint,
4001
         pub _f: [::c_char; 0],
4002
     }
4003
-
4004
-    // FIXME this is actually a union
4005
-    pub struct sem_t {
4006
-        __size: [::c_char; 32],
4007
-        __align: [::c_long; 0],
4008
-    }
4009
 }
4010
 
4011
 pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
4012
@@ -218,8 +218,3 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
4013
 pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
4014
 
4015
 pub const SYS_gettid: ::c_long = 5178;   // Valid for n64
4016
-
4017
-#[link(name = "util")]
4018
-extern {
4019
-    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
4020
-}
4021
diff --git third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs
4022
index 48e773088e79..b2ad107caedf 100644
4023
--- third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs
4024
+++ third_party/rust/libc/src/unix/notbsd/linux/mips/mod.rs
4025
@@ -1,3 +1,32 @@
4026
+pub type fsblkcnt_t = ::c_ulong;
4027
+pub type fsfilcnt_t = ::c_ulong;
4028
+pub type rlim_t = c_ulong;
4029
+pub type __priority_which_t = ::c_uint;
4030
+
4031
+s! {
4032
+    pub struct glob64_t {
4033
+        pub gl_pathc: ::size_t,
4034
+        pub gl_pathv: *mut *mut ::c_char,
4035
+        pub gl_offs: ::size_t,
4036
+        pub gl_flags: ::c_int,
4037
+
4038
+        __unused1: *mut ::c_void,
4039
+        __unused2: *mut ::c_void,
4040
+        __unused3: *mut ::c_void,
4041
+        __unused4: *mut ::c_void,
4042
+        __unused5: *mut ::c_void,
4043
+    }
4044
+
4045
+    // FIXME this is actually a union
4046
+    pub struct sem_t {
4047
+        #[cfg(target_pointer_width = "32")]
4048
+        __size: [::c_char; 16],
4049
+        #[cfg(target_pointer_width = "64")]
4050
+        __size: [::c_char; 32],
4051
+        __align: [::c_long; 0],
4052
+    }
4053
+}
4054
+
4055
 pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
4056
 
4057
 pub const SFD_CLOEXEC: ::c_int = 0x080000;
4058
@@ -194,22 +223,62 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
4059
 
4060
 pub const SOL_SOCKET: ::c_int = 0xffff;
4061
 
4062
-pub const SO_REUSEADDR: ::c_int = 4;
4063
-pub const SO_REUSEPORT: ::c_int = 0x200;
4064
-pub const SO_TYPE: ::c_int = 4104;
4065
-pub const SO_ERROR: ::c_int = 4103;
4066
-pub const SO_DONTROUTE: ::c_int = 16;
4067
-pub const SO_BROADCAST: ::c_int = 32;
4068
-pub const SO_SNDBUF: ::c_int = 4097;
4069
-pub const SO_RCVBUF: ::c_int = 4098;
4070
-pub const SO_KEEPALIVE: ::c_int = 8;
4071
-pub const SO_OOBINLINE: ::c_int = 256;
4072
-pub const SO_LINGER: ::c_int = 128;
4073
-pub const SO_RCVLOWAT: ::c_int = 4100;
4074
-pub const SO_SNDLOWAT: ::c_int = 4099;
4075
-pub const SO_RCVTIMEO: ::c_int = 4102;
4076
-pub const SO_SNDTIMEO: ::c_int = 4101;
4077
-pub const SO_ACCEPTCONN: ::c_int = 4105;
4078
+pub const SO_REUSEADDR: ::c_int = 0x0004;
4079
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
4080
+pub const SO_DONTROUTE: ::c_int = 0x0010;
4081
+pub const SO_BROADCAST: ::c_int = 0x0020;
4082
+pub const SO_LINGER: ::c_int = 0x0080;
4083
+pub const SO_OOBINLINE: ::c_int = 0x0100;
4084
+pub const SO_REUSEPORT: ::c_int = 0x0200;
4085
+pub const SO_TYPE: ::c_int = 0x1008;
4086
+pub const SO_STYLE: ::c_int = SO_TYPE;
4087
+pub const SO_ERROR: ::c_int = 0x1007;
4088
+pub const SO_SNDBUF: ::c_int = 0x1001;
4089
+pub const SO_RCVBUF: ::c_int = 0x1002;
4090
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
4091
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
4092
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
4093
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
4094
+pub const SO_ACCEPTCONN: ::c_int = 0x1009;
4095
+pub const SO_PROTOCOL: ::c_int = 0x1028;
4096
+pub const SO_DOMAIN: ::c_int = 0x1029;
4097
+pub const SO_NO_CHECK: ::c_int = 11;
4098
+pub const SO_PRIORITY: ::c_int = 12;
4099
+pub const SO_BSDCOMPAT: ::c_int = 14;
4100
+pub const SO_PASSCRED: ::c_int = 17;
4101
+pub const SO_PEERCRED: ::c_int = 18;
4102
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
4103
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
4104
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
4105
+pub const SO_BINDTODEVICE: ::c_int = 25;
4106
+pub const SO_ATTACH_FILTER: ::c_int = 26;
4107
+pub const SO_DETACH_FILTER: ::c_int = 27;
4108
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
4109
+pub const SO_PEERNAME: ::c_int = 28;
4110
+pub const SO_TIMESTAMP: ::c_int = 29;
4111
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
4112
+pub const SO_PEERSEC: ::c_int = 30;
4113
+pub const SO_SNDBUFFORCE: ::c_int = 31;
4114
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4115
+pub const SO_PASSSEC: ::c_int = 34;
4116
+pub const SO_TIMESTAMPNS: ::c_int = 35;
4117
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
4118
+pub const SO_MARK: ::c_int = 36;
4119
+pub const SO_TIMESTAMPING: ::c_int = 37;
4120
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
4121
+pub const SO_RXQ_OVFL: ::c_int = 40;
4122
+pub const SO_WIFI_STATUS: ::c_int = 41;
4123
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
4124
+pub const SO_PEEK_OFF: ::c_int = 42;
4125
+pub const SO_NOFCS: ::c_int = 43;
4126
+pub const SO_LOCK_FILTER: ::c_int = 44;
4127
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
4128
+pub const SO_BUSY_POLL: ::c_int = 46;
4129
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
4130
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
4131
+pub const SO_INCOMING_CPU: ::c_int = 49;
4132
+pub const SO_ATTACH_BPF: ::c_int = 50;
4133
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
4134
 
4135
 pub const FIOCLEX: ::c_ulong = 0x6601;
4136
 pub const FIONBIO: ::c_ulong = 0x667e;
4137
@@ -282,7 +351,7 @@ pub const VMIN: usize = 4;
4138
 pub const IEXTEN: ::tcflag_t = 0x00000100;
4139
 pub const TOSTOP: ::tcflag_t = 0x00008000;
4140
 pub const FLUSHO: ::tcflag_t = 0x00002000;
4141
-pub const IUTF8: ::tcflag_t = 0x00004000;
4142
+pub const EXTPROC: ::tcflag_t = 0o200000;
4143
 pub const TCSANOW: ::c_int = 0x540e;
4144
 pub const TCSADRAIN: ::c_int = 0x540f;
4145
 pub const TCSAFLUSH: ::c_int = 0x5410;
4146
@@ -380,6 +449,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
4147
 pub const MCL_FUTURE: ::c_int = 0x0002;
4148
 
4149
 pub const SIGSTKSZ: ::size_t = 8192;
4150
+pub const MINSIGSTKSZ: ::size_t = 2048;
4151
 pub const CBAUD: ::tcflag_t = 0o0010017;
4152
 pub const TAB1: ::c_int = 0x00000800;
4153
 pub const TAB2: ::c_int = 0x00001000;
4154
@@ -421,6 +491,78 @@ pub const ICANON: ::tcflag_t = 0x00000002;
4155
 pub const PENDIN: ::tcflag_t = 0x00004000;
4156
 pub const NOFLSH: ::tcflag_t = 0x00000080;
4157
 
4158
+pub const B0: ::speed_t = 0o000000;
4159
+pub const B50: ::speed_t = 0o000001;
4160
+pub const B75: ::speed_t = 0o000002;
4161
+pub const B110: ::speed_t = 0o000003;
4162
+pub const B134: ::speed_t = 0o000004;
4163
+pub const B150: ::speed_t = 0o000005;
4164
+pub const B200: ::speed_t = 0o000006;
4165
+pub const B300: ::speed_t = 0o000007;
4166
+pub const B600: ::speed_t = 0o000010;
4167
+pub const B1200: ::speed_t = 0o000011;
4168
+pub const B1800: ::speed_t = 0o000012;
4169
+pub const B2400: ::speed_t = 0o000013;
4170
+pub const B4800: ::speed_t = 0o000014;
4171
+pub const B9600: ::speed_t = 0o000015;
4172
+pub const B19200: ::speed_t = 0o000016;
4173
+pub const B38400: ::speed_t = 0o000017;
4174
+pub const EXTA: ::speed_t = B19200;
4175
+pub const EXTB: ::speed_t = B38400;
4176
+pub const B57600: ::speed_t = 0o010001;
4177
+pub const B115200: ::speed_t = 0o010002;
4178
+pub const B230400: ::speed_t = 0o010003;
4179
+pub const B460800: ::speed_t = 0o010004;
4180
+pub const B500000: ::speed_t = 0o010005;
4181
+pub const B576000: ::speed_t = 0o010006;
4182
+pub const B921600: ::speed_t = 0o010007;
4183
+pub const B1000000: ::speed_t = 0o010010;
4184
+pub const B1152000: ::speed_t = 0o010011;
4185
+pub const B1500000: ::speed_t = 0o010012;
4186
+pub const B2000000: ::speed_t = 0o010013;
4187
+pub const B2500000: ::speed_t = 0o010014;
4188
+pub const B3000000: ::speed_t = 0o010015;
4189
+pub const B3500000: ::speed_t = 0o010016;
4190
+pub const B4000000: ::speed_t = 0o010017;
4191
+
4192
+#[link(name = "util")]
4193
+extern {
4194
+    pub fn sysctl(name: *mut ::c_int,
4195
+                  namelen: ::c_int,
4196
+                  oldp: *mut ::c_void,
4197
+                  oldlenp: *mut ::size_t,
4198
+                  newp: *mut ::c_void,
4199
+                  newlen: ::size_t)
4200
+                  -> ::c_int;
4201
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
4202
+    pub fn backtrace(buf: *mut *mut ::c_void,
4203
+                     sz: ::c_int) -> ::c_int;
4204
+    pub fn glob64(pattern: *const ::c_char,
4205
+                  flags: ::c_int,
4206
+                  errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
4207
+                                                   errno: ::c_int)
4208
+                                                   -> ::c_int>,
4209
+                  pglob: *mut glob64_t) -> ::c_int;
4210
+    pub fn globfree64(pglob: *mut glob64_t);
4211
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
4212
+    pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
4213
+                                       cpusetsize: ::size_t,
4214
+                                       cpuset: *mut ::cpu_set_t) -> ::c_int;
4215
+    pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
4216
+                                       cpusetsize: ::size_t,
4217
+                                       cpuset: *const ::cpu_set_t) -> ::c_int;
4218
+    pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
4219
+    pub fn setpriority(which: ::__priority_which_t, who: ::id_t,
4220
+                                       prio: ::c_int) -> ::c_int;
4221
+    pub fn pthread_getaffinity_np(thread: ::pthread_t,
4222
+                                  cpusetsize: ::size_t,
4223
+                                  cpuset: *mut ::cpu_set_t) -> ::c_int;
4224
+    pub fn pthread_setaffinity_np(thread: ::pthread_t,
4225
+                                  cpusetsize: ::size_t,
4226
+                                  cpuset: *const ::cpu_set_t) -> ::c_int;
4227
+    pub fn sched_getcpu() -> ::c_int;
4228
+}
4229
+
4230
 cfg_if! {
4231
     if #[cfg(target_arch = "mips")] {
4232
         mod mips32;
4233
diff --git third_party/rust/libc/src/unix/notbsd/linux/mod.rs third_party/rust/libc/src/unix/notbsd/linux/mod.rs
4234
index 13b61df2cde0..7404f2ce43af 100644
4235
--- third_party/rust/libc/src/unix/notbsd/linux/mod.rs
4236
+++ third_party/rust/libc/src/unix/notbsd/linux/mod.rs
4237
@@ -1,6 +1,6 @@
4238
 //! Linux-specific definitions for linux-like values
4239
 
4240
-use dox::mem;
4241
+use dox::{mem, Option};
4242
 
4243
 pub type useconds_t = u32;
4244
 pub type dev_t = u64;
4245
@@ -220,6 +220,17 @@ s! {
4246
         pub msgtql: ::c_int,
4247
         pub msgseg: ::c_ushort,
4248
     }
4249
+
4250
+    pub struct mmsghdr {
4251
+        pub msg_hdr: ::msghdr,
4252
+        pub msg_len: ::c_uint,
4253
+    }
4254
+
4255
+    pub struct sembuf {
4256
+        pub sem_num: ::c_ushort,
4257
+        pub sem_op: ::c_short,
4258
+        pub sem_flg: ::c_short,
4259
+    }
4260
 }
4261
 
4262
 pub const ABDAY_1: ::nl_item = 0x20000;
4263
@@ -373,6 +384,7 @@ pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
4264
 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
4265
 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
4266
 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
4267
+pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
4268
 pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
4269
 pub const _SC_ATEXIT_MAX: ::c_int = 87;
4270
 pub const _SC_XOPEN_VERSION: ::c_int = 89;
4271
@@ -463,6 +475,19 @@ pub const SCHED_RR: ::c_int = 2;
4272
 pub const SCHED_BATCH: ::c_int = 3;
4273
 pub const SCHED_IDLE: ::c_int = 5;
4274
 
4275
+pub const AF_IB: ::c_int = 27;
4276
+pub const AF_MPLS: ::c_int = 28;
4277
+pub const AF_NFC: ::c_int = 39;
4278
+pub const AF_VSOCK: ::c_int = 40;
4279
+#[doc(hidden)]
4280
+pub const AF_MAX: ::c_int = 42;
4281
+pub const PF_IB: ::c_int = AF_IB;
4282
+pub const PF_MPLS: ::c_int = AF_MPLS;
4283
+pub const PF_NFC: ::c_int = AF_NFC;
4284
+pub const PF_VSOCK: ::c_int = AF_VSOCK;
4285
+#[doc(hidden)]
4286
+pub const PF_MAX: ::c_int = AF_MAX;
4287
+
4288
 // System V IPC
4289
 pub const IPC_PRIVATE: ::key_t = 0;
4290
 
4291
@@ -496,6 +521,7 @@ pub const SHM_HUGETLB: ::c_int = 0o4000;
4292
 pub const SHM_NORESERVE: ::c_int = 0o10000;
4293
 
4294
 pub const EPOLLRDHUP: ::c_int = 0x2000;
4295
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
4296
 pub const EPOLLONESHOT: ::c_int = 0x40000000;
4297
 
4298
 pub const QFMT_VFS_OLD: ::c_int = 1;
4299
@@ -678,6 +704,18 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
4300
 pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
4301
 pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
4302
 
4303
+pub const ITIMER_REAL: ::c_int = 0;
4304
+pub const ITIMER_VIRTUAL: ::c_int = 1;
4305
+pub const ITIMER_PROF: ::c_int = 2;
4306
+
4307
+pub const XATTR_CREATE: ::c_int = 0x1;
4308
+pub const XATTR_REPLACE: ::c_int = 0x2;
4309
+
4310
+// On Linux, libc doesn't define this constant, libattr does instead.
4311
+// We still define it for Linux as it's defined by libc on other platforms,
4312
+// and it's mentioned in the man pages for getxattr and setxattr.
4313
+pub const ENOATTR: ::c_int = ::ENODATA;
4314
+
4315
 f! {
4316
     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
4317
         for slot in cpuset.bits.iter_mut() {
4318
@@ -708,6 +746,31 @@ f! {
4319
     pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
4320
         set1.bits == set2.bits
4321
     }
4322
+
4323
+    pub fn major(dev: ::dev_t) -> ::c_uint {
4324
+        let mut major = 0;
4325
+        major |= (dev & 0x00000000000fff00) >> 8;
4326
+        major |= (dev & 0xfffff00000000000) >> 32;
4327
+        major as ::c_uint
4328
+    }
4329
+
4330
+    pub fn minor(dev: ::dev_t) -> ::c_uint {
4331
+        let mut minor = 0;
4332
+        minor |= (dev & 0xfffff00000000000) >> 0;
4333
+        minor |= (dev & 0x00000ffffff00000) >> 12;
4334
+        minor as ::c_uint
4335
+    }
4336
+
4337
+    pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
4338
+        let major = major as ::dev_t;
4339
+        let minor = minor as ::dev_t;
4340
+        let mut dev = 0;
4341
+        dev |= (major & 0x00000fff) << 8;
4342
+        dev |= (major & 0xfffff000) << 32;
4343
+        dev |= (minor & 0x000000ff) << 0;
4344
+        dev |= (minor & 0xffffff00) << 12;
4345
+        dev
4346
+    }
4347
 }
4348
 
4349
 extern {
4350
@@ -744,6 +807,11 @@ extern {
4351
                   cmd: ::c_int,
4352
                   buf: *mut ::shmid_ds) -> ::c_int;
4353
     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
4354
+    pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
4355
+    pub fn semop(semid: ::c_int,
4356
+                 sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
4357
+    pub fn semctl(semid: ::c_int,
4358
+                  semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
4359
     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
4360
     pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
4361
     pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
4362
@@ -859,6 +927,8 @@ extern {
4363
                        serv: *mut ::c_char,
4364
                        sevlen: ::socklen_t,
4365
                        flags: ::c_int) -> ::c_int;
4366
+    pub fn pthread_setschedprio(native: ::pthread_t,
4367
+                                priority: ::c_int) -> ::c_int;
4368
     pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit,
4369
                    old_limit: *mut ::rlimit) -> ::c_int;
4370
     pub fn prlimit64(pid: ::pid_t,
4371
@@ -899,6 +969,60 @@ extern {
4372
                   new_len: ::size_t,
4373
                   flags: ::c_int,
4374
                   ...) -> *mut ::c_void;
4375
+
4376
+    pub fn glob(pattern: *const c_char,
4377
+                flags: ::c_int,
4378
+                errfunc: Option<extern fn(epath: *const c_char,
4379
+                                          errno: ::c_int) -> ::c_int>,
4380
+                pglob: *mut ::glob_t) -> ::c_int;
4381
+    pub fn globfree(pglob: *mut ::glob_t);
4382
+
4383
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
4384
+                         -> ::c_int;
4385
+
4386
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
4387
+
4388
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
4389
+
4390
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
4391
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
4392
+                  -> ::c_int;
4393
+
4394
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
4395
+
4396
+    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
4397
+                    flags: ::c_int, addr: *mut ::sockaddr,
4398
+                    addrlen: *mut ::socklen_t) -> ::ssize_t;
4399
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
4400
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
4401
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
4402
+
4403
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
4404
+                address_len: ::socklen_t) -> ::c_int;
4405
+
4406
+    pub fn writev(fd: ::c_int,
4407
+                  iov: *const ::iovec,
4408
+                  iovcnt: ::c_int) -> ::ssize_t;
4409
+    pub fn readv(fd: ::c_int,
4410
+                 iov: *const ::iovec,
4411
+                 iovcnt: ::c_int) -> ::ssize_t;
4412
+
4413
+    pub fn sendmsg(fd: ::c_int,
4414
+                   msg: *const ::msghdr,
4415
+                   flags: ::c_int) -> ::ssize_t;
4416
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
4417
+                   -> ::ssize_t;
4418
+    pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
4419
+    pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
4420
+    pub fn vhangup() -> ::c_int;
4421
+}
4422
+
4423
+extern {
4424
+    pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
4425
+                    flags: ::c_int) -> ::c_int;
4426
+    pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
4427
+                    flags: ::c_int, timeout: *mut ::timespec) -> ::c_int;
4428
+    pub fn sync();
4429
 }
4430
 
4431
 cfg_if! {
4432
diff --git third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
4433
index 540c1abb5f69..ce198aca9285 100644
4434
--- third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
4435
+++ third_party/rust/libc/src/unix/notbsd/linux/musl/b32/arm.rs
4436
@@ -245,13 +245,22 @@ pub const SO_SNDBUF: ::c_int = 7;
4437
 pub const SO_RCVBUF: ::c_int = 8;
4438
 pub const SO_KEEPALIVE: ::c_int = 9;
4439
 pub const SO_OOBINLINE: ::c_int = 10;
4440
+pub const SO_NO_CHECK: ::c_int = 11;
4441
+pub const SO_PRIORITY: ::c_int = 12;
4442
 pub const SO_LINGER: ::c_int = 13;
4443
+pub const SO_BSDCOMPAT: ::c_int = 14;
4444
 pub const SO_REUSEPORT: ::c_int = 15;
4445
+pub const SO_PASSCRED: ::c_int = 16;
4446
+pub const SO_PEERCRED: ::c_int = 17;
4447
 pub const SO_RCVLOWAT: ::c_int = 18;
4448
 pub const SO_SNDLOWAT: ::c_int = 19;
4449
 pub const SO_RCVTIMEO: ::c_int = 20;
4450
 pub const SO_SNDTIMEO: ::c_int = 21;
4451
 pub const SO_ACCEPTCONN: ::c_int = 30;
4452
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4453
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4454
+pub const SO_PROTOCOL: ::c_int = 38;
4455
+pub const SO_DOMAIN: ::c_int = 39;
4456
 
4457
 pub const SA_ONSTACK: ::c_int = 0x08000000;
4458
 pub const SA_SIGINFO: ::c_int = 0x00000004;
4459
diff --git third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
4460
index 363d7c5d66f4..23c1a267e664 100644
4461
--- third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
4462
+++ third_party/rust/libc/src/unix/notbsd/linux/musl/b32/mips.rs
4463
@@ -245,21 +245,30 @@ pub const SOCK_SEQPACKET: ::c_int = 5;
4464
 pub const SOL_SOCKET: ::c_int = 65535;
4465
 
4466
 pub const SO_REUSEADDR: ::c_int = 0x0004;
4467
-pub const SO_TYPE: ::c_int = 0x1008;
4468
-pub const SO_ERROR: ::c_int = 0x1007;
4469
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
4470
 pub const SO_DONTROUTE: ::c_int = 0x0010;
4471
 pub const SO_BROADCAST: ::c_int = 0x0020;
4472
+pub const SO_LINGER: ::c_int = 0x0080;
4473
+pub const SO_OOBINLINE: ::c_int = 0x0100;
4474
+pub const SO_REUSEPORT: ::c_int = 0x0200;
4475
 pub const SO_SNDBUF: ::c_int = 0x1001;
4476
 pub const SO_RCVBUF: ::c_int = 0x1002;
4477
-pub const SO_KEEPALIVE: ::c_int = 0x0008;
4478
-pub const SO_OOBINLINE: ::c_int = 0x0100;
4479
-pub const SO_LINGER: ::c_int = 0x0080;
4480
-pub const SO_REUSEPORT: ::c_int = 0x200;
4481
-pub const SO_RCVLOWAT: ::c_int = 0x1004;
4482
 pub const SO_SNDLOWAT: ::c_int = 0x1003;
4483
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
4484
 pub const SO_RCVTIMEO: ::c_int = 0x1006;
4485
 pub const SO_SNDTIMEO: ::c_int = 0x1005;
4486
+pub const SO_ERROR: ::c_int = 0x1007;
4487
+pub const SO_TYPE: ::c_int = 0x1008;
4488
 pub const SO_ACCEPTCONN: ::c_int = 0x1009;
4489
+pub const SO_PROTOCOL: ::c_int = 0x1028;
4490
+pub const SO_DOMAIN: ::c_int = 0x1029;
4491
+pub const SO_NO_CHECK: ::c_int = 11;
4492
+pub const SO_PRIORITY: ::c_int = 12;
4493
+pub const SO_BSDCOMPAT: ::c_int = 14;
4494
+pub const SO_PASSCRED: ::c_int = 17;
4495
+pub const SO_PEERCRED: ::c_int = 18;
4496
+pub const SO_SNDBUFFORCE: ::c_int = 31;
4497
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4498
 
4499
 pub const SA_ONSTACK: ::c_int = 0x08000000;
4500
 pub const SA_SIGINFO: ::c_int = 8;
4501
diff --git third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
4502
index dede8ffc5f9f..9daeb58b9986 100644
4503
--- third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
4504
+++ third_party/rust/libc/src/unix/notbsd/linux/musl/b32/x86.rs
4505
@@ -258,13 +258,22 @@ pub const SO_SNDBUF: ::c_int = 7;
4506
 pub const SO_RCVBUF: ::c_int = 8;
4507
 pub const SO_KEEPALIVE: ::c_int = 9;
4508
 pub const SO_OOBINLINE: ::c_int = 10;
4509
+pub const SO_NO_CHECK: ::c_int = 11;
4510
+pub const SO_PRIORITY: ::c_int = 12;
4511
 pub const SO_LINGER: ::c_int = 13;
4512
+pub const SO_BSDCOMPAT: ::c_int = 14;
4513
 pub const SO_REUSEPORT: ::c_int = 15;
4514
+pub const SO_PASSCRED: ::c_int = 16;
4515
+pub const SO_PEERCRED: ::c_int = 17;
4516
 pub const SO_RCVLOWAT: ::c_int = 18;
4517
 pub const SO_SNDLOWAT: ::c_int = 19;
4518
 pub const SO_RCVTIMEO: ::c_int = 20;
4519
 pub const SO_SNDTIMEO: ::c_int = 21;
4520
 pub const SO_ACCEPTCONN: ::c_int = 30;
4521
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4522
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4523
+pub const SO_PROTOCOL: ::c_int = 38;
4524
+pub const SO_DOMAIN: ::c_int = 39;
4525
 
4526
 pub const SA_ONSTACK: ::c_int = 0x08000000;
4527
 pub const SA_SIGINFO: ::c_int = 0x00000004;
4528
diff --git third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
4529
index 2de34133fc3b..fab0b58fed9b 100644
4530
--- third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
4531
+++ third_party/rust/libc/src/unix/notbsd/linux/musl/b64/mod.rs
4532
@@ -274,13 +274,22 @@ pub const SO_SNDBUF: ::c_int = 7;
4533
 pub const SO_RCVBUF: ::c_int = 8;
4534
 pub const SO_KEEPALIVE: ::c_int = 9;
4535
 pub const SO_OOBINLINE: ::c_int = 10;
4536
+pub const SO_NO_CHECK: ::c_int = 11;
4537
+pub const SO_PRIORITY: ::c_int = 12;
4538
 pub const SO_LINGER: ::c_int = 13;
4539
+pub const SO_BSDCOMPAT: ::c_int = 14;
4540
 pub const SO_REUSEPORT: ::c_int = 15;
4541
+pub const SO_PASSCRED: ::c_int = 16;
4542
+pub const SO_PEERCRED: ::c_int = 17;
4543
 pub const SO_RCVLOWAT: ::c_int = 18;
4544
 pub const SO_SNDLOWAT: ::c_int = 19;
4545
 pub const SO_RCVTIMEO: ::c_int = 20;
4546
 pub const SO_SNDTIMEO: ::c_int = 21;
4547
 pub const SO_ACCEPTCONN: ::c_int = 30;
4548
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4549
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4550
+pub const SO_PROTOCOL: ::c_int = 38;
4551
+pub const SO_DOMAIN: ::c_int = 39;
4552
 
4553
 pub const SA_ONSTACK: ::c_int = 0x08000000;
4554
 pub const SA_SIGINFO: ::c_int = 0x00000004;
4555
diff --git third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
4556
index ff8e59b08aeb..b365028b76ac 100644
4557
--- third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
4558
+++ third_party/rust/libc/src/unix/notbsd/linux/musl/mod.rs
4559
@@ -35,7 +35,7 @@ s! {
4560
         pub sa_sigaction: ::sighandler_t,
4561
         pub sa_mask: ::sigset_t,
4562
         pub sa_flags: ::c_int,
4563
-        _restorer: *mut ::c_void,
4564
+        pub sa_restorer: ::dox::Option<extern fn()>,
4565
     }
4566
 
4567
     pub struct ipc_perm {
4568
@@ -124,6 +124,9 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
4569
 pub const BUFSIZ: ::c_uint = 1024;
4570
 pub const TMP_MAX: ::c_uint = 10000;
4571
 pub const FOPEN_MAX: ::c_uint = 1000;
4572
+pub const O_PATH: ::c_int = 0o10000000;
4573
+pub const O_EXEC: ::c_int = 0o10000000;
4574
+pub const O_SEARCH: ::c_int = 0o10000000;
4575
 pub const O_ACCMODE: ::c_int = 0o10000003;
4576
 pub const O_NDELAY: ::c_int = O_NONBLOCK;
4577
 pub const NI_MAXHOST: ::socklen_t = 255;
4578
@@ -236,6 +239,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
4579
 pub const MCL_FUTURE: ::c_int = 0x0002;
4580
 
4581
 pub const SIGSTKSZ: ::size_t = 8192;
4582
+pub const MINSIGSTKSZ: ::size_t = 2048;
4583
 pub const CBAUD: ::tcflag_t = 0o0010017;
4584
 pub const TAB1: ::c_int = 0x00000800;
4585
 pub const TAB2: ::c_int = 0x00001000;
4586
@@ -277,6 +281,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
4587
 pub const PENDIN: ::tcflag_t = 0x00004000;
4588
 pub const NOFLSH: ::tcflag_t = 0x00000080;
4589
 
4590
+pub const B0: ::speed_t = 0o000000;
4591
+pub const B50: ::speed_t = 0o000001;
4592
+pub const B75: ::speed_t = 0o000002;
4593
+pub const B110: ::speed_t = 0o000003;
4594
+pub const B134: ::speed_t = 0o000004;
4595
+pub const B150: ::speed_t = 0o000005;
4596
+pub const B200: ::speed_t = 0o000006;
4597
+pub const B300: ::speed_t = 0o000007;
4598
+pub const B600: ::speed_t = 0o000010;
4599
+pub const B1200: ::speed_t = 0o000011;
4600
+pub const B1800: ::speed_t = 0o000012;
4601
+pub const B2400: ::speed_t = 0o000013;
4602
+pub const B4800: ::speed_t = 0o000014;
4603
+pub const B9600: ::speed_t = 0o000015;
4604
+pub const B19200: ::speed_t = 0o000016;
4605
+pub const B38400: ::speed_t = 0o000017;
4606
+pub const EXTA: ::speed_t = B19200;
4607
+pub const EXTB: ::speed_t = B38400;
4608
+pub const B57600: ::speed_t = 0o010001;
4609
+pub const B115200: ::speed_t = 0o010002;
4610
+pub const B230400: ::speed_t = 0o010003;
4611
+pub const B460800: ::speed_t = 0o010004;
4612
+pub const B500000: ::speed_t = 0o010005;
4613
+pub const B576000: ::speed_t = 0o010006;
4614
+pub const B921600: ::speed_t = 0o010007;
4615
+pub const B1000000: ::speed_t = 0o010010;
4616
+pub const B1152000: ::speed_t = 0o010011;
4617
+pub const B1500000: ::speed_t = 0o010012;
4618
+pub const B2000000: ::speed_t = 0o010013;
4619
+pub const B2500000: ::speed_t = 0o010014;
4620
+pub const B3000000: ::speed_t = 0o010015;
4621
+pub const B3500000: ::speed_t = 0o010016;
4622
+pub const B4000000: ::speed_t = 0o010017;
4623
+
4624
 extern {
4625
     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
4626
     pub fn ptrace(request: ::c_int, ...) -> ::c_long;
4627
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
4628
index 2c6fbcd6e3f2..ee6d67403a1b 100644
4629
--- third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
4630
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b32/arm.rs
4631
@@ -100,6 +100,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
4632
 pub const MCL_FUTURE: ::c_int = 0x0002;
4633
 
4634
 pub const SIGSTKSZ: ::size_t = 8192;
4635
+pub const MINSIGSTKSZ: ::size_t = 2048;
4636
 pub const CBAUD: ::tcflag_t = 0o0010017;
4637
 pub const TAB1: ::c_int = 0x00000800;
4638
 pub const TAB2: ::c_int = 0x00001000;
4639
@@ -141,6 +142,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
4640
 pub const PENDIN: ::tcflag_t = 0x00004000;
4641
 pub const NOFLSH: ::tcflag_t = 0x00000080;
4642
 
4643
+pub const B0: ::speed_t = 0o000000;
4644
+pub const B50: ::speed_t = 0o000001;
4645
+pub const B75: ::speed_t = 0o000002;
4646
+pub const B110: ::speed_t = 0o000003;
4647
+pub const B134: ::speed_t = 0o000004;
4648
+pub const B150: ::speed_t = 0o000005;
4649
+pub const B200: ::speed_t = 0o000006;
4650
+pub const B300: ::speed_t = 0o000007;
4651
+pub const B600: ::speed_t = 0o000010;
4652
+pub const B1200: ::speed_t = 0o000011;
4653
+pub const B1800: ::speed_t = 0o000012;
4654
+pub const B2400: ::speed_t = 0o000013;
4655
+pub const B4800: ::speed_t = 0o000014;
4656
+pub const B9600: ::speed_t = 0o000015;
4657
+pub const B19200: ::speed_t = 0o000016;
4658
+pub const B38400: ::speed_t = 0o000017;
4659
+pub const EXTA: ::speed_t = B19200;
4660
+pub const EXTB: ::speed_t = B38400;
4661
+pub const B57600: ::speed_t = 0o010001;
4662
+pub const B115200: ::speed_t = 0o010002;
4663
+pub const B230400: ::speed_t = 0o010003;
4664
+pub const B460800: ::speed_t = 0o010004;
4665
+pub const B500000: ::speed_t = 0o010005;
4666
+pub const B576000: ::speed_t = 0o010006;
4667
+pub const B921600: ::speed_t = 0o010007;
4668
+pub const B1000000: ::speed_t = 0o010010;
4669
+pub const B1152000: ::speed_t = 0o010011;
4670
+pub const B1500000: ::speed_t = 0o010012;
4671
+pub const B2000000: ::speed_t = 0o010013;
4672
+pub const B2500000: ::speed_t = 0o010014;
4673
+pub const B3000000: ::speed_t = 0o010015;
4674
+pub const B3500000: ::speed_t = 0o010016;
4675
+pub const B4000000: ::speed_t = 0o010017;
4676
+
4677
 pub const VEOL: usize = 11;
4678
 pub const VEOL2: usize = 16;
4679
 pub const VMIN: usize = 6;
4680
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
4681
index 3125e9f337dd..035bfe19cdc0 100644
4682
--- third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
4683
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
4684
@@ -81,11 +81,17 @@ pub const MAP_NORESERVE: ::c_int = 0x00040;
4685
 
4686
 pub const EDEADLOCK: ::c_int = 58;
4687
 
4688
-pub const SO_PEERCRED: ::c_int = 21;
4689
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4690
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4691
+pub const SO_NO_CHECK: ::c_int = 11;
4692
+pub const SO_PRIORITY: ::c_int = 12;
4693
+pub const SO_BSDCOMPAT: ::c_int = 14;
4694
 pub const SO_RCVLOWAT: ::c_int = 16;
4695
 pub const SO_SNDLOWAT: ::c_int = 17;
4696
 pub const SO_RCVTIMEO: ::c_int = 18;
4697
 pub const SO_SNDTIMEO: ::c_int = 19;
4698
+pub const SO_PASSCRED: ::c_int = 20;
4699
+pub const SO_PEERCRED: ::c_int = 21;
4700
 
4701
 pub const FIOCLEX: ::c_ulong = 0x20006601;
4702
 pub const FIONBIO: ::c_ulong = 0x8004667e;
4703
@@ -97,6 +103,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
4704
 pub const MCL_FUTURE: ::c_int = 0x4000;
4705
 
4706
 pub const SIGSTKSZ: ::size_t = 0x4000;
4707
+pub const MINSIGSTKSZ: ::size_t = 4096;
4708
 pub const CBAUD: ::tcflag_t = 0xff;
4709
 pub const TAB1: ::c_int = 0x400;
4710
 pub const TAB2: ::c_int = 0x800;
4711
@@ -138,6 +145,41 @@ pub const ICANON: ::tcflag_t = 0x100;
4712
 pub const PENDIN: ::tcflag_t = 0x20000000;
4713
 pub const NOFLSH: ::tcflag_t = 0x80000000;
4714
 
4715
+pub const B0: ::speed_t = 0o000000;
4716
+pub const B50: ::speed_t = 0o000001;
4717
+pub const B75: ::speed_t = 0o000002;
4718
+pub const B110: ::speed_t = 0o000003;
4719
+pub const B134: ::speed_t = 0o000004;
4720
+pub const B150: ::speed_t = 0o000005;
4721
+pub const B200: ::speed_t = 0o000006;
4722
+pub const B300: ::speed_t = 0o000007;
4723
+pub const B600: ::speed_t = 0o000010;
4724
+pub const B1200: ::speed_t = 0o000011;
4725
+pub const B1800: ::speed_t = 0o000012;
4726
+pub const B2400: ::speed_t = 0o000013;
4727
+pub const B4800: ::speed_t = 0o000014;
4728
+pub const B9600: ::speed_t = 0o000015;
4729
+pub const B19200: ::speed_t = 0o000016;
4730
+pub const B38400: ::speed_t = 0o000017;
4731
+pub const EXTA: ::speed_t = B19200;
4732
+pub const EXTB: ::speed_t = B38400;
4733
+pub const CBAUDEX: ::speed_t = 0o000020;
4734
+pub const B57600: ::speed_t = 0o0020;
4735
+pub const B115200: ::speed_t = 0o0021;
4736
+pub const B230400: ::speed_t = 0o0022;
4737
+pub const B460800: ::speed_t = 0o0023;
4738
+pub const B500000: ::speed_t = 0o0024;
4739
+pub const B576000: ::speed_t = 0o0025;
4740
+pub const B921600: ::speed_t = 0o0026;
4741
+pub const B1000000: ::speed_t = 0o0027;
4742
+pub const B1152000: ::speed_t = 0o0030;
4743
+pub const B1500000: ::speed_t = 0o0031;
4744
+pub const B2000000: ::speed_t = 0o0032;
4745
+pub const B2500000: ::speed_t = 0o0033;
4746
+pub const B3000000: ::speed_t = 0o0034;
4747
+pub const B3500000: ::speed_t = 0o0035;
4748
+pub const B4000000: ::speed_t = 0o0036;
4749
+
4750
 pub const VEOL: usize = 6;
4751
 pub const VEOL2: usize = 8;
4752
 pub const VMIN: usize = 5;
4753
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
4754
index 86abd1eb1035..04a3caad12ac 100644
4755
--- third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
4756
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b32/x86.rs
4757
@@ -20,6 +20,71 @@ s! {
4758
         pub status: ::c_ulong,
4759
     }
4760
 
4761
+    pub struct user_fpregs_struct {
4762
+        pub cwd: ::c_long,
4763
+        pub swd: ::c_long,
4764
+        pub twd: ::c_long,
4765
+        pub fip: ::c_long,
4766
+        pub fcs: ::c_long,
4767
+        pub foo: ::c_long,
4768
+        pub fos: ::c_long,
4769
+        pub st_space: [::c_long; 20],
4770
+    }
4771
+
4772
+    pub struct user_fpxregs_struct {
4773
+        pub cwd: ::c_ushort,
4774
+        pub swd: ::c_ushort,
4775
+        pub twd: ::c_ushort,
4776
+        pub fop: ::c_ushort,
4777
+        pub fip: ::c_long,
4778
+        pub fcs: ::c_long,
4779
+        pub foo: ::c_long,
4780
+        pub fos: ::c_long,
4781
+        pub mxcsr: ::c_long,
4782
+        __reserved: ::c_long,
4783
+        pub st_space: [::c_long; 32],
4784
+        pub xmm_space: [::c_long; 32],
4785
+        padding: [::c_long; 56],
4786
+    }
4787
+
4788
+    pub struct user_regs_struct {
4789
+        pub ebx: ::c_long,
4790
+        pub ecx: ::c_long,
4791
+        pub edx: ::c_long,
4792
+        pub esi: ::c_long,
4793
+        pub edi: ::c_long,
4794
+        pub ebp: ::c_long,
4795
+        pub eax: ::c_long,
4796
+        pub xds: ::c_long,
4797
+        pub xes: ::c_long,
4798
+        pub xfs: ::c_long,
4799
+        pub xgs: ::c_long,
4800
+        pub orig_eax: ::c_long,
4801
+        pub eip: ::c_long,
4802
+        pub xcs: ::c_long,
4803
+        pub eflags: ::c_long,
4804
+        pub esp: ::c_long,
4805
+        pub xss: ::c_long,
4806
+    }
4807
+
4808
+    pub struct user {
4809
+        pub regs: user_regs_struct,
4810
+        pub u_fpvalid: ::c_int,
4811
+        pub i387: user_fpregs_struct,
4812
+        pub u_tsize: ::c_ulong,
4813
+        pub u_dsize: ::c_ulong,
4814
+        pub u_ssize: ::c_ulong,
4815
+        pub start_code: ::c_ulong,
4816
+        pub start_stack: ::c_ulong,
4817
+        pub signal: ::c_long,
4818
+        __reserved: ::c_int,
4819
+        pub u_ar0: *mut user_regs_struct,
4820
+        pub u_fpstate: *mut user_fpregs_struct,
4821
+        pub magic: ::c_ulong,
4822
+        pub u_comm: [c_char; 32],
4823
+        pub u_debugreg: [::c_int; 8],
4824
+    }
4825
+
4826
     pub struct mcontext_t {
4827
         pub gregs: [greg_t; 19],
4828
         pub fpregs: *mut _libc_fpstate,
4829
@@ -116,6 +181,12 @@ pub const MAP_32BIT: ::c_int = 0x0040;
4830
 
4831
 pub const EDEADLOCK: ::c_int = 35;
4832
 
4833
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4834
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4835
+pub const SO_NO_CHECK: ::c_int = 11;
4836
+pub const SO_PRIORITY: ::c_int = 12;
4837
+pub const SO_BSDCOMPAT: ::c_int = 14;
4838
+pub const SO_PASSCRED: ::c_int = 16;
4839
 pub const SO_PEERCRED: ::c_int = 17;
4840
 pub const SO_RCVLOWAT: ::c_int = 18;
4841
 pub const SO_SNDLOWAT: ::c_int = 19;
4842
@@ -135,6 +206,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
4843
 pub const MCL_FUTURE: ::c_int = 0x0002;
4844
 
4845
 pub const SIGSTKSZ: ::size_t = 8192;
4846
+pub const MINSIGSTKSZ: ::size_t = 2048;
4847
 pub const CBAUD: ::tcflag_t = 0o0010017;
4848
 pub const TAB1: ::c_int = 0x00000800;
4849
 pub const TAB2: ::c_int = 0x00001000;
4850
@@ -176,6 +248,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
4851
 pub const PENDIN: ::tcflag_t = 0x00004000;
4852
 pub const NOFLSH: ::tcflag_t = 0x00000080;
4853
 
4854
+pub const B0: ::speed_t = 0o000000;
4855
+pub const B50: ::speed_t = 0o000001;
4856
+pub const B75: ::speed_t = 0o000002;
4857
+pub const B110: ::speed_t = 0o000003;
4858
+pub const B134: ::speed_t = 0o000004;
4859
+pub const B150: ::speed_t = 0o000005;
4860
+pub const B200: ::speed_t = 0o000006;
4861
+pub const B300: ::speed_t = 0o000007;
4862
+pub const B600: ::speed_t = 0o000010;
4863
+pub const B1200: ::speed_t = 0o000011;
4864
+pub const B1800: ::speed_t = 0o000012;
4865
+pub const B2400: ::speed_t = 0o000013;
4866
+pub const B4800: ::speed_t = 0o000014;
4867
+pub const B9600: ::speed_t = 0o000015;
4868
+pub const B19200: ::speed_t = 0o000016;
4869
+pub const B38400: ::speed_t = 0o000017;
4870
+pub const EXTA: ::speed_t = B19200;
4871
+pub const EXTB: ::speed_t = B38400;
4872
+pub const B57600: ::speed_t = 0o010001;
4873
+pub const B115200: ::speed_t = 0o010002;
4874
+pub const B230400: ::speed_t = 0o010003;
4875
+pub const B460800: ::speed_t = 0o010004;
4876
+pub const B500000: ::speed_t = 0o010005;
4877
+pub const B576000: ::speed_t = 0o010006;
4878
+pub const B921600: ::speed_t = 0o010007;
4879
+pub const B1000000: ::speed_t = 0o010010;
4880
+pub const B1152000: ::speed_t = 0o010011;
4881
+pub const B1500000: ::speed_t = 0o010012;
4882
+pub const B2000000: ::speed_t = 0o010013;
4883
+pub const B2500000: ::speed_t = 0o010014;
4884
+pub const B3000000: ::speed_t = 0o010015;
4885
+pub const B3500000: ::speed_t = 0o010016;
4886
+pub const B4000000: ::speed_t = 0o010017;
4887
+
4888
 pub const VEOL: usize = 11;
4889
 pub const VEOL2: usize = 16;
4890
 pub const VMIN: usize = 6;
4891
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
4892
index cb0e1a6979e0..77cee3d21751 100644
4893
--- third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
4894
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
4895
@@ -188,11 +188,54 @@ pub const SO_DONTROUTE: ::c_int = 5;
4896
 pub const SO_BROADCAST: ::c_int = 6;
4897
 pub const SO_SNDBUF: ::c_int = 7;
4898
 pub const SO_RCVBUF: ::c_int = 8;
4899
+pub const SO_SNDBUFFORCE: ::c_int = 32;
4900
+pub const SO_RCVBUFFORCE: ::c_int = 33;
4901
 pub const SO_KEEPALIVE: ::c_int = 9;
4902
 pub const SO_OOBINLINE: ::c_int = 10;
4903
+pub const SO_NO_CHECK: ::c_int = 11;
4904
+pub const SO_PRIORITY: ::c_int = 12;
4905
 pub const SO_LINGER: ::c_int = 13;
4906
+pub const SO_BSDCOMPAT: ::c_int = 14;
4907
 pub const SO_REUSEPORT: ::c_int = 15;
4908
+pub const SO_PASSCRED: ::c_int = 16;
4909
+pub const SO_PEERCRED: ::c_int = 17;
4910
+pub const SO_RCVLOWAT: ::c_int = 18;
4911
+pub const SO_SNDLOWAT: ::c_int = 19;
4912
+pub const SO_RCVTIMEO: ::c_int = 20;
4913
+pub const SO_SNDTIMEO: ::c_int = 21;
4914
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
4915
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
4916
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
4917
+pub const SO_BINDTODEVICE: ::c_int = 25;
4918
+pub const SO_ATTACH_FILTER: ::c_int = 26;
4919
+pub const SO_DETACH_FILTER: ::c_int = 27;
4920
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
4921
+pub const SO_PEERNAME: ::c_int = 28;
4922
+pub const SO_TIMESTAMP: ::c_int = 29;
4923
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
4924
 pub const SO_ACCEPTCONN: ::c_int = 30;
4925
+pub const SO_PEERSEC: ::c_int = 31;
4926
+pub const SO_PASSSEC: ::c_int = 34;
4927
+pub const SO_TIMESTAMPNS: ::c_int = 35;
4928
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
4929
+pub const SO_MARK: ::c_int = 36;
4930
+pub const SO_TIMESTAMPING: ::c_int = 37;
4931
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
4932
+pub const SO_PROTOCOL: ::c_int = 38;
4933
+pub const SO_DOMAIN: ::c_int = 39;
4934
+pub const SO_RXQ_OVFL: ::c_int = 40;
4935
+pub const SO_WIFI_STATUS: ::c_int = 41;
4936
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
4937
+pub const SO_PEEK_OFF: ::c_int = 42;
4938
+pub const SO_NOFCS: ::c_int = 43;
4939
+pub const SO_LOCK_FILTER: ::c_int = 44;
4940
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
4941
+pub const SO_BUSY_POLL: ::c_int = 46;
4942
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
4943
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
4944
+pub const SO_INCOMING_CPU: ::c_int = 49;
4945
+pub const SO_ATTACH_BPF: ::c_int = 50;
4946
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
4947
 
4948
 pub const SA_ONSTACK: ::c_int = 0x08000000;
4949
 pub const SA_SIGINFO: ::c_int = 0x00000004;
4950
@@ -291,12 +334,6 @@ pub const MAP_NORESERVE: ::c_int = 0x04000;
4951
 
4952
 pub const EDEADLOCK: ::c_int = 35;
4953
 
4954
-pub const SO_PEERCRED: ::c_int = 17;
4955
-pub const SO_RCVLOWAT: ::c_int = 18;
4956
-pub const SO_SNDLOWAT: ::c_int = 19;
4957
-pub const SO_RCVTIMEO: ::c_int = 20;
4958
-pub const SO_SNDTIMEO: ::c_int = 21;
4959
-
4960
 pub const FIOCLEX: ::c_ulong = 0x5451;
4961
 pub const FIONBIO: ::c_ulong = 0x5421;
4962
 
4963
@@ -307,6 +344,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
4964
 pub const MCL_FUTURE: ::c_int = 0x0002;
4965
 
4966
 pub const SIGSTKSZ: ::size_t = 16384;
4967
+pub const MINSIGSTKSZ: ::size_t = 5120;
4968
 pub const CBAUD: ::tcflag_t = 0o0010017;
4969
 pub const TAB1: ::c_int = 0x00000800;
4970
 pub const TAB2: ::c_int = 0x00001000;
4971
@@ -348,6 +386,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
4972
 pub const PENDIN: ::tcflag_t = 0x00004000;
4973
 pub const NOFLSH: ::tcflag_t = 0x00000080;
4974
 
4975
+pub const B0: ::speed_t = 0o000000;
4976
+pub const B50: ::speed_t = 0o000001;
4977
+pub const B75: ::speed_t = 0o000002;
4978
+pub const B110: ::speed_t = 0o000003;
4979
+pub const B134: ::speed_t = 0o000004;
4980
+pub const B150: ::speed_t = 0o000005;
4981
+pub const B200: ::speed_t = 0o000006;
4982
+pub const B300: ::speed_t = 0o000007;
4983
+pub const B600: ::speed_t = 0o000010;
4984
+pub const B1200: ::speed_t = 0o000011;
4985
+pub const B1800: ::speed_t = 0o000012;
4986
+pub const B2400: ::speed_t = 0o000013;
4987
+pub const B4800: ::speed_t = 0o000014;
4988
+pub const B9600: ::speed_t = 0o000015;
4989
+pub const B19200: ::speed_t = 0o000016;
4990
+pub const B38400: ::speed_t = 0o000017;
4991
+pub const EXTA: ::speed_t = B19200;
4992
+pub const EXTB: ::speed_t = B38400;
4993
+pub const B57600: ::speed_t = 0o010001;
4994
+pub const B115200: ::speed_t = 0o010002;
4995
+pub const B230400: ::speed_t = 0o010003;
4996
+pub const B460800: ::speed_t = 0o010004;
4997
+pub const B500000: ::speed_t = 0o010005;
4998
+pub const B576000: ::speed_t = 0o010006;
4999
+pub const B921600: ::speed_t = 0o010007;
5000
+pub const B1000000: ::speed_t = 0o010010;
5001
+pub const B1152000: ::speed_t = 0o010011;
5002
+pub const B1500000: ::speed_t = 0o010012;
5003
+pub const B2000000: ::speed_t = 0o010013;
5004
+pub const B2500000: ::speed_t = 0o010014;
5005
+pub const B3000000: ::speed_t = 0o010015;
5006
+pub const B3500000: ::speed_t = 0o010016;
5007
+pub const B4000000: ::speed_t = 0o010017;
5008
+
5009
 pub const VEOL: usize = 11;
5010
 pub const VEOL2: usize = 16;
5011
 pub const VMIN: usize = 6;
5012
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs third_party/rust/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
5013
index a5fad66dd1ea..8c19b0713dc5 100644
5014
--- third_party/rust/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
5015
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
5016
@@ -186,11 +186,54 @@ pub const SO_DONTROUTE: ::c_int = 5;
5017
 pub const SO_BROADCAST: ::c_int = 6;
5018
 pub const SO_SNDBUF: ::c_int = 7;
5019
 pub const SO_RCVBUF: ::c_int = 8;
5020
+pub const SO_SNDBUFFORCE: ::c_int = 32;
5021
+pub const SO_RCVBUFFORCE: ::c_int = 33;
5022
 pub const SO_KEEPALIVE: ::c_int = 9;
5023
 pub const SO_OOBINLINE: ::c_int = 10;
5024
+pub const SO_NO_CHECK: ::c_int = 11;
5025
+pub const SO_PRIORITY: ::c_int = 12;
5026
 pub const SO_LINGER: ::c_int = 13;
5027
+pub const SO_BSDCOMPAT: ::c_int = 14;
5028
 pub const SO_REUSEPORT: ::c_int = 15;
5029
+pub const SO_PASSCRED: ::c_int = 20;
5030
+pub const SO_PEERCRED: ::c_int = 21;
5031
+pub const SO_RCVLOWAT: ::c_int = 16;
5032
+pub const SO_SNDLOWAT: ::c_int = 17;
5033
+pub const SO_RCVTIMEO: ::c_int = 18;
5034
+pub const SO_SNDTIMEO: ::c_int = 19;
5035
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
5036
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
5037
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
5038
+pub const SO_BINDTODEVICE: ::c_int = 25;
5039
+pub const SO_ATTACH_FILTER: ::c_int = 26;
5040
+pub const SO_DETACH_FILTER: ::c_int = 27;
5041
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
5042
+pub const SO_PEERNAME: ::c_int = 28;
5043
+pub const SO_TIMESTAMP: ::c_int = 29;
5044
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
5045
 pub const SO_ACCEPTCONN: ::c_int = 30;
5046
+pub const SO_PEERSEC: ::c_int = 31;
5047
+pub const SO_PASSSEC: ::c_int = 34;
5048
+pub const SO_TIMESTAMPNS: ::c_int = 35;
5049
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
5050
+pub const SO_MARK: ::c_int = 36;
5051
+pub const SO_TIMESTAMPING: ::c_int = 37;
5052
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
5053
+pub const SO_PROTOCOL: ::c_int = 38;
5054
+pub const SO_DOMAIN: ::c_int = 39;
5055
+pub const SO_RXQ_OVFL: ::c_int = 40;
5056
+pub const SO_WIFI_STATUS: ::c_int = 41;
5057
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
5058
+pub const SO_PEEK_OFF: ::c_int = 42;
5059
+pub const SO_NOFCS: ::c_int = 43;
5060
+pub const SO_LOCK_FILTER: ::c_int = 44;
5061
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
5062
+pub const SO_BUSY_POLL: ::c_int = 46;
5063
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
5064
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
5065
+pub const SO_INCOMING_CPU: ::c_int = 49;
5066
+pub const SO_ATTACH_BPF: ::c_int = 50;
5067
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
5068
 
5069
 pub const SA_ONSTACK: ::c_int = 0x08000000;
5070
 pub const SA_SIGINFO: ::c_int = 0x00000004;
5071
@@ -289,12 +332,6 @@ pub const MAP_NORESERVE: ::c_int = 0x00040;
5072
 
5073
 pub const EDEADLOCK: ::c_int = 58;
5074
 
5075
-pub const SO_PEERCRED: ::c_int = 21;
5076
-pub const SO_RCVLOWAT: ::c_int = 16;
5077
-pub const SO_SNDLOWAT: ::c_int = 17;
5078
-pub const SO_RCVTIMEO: ::c_int = 18;
5079
-pub const SO_SNDTIMEO: ::c_int = 19;
5080
-
5081
 pub const FIOCLEX: ::c_ulong = 0x20006601;
5082
 pub const FIONBIO: ::c_ulong = 0x8004667e;
5083
 
5084
@@ -305,6 +342,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
5085
 pub const MCL_FUTURE: ::c_int = 0x4000;
5086
 
5087
 pub const SIGSTKSZ: ::size_t = 0x4000;
5088
+pub const MINSIGSTKSZ: ::size_t = 4096;
5089
 pub const CBAUD: ::tcflag_t = 0xff;
5090
 pub const TAB1: ::c_int = 0x400;
5091
 pub const TAB2: ::c_int = 0x800;
5092
@@ -346,6 +384,41 @@ pub const ICANON: ::tcflag_t = 0x100;
5093
 pub const PENDIN: ::tcflag_t = 0x20000000;
5094
 pub const NOFLSH: ::tcflag_t = 0x80000000;
5095
 
5096
+pub const B0: ::speed_t = 0o000000;
5097
+pub const B50: ::speed_t = 0o000001;
5098
+pub const B75: ::speed_t = 0o000002;
5099
+pub const B110: ::speed_t = 0o000003;
5100
+pub const B134: ::speed_t = 0o000004;
5101
+pub const B150: ::speed_t = 0o000005;
5102
+pub const B200: ::speed_t = 0o000006;
5103
+pub const B300: ::speed_t = 0o000007;
5104
+pub const B600: ::speed_t = 0o000010;
5105
+pub const B1200: ::speed_t = 0o000011;
5106
+pub const B1800: ::speed_t = 0o000012;
5107
+pub const B2400: ::speed_t = 0o000013;
5108
+pub const B4800: ::speed_t = 0o000014;
5109
+pub const B9600: ::speed_t = 0o000015;
5110
+pub const B19200: ::speed_t = 0o000016;
5111
+pub const B38400: ::speed_t = 0o000017;
5112
+pub const EXTA: ::speed_t = B19200;
5113
+pub const EXTB: ::speed_t = B38400;
5114
+pub const CBAUDEX: ::speed_t = 0o000020;
5115
+pub const B57600: ::speed_t = 0o0020;
5116
+pub const B115200: ::speed_t = 0o0021;
5117
+pub const B230400: ::speed_t = 0o0022;
5118
+pub const B460800: ::speed_t = 0o0023;
5119
+pub const B500000: ::speed_t = 0o0024;
5120
+pub const B576000: ::speed_t = 0o0025;
5121
+pub const B921600: ::speed_t = 0o0026;
5122
+pub const B1000000: ::speed_t = 0o0027;
5123
+pub const B1152000: ::speed_t = 0o0030;
5124
+pub const B1500000: ::speed_t = 0o0031;
5125
+pub const B2000000: ::speed_t = 0o0032;
5126
+pub const B2500000: ::speed_t = 0o0033;
5127
+pub const B3000000: ::speed_t = 0o0034;
5128
+pub const B3500000: ::speed_t = 0o0035;
5129
+pub const B4000000: ::speed_t = 0o0036;
5130
+
5131
 pub const VEOL: usize = 6;
5132
 pub const VEOL2: usize = 8;
5133
 pub const VMIN: usize = 5;
5134
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b64/sparc64.rs third_party/rust/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
5135
index a1ac4f5389de..12598e052294 100644
5136
--- third_party/rust/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
5137
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
5138
@@ -301,6 +301,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
5139
 pub const MCL_FUTURE: ::c_int = 0x4000;
5140
 
5141
 pub const SIGSTKSZ: ::size_t = 16384;
5142
+pub const MINSIGSTKSZ: ::size_t = 4096;
5143
 pub const CBAUD: ::tcflag_t = 0x0000100f;
5144
 pub const TAB1: ::c_int = 0x800;
5145
 pub const TAB2: ::c_int = 0x1000;
5146
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
5147
index d7bf149caa7e..e1b65e8e71be 100644
5148
--- third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
5149
+++ third_party/rust/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
5150
@@ -78,6 +78,68 @@ s! {
5151
         __private: [u64; 12],
5152
     }
5153
 
5154
+    pub struct user_fpregs_struct {
5155
+        pub cwd: ::c_ushort,
5156
+        pub swd: ::c_ushort,
5157
+        pub ftw: ::c_ushort,
5158
+        pub fop: ::c_ushort,
5159
+        pub rip: ::c_ulonglong,
5160
+        pub rdp: ::c_ulonglong,
5161
+        pub mxcsr: ::c_uint,
5162
+        pub mxcr_mask: ::c_uint,
5163
+        pub st_space: [::c_uint; 32],
5164
+        pub xmm_space: [::c_uint; 64],
5165
+        padding: [::c_uint; 24],
5166
+    }
5167
+
5168
+    pub struct user_regs_struct {
5169
+        pub r15: ::c_ulonglong,
5170
+        pub r14: ::c_ulonglong,
5171
+        pub r13: ::c_ulonglong,
5172
+        pub r12: ::c_ulonglong,
5173
+        pub rbp: ::c_ulonglong,
5174
+        pub rbx: ::c_ulonglong,
5175
+        pub r11: ::c_ulonglong,
5176
+        pub r10: ::c_ulonglong,
5177
+        pub r9: ::c_ulonglong,
5178
+        pub r8: ::c_ulonglong,
5179
+        pub rax: ::c_ulonglong,
5180
+        pub rcx: ::c_ulonglong,
5181
+        pub rdx: ::c_ulonglong,
5182
+        pub rsi: ::c_ulonglong,
5183
+        pub rdi: ::c_ulonglong,
5184
+        pub orig_rax: ::c_ulonglong,
5185
+        pub rip: ::c_ulonglong,
5186
+        pub cs: ::c_ulonglong,
5187
+        pub eflags: ::c_ulonglong,
5188
+        pub rsp: ::c_ulonglong,
5189
+        pub ss: ::c_ulonglong,
5190
+        pub fs_base: ::c_ulonglong,
5191
+        pub gs_base: ::c_ulonglong,
5192
+        pub ds: ::c_ulonglong,
5193
+        pub es: ::c_ulonglong,
5194
+        pub fs: ::c_ulonglong,
5195
+        pub gs: ::c_ulonglong,
5196
+    }
5197
+
5198
+    pub struct user {
5199
+        pub regs: user_regs_struct,
5200
+        pub u_fpvalid: ::c_int,
5201
+        pub i387: user_fpregs_struct,
5202
+        pub u_tsize: ::c_ulonglong,
5203
+        pub u_dsize: ::c_ulonglong,
5204
+        pub u_ssize: ::c_ulonglong,
5205
+        pub start_code: ::c_ulonglong,
5206
+        pub start_stack: ::c_ulonglong,
5207
+        pub signal: ::c_longlong,
5208
+        __reserved: ::c_int,
5209
+        pub u_ar0: *mut user_regs_struct,
5210
+        pub u_fpstate: *mut user_fpregs_struct,
5211
+        pub magic: ::c_ulonglong,
5212
+        pub u_comm: [::c_char; 32],
5213
+        pub u_debugreg: [::c_ulonglong; 8],
5214
+    }
5215
+
5216
     pub struct mcontext_t {
5217
         pub gregs: [greg_t; 23],
5218
         pub fpregs: *mut _libc_fpstate,
5219
@@ -227,11 +289,54 @@ pub const SO_DONTROUTE: ::c_int = 5;
5220
 pub const SO_BROADCAST: ::c_int = 6;
5221
 pub const SO_SNDBUF: ::c_int = 7;
5222
 pub const SO_RCVBUF: ::c_int = 8;
5223
+pub const SO_SNDBUFFORCE: ::c_int = 32;
5224
+pub const SO_RCVBUFFORCE: ::c_int = 33;
5225
 pub const SO_KEEPALIVE: ::c_int = 9;
5226
 pub const SO_OOBINLINE: ::c_int = 10;
5227
+pub const SO_NO_CHECK: ::c_int = 11;
5228
+pub const SO_PRIORITY: ::c_int = 12;
5229
 pub const SO_LINGER: ::c_int = 13;
5230
+pub const SO_BSDCOMPAT: ::c_int = 14;
5231
 pub const SO_REUSEPORT: ::c_int = 15;
5232
+pub const SO_PASSCRED: ::c_int = 16;
5233
+pub const SO_PEERCRED: ::c_int = 17;
5234
+pub const SO_RCVLOWAT: ::c_int = 18;
5235
+pub const SO_SNDLOWAT: ::c_int = 19;
5236
+pub const SO_RCVTIMEO: ::c_int = 20;
5237
+pub const SO_SNDTIMEO: ::c_int = 21;
5238
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
5239
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
5240
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
5241
+pub const SO_BINDTODEVICE: ::c_int = 25;
5242
+pub const SO_ATTACH_FILTER: ::c_int = 26;
5243
+pub const SO_DETACH_FILTER: ::c_int = 27;
5244
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
5245
+pub const SO_PEERNAME: ::c_int = 28;
5246
+pub const SO_TIMESTAMP: ::c_int = 29;
5247
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
5248
 pub const SO_ACCEPTCONN: ::c_int = 30;
5249
+pub const SO_PEERSEC: ::c_int = 31;
5250
+pub const SO_PASSSEC: ::c_int = 34;
5251
+pub const SO_TIMESTAMPNS: ::c_int = 35;
5252
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
5253
+pub const SO_MARK: ::c_int = 36;
5254
+pub const SO_TIMESTAMPING: ::c_int = 37;
5255
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
5256
+pub const SO_PROTOCOL: ::c_int = 38;
5257
+pub const SO_DOMAIN: ::c_int = 39;
5258
+pub const SO_RXQ_OVFL: ::c_int = 40;
5259
+pub const SO_WIFI_STATUS: ::c_int = 41;
5260
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
5261
+pub const SO_PEEK_OFF: ::c_int = 42;
5262
+pub const SO_NOFCS: ::c_int = 43;
5263
+pub const SO_LOCK_FILTER: ::c_int = 44;
5264
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
5265
+pub const SO_BUSY_POLL: ::c_int = 46;
5266
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
5267
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
5268
+pub const SO_INCOMING_CPU: ::c_int = 49;
5269
+pub const SO_ATTACH_BPF: ::c_int = 50;
5270
+pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
5271
 
5272
 pub const SA_ONSTACK: ::c_int = 0x08000000;
5273
 pub const SA_SIGINFO: ::c_int = 0x00000004;
5274
@@ -331,12 +436,6 @@ pub const MAP_32BIT: ::c_int = 0x0040;
5275
 
5276
 pub const EDEADLOCK: ::c_int = 35;
5277
 
5278
-pub const SO_PEERCRED: ::c_int = 17;
5279
-pub const SO_RCVLOWAT: ::c_int = 18;
5280
-pub const SO_SNDLOWAT: ::c_int = 19;
5281
-pub const SO_RCVTIMEO: ::c_int = 20;
5282
-pub const SO_SNDTIMEO: ::c_int = 21;
5283
-
5284
 pub const FIOCLEX: ::c_ulong = 0x5451;
5285
 pub const FIONBIO: ::c_ulong = 0x5421;
5286
 
5287
@@ -365,6 +464,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
5288
 pub const MCL_FUTURE: ::c_int = 0x0002;
5289
 
5290
 pub const SIGSTKSZ: ::size_t = 8192;
5291
+pub const MINSIGSTKSZ: ::size_t = 2048;
5292
 pub const CBAUD: ::tcflag_t = 0o0010017;
5293
 pub const TAB1: ::c_int = 0x00000800;
5294
 pub const TAB2: ::c_int = 0x00001000;
5295
@@ -406,6 +506,40 @@ pub const ICANON: ::tcflag_t = 0x00000002;
5296
 pub const PENDIN: ::tcflag_t = 0x00004000;
5297
 pub const NOFLSH: ::tcflag_t = 0x00000080;
5298
 
5299
+pub const B0: ::speed_t = 0o000000;
5300
+pub const B50: ::speed_t = 0o000001;
5301
+pub const B75: ::speed_t = 0o000002;
5302
+pub const B110: ::speed_t = 0o000003;
5303
+pub const B134: ::speed_t = 0o000004;
5304
+pub const B150: ::speed_t = 0o000005;
5305
+pub const B200: ::speed_t = 0o000006;
5306
+pub const B300: ::speed_t = 0o000007;
5307
+pub const B600: ::speed_t = 0o000010;
5308
+pub const B1200: ::speed_t = 0o000011;
5309
+pub const B1800: ::speed_t = 0o000012;
5310
+pub const B2400: ::speed_t = 0o000013;
5311
+pub const B4800: ::speed_t = 0o000014;
5312
+pub const B9600: ::speed_t = 0o000015;
5313
+pub const B19200: ::speed_t = 0o000016;
5314
+pub const B38400: ::speed_t = 0o000017;
5315
+pub const EXTA: ::speed_t = B19200;
5316
+pub const EXTB: ::speed_t = B38400;
5317
+pub const B57600: ::speed_t = 0o010001;
5318
+pub const B115200: ::speed_t = 0o010002;
5319
+pub const B230400: ::speed_t = 0o010003;
5320
+pub const B460800: ::speed_t = 0o010004;
5321
+pub const B500000: ::speed_t = 0o010005;
5322
+pub const B576000: ::speed_t = 0o010006;
5323
+pub const B921600: ::speed_t = 0o010007;
5324
+pub const B1000000: ::speed_t = 0o010010;
5325
+pub const B1152000: ::speed_t = 0o010011;
5326
+pub const B1500000: ::speed_t = 0o010012;
5327
+pub const B2000000: ::speed_t = 0o010013;
5328
+pub const B2500000: ::speed_t = 0o010014;
5329
+pub const B3000000: ::speed_t = 0o010015;
5330
+pub const B3500000: ::speed_t = 0o010016;
5331
+pub const B4000000: ::speed_t = 0o010017;
5332
+
5333
 pub const VEOL: usize = 11;
5334
 pub const VEOL2: usize = 16;
5335
 pub const VMIN: usize = 6;
5336
@@ -440,4 +574,7 @@ extern {
5337
                        argc: ::c_int, ...);
5338
     pub fn swapcontext(uocp: *mut ucontext_t,
5339
                        ucp: *const ucontext_t) -> ::c_int;
5340
+    pub fn iopl(level: ::c_int) -> ::c_int;
5341
+    pub fn ioperm(from: ::c_ulong, num: ::c_ulong,
5342
+                  turn_on: ::c_int) -> ::c_int;
5343
 }
5344
diff --git third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
5345
index 3beb7886f347..b7a11a85e962 100644
5346
--- third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
5347
+++ third_party/rust/libc/src/unix/notbsd/linux/other/mod.rs
5348
@@ -70,7 +70,7 @@ s! {
5349
         #[cfg(target_arch = "sparc64")]
5350
         __reserved0: ::c_int,
5351
         pub sa_flags: ::c_int,
5352
-        _restorer: *mut ::c_void,
5353
+        pub sa_restorer: ::dox::Option<extern fn()>,
5354
     }
5355
 
5356
     pub struct stack_t {
5357
@@ -192,6 +192,18 @@ pub const RLIMIT_NLIMITS: ::c_int = 16;
5358
 
5359
 pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
5360
 
5361
+pub const SOL_RXRPC: ::c_int = 272;
5362
+pub const SOL_PPPOL2TP: ::c_int = 273;
5363
+pub const SOL_BLUETOOTH: ::c_int = 274;
5364
+pub const SOL_PNPIPE: ::c_int = 275;
5365
+pub const SOL_RDS: ::c_int = 276;
5366
+pub const SOL_IUCV: ::c_int = 277;
5367
+pub const SOL_CAIF: ::c_int = 278;
5368
+pub const SOL_ALG: ::c_int = 279;
5369
+pub const SOL_NFC: ::c_int = 280;
5370
+
5371
+pub const MSG_TRYHARD: ::c_int = 4;
5372
+
5373
 pub const LC_PAPER: ::c_int = 7;
5374
 pub const LC_NAME: ::c_int = 8;
5375
 pub const LC_ADDRESS: ::c_int = 9;
5376
@@ -302,7 +314,6 @@ pub const TMPFS_MAGIC: ::c_long = 0x01021994;
5377
 pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
5378
 
5379
 pub const VEOF: usize = 4;
5380
-pub const IUTF8: ::tcflag_t = 0x00004000;
5381
 
5382
 pub const CPU_SETSIZE: ::c_int = 0x400;
5383
 
5384
diff --git third_party/rust/libc/src/unix/notbsd/linux/s390x.rs third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
5385
index b646647b255d..1c0cd56d6f14 100644
5386
--- third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
5387
+++ third_party/rust/libc/src/unix/notbsd/linux/s390x.rs
5388
@@ -86,7 +86,7 @@ s! {
5389
         pub sa_sigaction: ::sighandler_t,
5390
         __glibc_reserved0: ::c_int,
5391
         pub sa_flags: ::c_int,
5392
-        _restorer: *mut ::c_void,
5393
+        pub sa_restorer: ::dox::Option<extern fn()>,
5394
         pub sa_mask: sigset_t,
5395
     }
5396
 
5397
@@ -339,6 +339,7 @@ pub const SA_ONSTACK: ::c_int = 0x08000000;
5398
 pub const SA_SIGINFO: ::c_int = 4;
5399
 pub const SIGBUS: ::c_int = 7;
5400
 pub const SIGSTKSZ: ::size_t = 0x2000;
5401
+pub const MINSIGSTKSZ: ::size_t = 2048;
5402
 pub const SIG_SETMASK: ::c_int = 2;
5403
 pub const SOCK_DGRAM: ::c_int = 2;
5404
 pub const SOCK_STREAM: ::c_int = 1;
5405
@@ -576,7 +577,6 @@ pub const VMIN: usize = 6;
5406
 pub const IEXTEN: ::tcflag_t = 0x00008000;
5407
 pub const TOSTOP: ::tcflag_t = 0x00000100;
5408
 pub const FLUSHO: ::tcflag_t = 0x00001000;
5409
-pub const IUTF8: ::tcflag_t = 0x00004000;
5410
 
5411
 pub const CPU_SETSIZE: ::c_int = 0x400;
5412
 
5413
diff --git third_party/rust/libc/src/unix/notbsd/mod.rs third_party/rust/libc/src/unix/notbsd/mod.rs
5414
index 9e0916a09eca..e10d28b304d7 100644
5415
--- third_party/rust/libc/src/unix/notbsd/mod.rs
5416
+++ third_party/rust/libc/src/unix/notbsd/mod.rs
5417
@@ -120,7 +120,9 @@ s! {
5418
         pub dli_saddr: *mut ::c_void,
5419
     }
5420
 
5421
-    #[cfg_attr(any(all(target_arch = "x86", not(target_env = "musl")),
5422
+    #[cfg_attr(any(all(target_arch = "x86",
5423
+                       not(target_env = "musl"),
5424
+                       not(target_os = "android")),
5425
                    target_arch = "x86_64"),
5426
                repr(packed))]
5427
     pub struct epoll_event {
5428
@@ -253,6 +255,7 @@ pub const RUSAGE_SELF: ::c_int = 0;
5429
 pub const O_RDONLY: ::c_int = 0;
5430
 pub const O_WRONLY: ::c_int = 1;
5431
 pub const O_RDWR: ::c_int = 2;
5432
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
5433
 
5434
 pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
5435
 
5436
@@ -393,7 +396,9 @@ pub const EDOM: ::c_int = 33;
5437
 pub const ERANGE: ::c_int = 34;
5438
 pub const EWOULDBLOCK: ::c_int = EAGAIN;
5439
 
5440
-pub const AF_PACKET: ::c_int = 17;
5441
+pub const SCM_RIGHTS: ::c_int = 0x01;
5442
+pub const SCM_CREDENTIALS: ::c_int = 0x02;
5443
+
5444
 pub const IPPROTO_RAW: ::c_int = 255;
5445
 
5446
 pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
5447
@@ -430,12 +435,127 @@ pub const IFF_PORTSEL: ::c_int = 0x2000;
5448
 pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
5449
 pub const IFF_DYNAMIC: ::c_int = 0x8000;
5450
 
5451
+pub const SOL_IP: ::c_int = 0;
5452
+pub const SOL_TCP: ::c_int = 6;
5453
+pub const SOL_IPV6: ::c_int = 41;
5454
+pub const SOL_ICMPV6: ::c_int = 58;
5455
+pub const SOL_RAW: ::c_int = 255;
5456
+pub const SOL_DECNET: ::c_int = 261;
5457
+pub const SOL_X25: ::c_int = 262;
5458
+pub const SOL_PACKET: ::c_int = 263;
5459
+pub const SOL_ATM: ::c_int = 264;
5460
+pub const SOL_AAL: ::c_int = 265;
5461
+pub const SOL_IRDA: ::c_int = 266;
5462
+pub const SOL_NETBEUI: ::c_int = 267;
5463
+pub const SOL_LLC: ::c_int = 268;
5464
+pub const SOL_DCCP: ::c_int = 269;
5465
+pub const SOL_NETLINK: ::c_int = 270;
5466
+pub const SOL_TIPC: ::c_int = 271;
5467
+
5468
+pub const AF_UNSPEC: ::c_int = 0;
5469
 pub const AF_UNIX: ::c_int = 1;
5470
+pub const AF_LOCAL: ::c_int = 1;
5471
 pub const AF_INET: ::c_int = 2;
5472
+pub const AF_AX25: ::c_int = 3;
5473
+pub const AF_IPX: ::c_int = 4;
5474
+pub const AF_APPLETALK: ::c_int = 5;
5475
+pub const AF_NETROM: ::c_int = 6;
5476
+pub const AF_BRIDGE: ::c_int = 7;
5477
+pub const AF_ATMPVC: ::c_int = 8;
5478
+pub const AF_X25: ::c_int = 9;
5479
 pub const AF_INET6: ::c_int = 10;
5480
-pub const AF_UNSPEC: ::c_int = 0;
5481
+pub const AF_ROSE: ::c_int = 11;
5482
+pub const AF_DECnet: ::c_int = 12;
5483
+pub const AF_NETBEUI: ::c_int = 13;
5484
+pub const AF_SECURITY: ::c_int = 14;
5485
+pub const AF_KEY: ::c_int = 15;
5486
 pub const AF_NETLINK: ::c_int = 16;
5487
+pub const AF_ROUTE: ::c_int = AF_NETLINK;
5488
+pub const AF_PACKET: ::c_int = 17;
5489
+pub const AF_ASH: ::c_int = 18;
5490
+pub const AF_ECONET: ::c_int = 19;
5491
+pub const AF_ATMSVC: ::c_int = 20;
5492
+pub const AF_RDS: ::c_int = 21;
5493
+pub const AF_SNA: ::c_int = 22;
5494
+pub const AF_IRDA: ::c_int = 23;
5495
+pub const AF_PPPOX: ::c_int = 24;
5496
+pub const AF_WANPIPE: ::c_int = 25;
5497
+pub const AF_LLC: ::c_int = 26;
5498
+pub const AF_CAN: ::c_int = 29;
5499
+pub const AF_TIPC: ::c_int = 30;
5500
+pub const AF_BLUETOOTH: ::c_int = 31;
5501
+pub const AF_IUCV: ::c_int = 32;
5502
+pub const AF_RXRPC: ::c_int = 33;
5503
+pub const AF_ISDN: ::c_int = 34;
5504
+pub const AF_PHONET: ::c_int = 35;
5505
+pub const AF_IEEE802154: ::c_int = 36;
5506
+pub const AF_CAIF: ::c_int = 37;
5507
+pub const AF_ALG: ::c_int = 38;
5508
+
5509
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
5510
+pub const PF_UNIX: ::c_int = AF_UNIX;
5511
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
5512
+pub const PF_INET: ::c_int = AF_INET;
5513
+pub const PF_AX25: ::c_int = AF_AX25;
5514
+pub const PF_IPX: ::c_int = AF_IPX;
5515
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
5516
+pub const PF_NETROM: ::c_int = AF_NETROM;
5517
+pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
5518
+pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
5519
+pub const PF_X25: ::c_int = AF_X25;
5520
+pub const PF_INET6: ::c_int = AF_INET6;
5521
+pub const PF_ROSE: ::c_int = AF_ROSE;
5522
+pub const PF_DECnet: ::c_int = AF_DECnet;
5523
+pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
5524
+pub const PF_SECURITY: ::c_int = AF_SECURITY;
5525
+pub const PF_KEY: ::c_int = AF_KEY;
5526
+pub const PF_NETLINK: ::c_int = AF_NETLINK;
5527
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
5528
+pub const PF_PACKET: ::c_int = AF_PACKET;
5529
+pub const PF_ASH: ::c_int = AF_ASH;
5530
+pub const PF_ECONET: ::c_int = AF_ECONET;
5531
+pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
5532
+pub const PF_RDS: ::c_int = AF_RDS;
5533
+pub const PF_SNA: ::c_int = AF_SNA;
5534
+pub const PF_IRDA: ::c_int = AF_IRDA;
5535
+pub const PF_PPPOX: ::c_int = AF_PPPOX;
5536
+pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
5537
+pub const PF_LLC: ::c_int = AF_LLC;
5538
+pub const PF_CAN: ::c_int = AF_CAN;
5539
+pub const PF_TIPC: ::c_int = AF_TIPC;
5540
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
5541
+pub const PF_IUCV: ::c_int = AF_IUCV;
5542
+pub const PF_RXRPC: ::c_int = AF_RXRPC;
5543
+pub const PF_ISDN: ::c_int = AF_ISDN;
5544
+pub const PF_PHONET: ::c_int = AF_PHONET;
5545
+pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
5546
+pub const PF_CAIF: ::c_int = AF_CAIF;
5547
+pub const PF_ALG: ::c_int = AF_ALG;
5548
+
5549
+pub const SOMAXCONN: ::c_int = 128;
5550
+
5551
+pub const MSG_OOB: ::c_int = 1;
5552
+pub const MSG_PEEK: ::c_int = 2;
5553
+pub const MSG_DONTROUTE: ::c_int = 4;
5554
+pub const MSG_CTRUNC: ::c_int = 8;
5555
+pub const MSG_TRUNC: ::c_int = 0x20;
5556
+pub const MSG_DONTWAIT: ::c_int = 0x40;
5557
+pub const MSG_EOR: ::c_int = 0x80;
5558
+pub const MSG_WAITALL: ::c_int = 0x100;
5559
+pub const MSG_FIN: ::c_int = 0x200;
5560
+pub const MSG_SYN: ::c_int = 0x400;
5561
+pub const MSG_CONFIRM: ::c_int = 0x800;
5562
+pub const MSG_RST: ::c_int = 0x1000;
5563
+pub const MSG_ERRQUEUE: ::c_int = 0x2000;
5564
+pub const MSG_NOSIGNAL: ::c_int = 0x4000;
5565
+pub const MSG_MORE: ::c_int = 0x8000;
5566
+pub const MSG_WAITFORONE: ::c_int = 0x10000;
5567
+pub const MSG_FASTOPEN: ::c_int = 0x20000000;
5568
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
5569
+
5570
 pub const SOCK_RAW: ::c_int = 3;
5571
+pub const IPPROTO_ICMP: ::c_int = 1;
5572
+pub const IPPROTO_ICMPV6: ::c_int = 58;
5573
 pub const IPPROTO_TCP: ::c_int = 6;
5574
 pub const IPPROTO_IP: ::c_int = 0;
5575
 pub const IPPROTO_IPV6: ::c_int = 41;
5576
@@ -468,9 +588,6 @@ pub const IPV6_V6ONLY: ::c_int = 26;
5577
 
5578
 pub const SO_DEBUG: ::c_int = 1;
5579
 
5580
-pub const MSG_PEEK: ::c_int = 0x2;
5581
-pub const MSG_NOSIGNAL: ::c_int = 0x4000;
5582
-
5583
 pub const SHUT_RD: ::c_int = 0;
5584
 pub const SHUT_WR: ::c_int = 1;
5585
 pub const SHUT_RDWR: ::c_int = 2;
5586
@@ -558,6 +675,7 @@ pub const IGNCR: ::tcflag_t = 0x00000080;
5587
 pub const ICRNL: ::tcflag_t = 0x00000100;
5588
 pub const IXANY: ::tcflag_t = 0x00000800;
5589
 pub const IMAXBEL: ::tcflag_t = 0x00002000;
5590
+pub const IUTF8: ::tcflag_t = 0x00004000;
5591
 pub const OPOST: ::tcflag_t = 0x1;
5592
 pub const CS5: ::tcflag_t = 0x00000000;
5593
 pub const CRTSCTS: ::tcflag_t = 0x80000000;
5594
@@ -611,6 +729,10 @@ pub const POSIX_FADV_WILLNEED: ::c_int = 3;
5595
 
5596
 pub const AT_FDCWD: ::c_int = -100;
5597
 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
5598
+pub const AT_REMOVEDIR: ::c_int = 0x200;
5599
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
5600
+pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
5601
+pub const AT_EMPTY_PATH: ::c_int = 0x1000;
5602
 
5603
 pub const LOG_CRON: ::c_int = 9 << 3;
5604
 pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
5605
@@ -629,6 +751,9 @@ pub const P_ALL: idtype_t = 0;
5606
 pub const P_PID: idtype_t = 1;
5607
 pub const P_PGID: idtype_t = 2;
5608
 
5609
+pub const UTIME_OMIT: c_long = 1073741822;
5610
+pub const UTIME_NOW: c_long = 1073741823;
5611
+
5612
 f! {
5613
     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
5614
         let fd = fd as usize;
5615
@@ -664,6 +789,10 @@ f! {
5616
         (status >> 8) & 0xff
5617
     }
5618
 
5619
+    pub fn WIFCONTINUED(status: ::c_int) -> bool {
5620
+        status == 0xffff
5621
+    }
5622
+
5623
     pub fn WIFSIGNALED(status: ::c_int) -> bool {
5624
         ((status & 0x7f) + 1) as i8 >= 2
5625
     }
5626
@@ -706,6 +835,9 @@ extern {
5627
                            rqtp: *const ::timespec,
5628
                            rmtp:  *mut ::timespec) -> ::c_int;
5629
     pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
5630
+    pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
5631
+    pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
5632
+
5633
     pub fn prctl(option: ::c_int, ...) -> ::c_int;
5634
     pub fn pthread_getattr_np(native: ::pthread_t,
5635
                               attr: *mut ::pthread_attr_t) -> ::c_int;
5636
@@ -724,6 +856,9 @@ extern {
5637
     pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
5638
     pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
5639
     pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
5640
+    pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
5641
+    pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
5642
+    pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
5643
     pub fn epoll_create(size: ::c_int) -> ::c_int;
5644
     pub fn epoll_create1(flags: ::c_int) -> ::c_int;
5645
     pub fn epoll_ctl(epfd: ::c_int,
5646
@@ -796,48 +931,44 @@ extern {
5647
                   offset: off64_t)
5648
                   -> *mut ::c_void;
5649
     pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
5650
+    pub fn openat64(fd: ::c_int,
5651
+                    path: *const c_char,
5652
+                    oflag: ::c_int, ...) -> ::c_int;
5653
     pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
5654
                    offset: off64_t) -> ::ssize_t;
5655
     pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
5656
                     offset: off64_t) -> ::ssize_t;
5657
+    pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
5658
     pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
5659
                        result: *mut *mut ::dirent64) -> ::c_int;
5660
     pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
5661
     pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
5662
+    pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
5663
     pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
5664
     pub fn sysinfo (info: *mut ::sysinfo) -> ::c_int;
5665
 
5666
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
5667
-                  flags: ::c_int, ...) -> ::c_int;
5668
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
5669
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
5670
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
5671
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
5672
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
5673
-                    owner: ::uid_t, group: ::gid_t,
5674
-                    flags: ::c_int) -> ::c_int;
5675
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
5676
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
5677
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
5678
-                  newdirfd: ::c_int, newpath: *const ::c_char,
5679
-                  flags: ::c_int) -> ::c_int;
5680
-    pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
5681
-                   mode: ::mode_t) -> ::c_int;
5682
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
5683
+
5684
     pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
5685
                    mode: ::mode_t, dev: dev_t) -> ::c_int;
5686
-    pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
5687
-                      buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
5688
-    pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
5689
-                    newdirfd: ::c_int, newpath: *const ::c_char)
5690
-                    -> ::c_int;
5691
-    pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
5692
-                     linkpath: *const ::c_char) -> ::c_int;
5693
-    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
5694
-                    flags: ::c_int) -> ::c_int;
5695
+    pub fn ppoll(fds: *mut ::pollfd,
5696
+                 nfds: nfds_t,
5697
+                 timeout: *const ::timespec,
5698
+                 sigmask: *const sigset_t) -> ::c_int;
5699
     pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
5700
                                      clock_id: *mut clockid_t) -> ::c_int;
5701
     pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
5702
                                      clock_id: clockid_t) -> ::c_int;
5703
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
5704
+                                       pshared: ::c_int) -> ::c_int;
5705
+    pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
5706
+                                       pshared: *mut ::c_int) -> ::c_int;
5707
+    pub fn pthread_getschedparam(native: ::pthread_t,
5708
+                                 policy: *mut ::c_int,
5709
+                                 param: *mut ::sched_param) -> ::c_int;
5710
+    pub fn pthread_setschedparam(native: ::pthread_t,
5711
+                                 policy: ::c_int,
5712
+                                 param: *const ::sched_param) -> ::c_int;
5713
     pub fn sched_getaffinity(pid: ::pid_t,
5714
                              cpusetsize: ::size_t,
5715
                              cpuset: *mut cpu_set_t) -> ::c_int;
5716
@@ -852,12 +983,32 @@ extern {
5717
                    flg: ::c_int) -> ::c_int;
5718
     pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
5719
                                    abstime: *const ::timespec) -> ::c_int;
5720
+    pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
5721
+                                        pshared: ::c_int) -> ::c_int;
5722
+    pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
5723
+                                        pshared: *mut ::c_int) -> ::c_int;
5724
     pub fn ptsname_r(fd: ::c_int,
5725
                      buf: *mut ::c_char,
5726
                      buflen: ::size_t) -> ::c_int;
5727
     pub fn clearenv() -> ::c_int;
5728
     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
5729
                   options: ::c_int) -> ::c_int;
5730
+    pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
5731
+    pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
5732
+    pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
5733
+    pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t,
5734
+                     suid: *mut ::uid_t) -> ::c_int;
5735
+    pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t,
5736
+                     sgid: *mut ::gid_t) -> ::c_int;
5737
+    pub fn personality(persona: ::c_ulong) -> ::c_int;
5738
+    pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
5739
+    pub fn swapoff(puath: *const ::c_char) -> ::c_int;
5740
+    pub fn acct(filename: *const ::c_char) -> ::c_int;
5741
+    pub fn brk(addr: *mut ::c_void) -> ::c_int;
5742
+    pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
5743
+    pub fn vfork() -> ::pid_t;
5744
+    pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int,
5745
+                 rusage: *mut ::rusage) -> ::pid_t;
5746
 }
5747
 
5748
 cfg_if! {
5749
diff --git third_party/rust/libc/src/unix/solaris/mod.rs third_party/rust/libc/src/unix/solaris/mod.rs
5750
index b604208583a4..757d5817ed36 100644
5751
--- third_party/rust/libc/src/unix/solaris/mod.rs
5752
+++ third_party/rust/libc/src/unix/solaris/mod.rs
5753
@@ -1,36 +1,38 @@
5754
+use dox::{mem, Option};
5755
+
5756
 pub type c_char = i8;
5757
 pub type c_long = i64;
5758
 pub type c_ulong = u64;
5759
-pub type clockid_t = ::c_int;
5760
 
5761
-pub type blkcnt_t = i64;
5762
-pub type clock_t = i64;
5763
-pub type daddr_t = i64;
5764
-pub type dev_t = u64;
5765
-pub type fsblkcnt_t = u64;
5766
-pub type fsfilcnt_t = u64;
5767
-pub type ino_t = i64;
5768
-pub type key_t = i32;
5769
-pub type major_t = u32;
5770
-pub type minor_t = u32;
5771
-pub type mode_t = u32;
5772
-pub type nlink_t = u32;
5773
-pub type rlim_t = u64;
5774
-pub type speed_t = u32;
5775
-pub type tcflag_t = u32;
5776
-pub type time_t = i64;
5777
-pub type wchar_t = i32;
5778
+pub type clockid_t = ::c_int;
5779
+pub type blkcnt_t = ::c_long;
5780
+pub type clock_t = ::c_long;
5781
+pub type daddr_t = ::c_long;
5782
+pub type dev_t = ::c_ulong;
5783
+pub type fsblkcnt_t = ::c_ulong;
5784
+pub type fsfilcnt_t = ::c_ulong;
5785
+pub type ino_t = ::c_ulong;
5786
+pub type key_t = ::c_int;
5787
+pub type major_t = ::c_uint;
5788
+pub type minor_t = ::c_uint;
5789
+pub type mode_t = ::c_uint;
5790
+pub type nlink_t = ::c_uint;
5791
+pub type rlim_t = ::c_ulong;
5792
+pub type speed_t = ::c_uint;
5793
+pub type tcflag_t = ::c_uint;
5794
+pub type time_t = ::c_long;
5795
+pub type wchar_t = ::c_int;
5796
 pub type nfds_t = ::c_ulong;
5797
 
5798
 pub type suseconds_t = ::c_long;
5799
-pub type off_t = i64;
5800
+pub type off_t = ::c_long;
5801
 pub type useconds_t = ::c_uint;
5802
-pub type socklen_t = u32;
5803
-pub type sa_family_t = u8;
5804
-pub type pthread_t = ::uintptr_t;
5805
+pub type socklen_t = ::c_uint;
5806
+pub type sa_family_t = u16;
5807
+pub type pthread_t = ::c_uint;
5808
 pub type pthread_key_t = ::c_uint;
5809
-pub type blksize_t = u32;
5810
-pub type fflags_t = u32;
5811
+pub type blksize_t = ::c_int;
5812
+pub type fflags_t = ::c_int;
5813
 pub type nl_item = ::c_int;
5814
 pub type id_t = ::c_int;
5815
 pub type idtype_t = ::c_uint;
5816
@@ -123,6 +125,9 @@ s! {
5817
     }
5818
 
5819
     pub struct fd_set {
5820
+        #[cfg(target_pointer_width = "64")]
5821
+        fds_bits: [i64; FD_SETSIZE / 64],
5822
+        #[cfg(target_pointer_width = "32")]
5823
         fds_bits: [i32; FD_SETSIZE / 32],
5824
     }
5825
 
5826
@@ -335,6 +340,14 @@ s! {
5827
         pub if_index: ::c_uint,
5828
         pub if_name: *mut ::c_char,
5829
     }
5830
+
5831
+    pub struct port_event {
5832
+        pub portev_events: ::c_int,
5833
+        pub portev_source: ::c_ushort,
5834
+        pub portev_pad: ::c_ushort,
5835
+        pub portev_object: ::uintptr_t,
5836
+        pub portev_user: ::uintptr_t,
5837
+    }
5838
 }
5839
 
5840
 pub const LC_CTYPE: ::c_int = 0;
5841
@@ -436,7 +449,13 @@ pub const SA_NOCLDSTOP: ::c_int = 0x00020000;
5842
 pub const SS_ONSTACK: ::c_int = 1;
5843
 pub const SS_DISABLE: ::c_int = 2;
5844
 
5845
+pub const FIOCLEX: ::c_int = 0x20006601;
5846
+pub const FIONCLEX: ::c_int = 0x20006602;
5847
+pub const FIONREAD: ::c_int = 0x4004667f;
5848
 pub const FIONBIO: ::c_int = 0x8004667e;
5849
+pub const FIOASYNC: ::c_int = 0x8004667d;
5850
+pub const FIOSETOWN: ::c_int = 0x8004667c;
5851
+pub const FIOGETOWN: ::c_int = 0x4004667b;
5852
 
5853
 pub const SIGCHLD: ::c_int = 18;
5854
 pub const SIGBUS: ::c_int = 10;
5855
@@ -448,7 +467,13 @@ pub const SIG_SETMASK: ::c_int = 3;
5856
 pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8;
5857
 pub const IPV6_V6ONLY: ::c_int = 0x27;
5858
 
5859
-pub const FD_SETSIZE: usize = 1024;
5860
+cfg_if! {
5861
+    if #[cfg(target_pointer_width = "64")] {
5862
+        pub const FD_SETSIZE: usize = 65536;
5863
+    } else {
5864
+        pub const FD_SETSIZE: usize = 1024;
5865
+    }
5866
+}
5867
 
5868
 pub const ST_RDONLY: ::c_ulong = 1;
5869
 pub const ST_NOSUID: ::c_ulong = 2;
5870
@@ -474,6 +499,8 @@ pub const TMP_MAX: ::c_uint = 17576;
5871
 pub const O_RDONLY: ::c_int = 0;
5872
 pub const O_WRONLY: ::c_int = 1;
5873
 pub const O_RDWR: ::c_int = 2;
5874
+pub const O_SEARCH: ::c_int = 0x200000;
5875
+pub const O_EXEC: ::c_int = 0x400000;
5876
 pub const O_APPEND: ::c_int = 8;
5877
 pub const O_CREAT: ::c_int = 256;
5878
 pub const O_EXCL: ::c_int = 1024;
5879
@@ -598,7 +625,7 @@ pub const E2BIG: ::c_int = 7;
5880
 pub const ENOEXEC: ::c_int = 8;
5881
 pub const EBADF: ::c_int = 9;
5882
 pub const ECHILD: ::c_int = 10;
5883
-pub const EDEADLK: ::c_int = 45;
5884
+pub const EAGAIN: ::c_int = 11;
5885
 pub const ENOMEM: ::c_int = 12;
5886
 pub const EACCES: ::c_int = 13;
5887
 pub const EFAULT: ::c_int = 14;
5888
@@ -622,11 +649,65 @@ pub const EMLINK: ::c_int = 31;
5889
 pub const EPIPE: ::c_int = 32;
5890
 pub const EDOM: ::c_int = 33;
5891
 pub const ERANGE: ::c_int = 34;
5892
+pub const ENOMSG: ::c_int = 35;
5893
+pub const EIDRM: ::c_int = 36;
5894
+pub const ECHRNG: ::c_int = 37;
5895
+pub const EL2NSYNC: ::c_int = 38;
5896
+pub const EL3HLT: ::c_int = 39;
5897
+pub const EL3RST: ::c_int = 40;
5898
+pub const ELNRNG: ::c_int = 41;
5899
+pub const EUNATCH: ::c_int = 42;
5900
+pub const ENOCSI: ::c_int = 43;
5901
+pub const EL2HLT: ::c_int = 44;
5902
+pub const EDEADLK: ::c_int = 45;
5903
+pub const ENOLCK: ::c_int = 46;
5904
+pub const ECANCELED: ::c_int = 47;
5905
 pub const ENOTSUP: ::c_int = 48;
5906
-pub const EAGAIN: ::c_int = 11;
5907
-pub const EWOULDBLOCK: ::c_int = 11;
5908
-pub const EINPROGRESS: ::c_int = 150;
5909
-pub const EALREADY: ::c_int = 149;
5910
+pub const EDQUOT: ::c_int = 49;
5911
+pub const EBADE: ::c_int = 50;
5912
+pub const EBADR: ::c_int = 51;
5913
+pub const EXFULL: ::c_int = 52;
5914
+pub const ENOANO: ::c_int = 53;
5915
+pub const EBADRQC: ::c_int = 54;
5916
+pub const EBADSLT: ::c_int = 55;
5917
+pub const EDEADLOCK: ::c_int = 56;
5918
+pub const EBFONT: ::c_int = 57;
5919
+pub const EOWNERDEAD: ::c_int = 58;
5920
+pub const ENOTRECOVERABLE: ::c_int = 59;
5921
+pub const ENOSTR: ::c_int = 60;
5922
+pub const ENODATA: ::c_int = 61;
5923
+pub const ETIME: ::c_int = 62;
5924
+pub const ENOSR: ::c_int = 63;
5925
+pub const ENONET: ::c_int = 64;
5926
+pub const ENOPKG: ::c_int = 65;
5927
+pub const EREMOTE: ::c_int = 66;
5928
+pub const ENOLINK: ::c_int = 67;
5929
+pub const EADV: ::c_int = 68;
5930
+pub const ESRMNT: ::c_int = 69;
5931
+pub const ECOMM: ::c_int = 70;
5932
+pub const EPROTO: ::c_int = 71;
5933
+pub const ELOCKUNMAPPED: ::c_int = 72;
5934
+pub const ENOTACTIVE: ::c_int = 73;
5935
+pub const EMULTIHOP: ::c_int = 74;
5936
+pub const EADI: ::c_int = 75;
5937
+pub const EBADMSG: ::c_int = 77;
5938
+pub const ENAMETOOLONG: ::c_int = 78;
5939
+pub const EOVERFLOW: ::c_int = 79;
5940
+pub const ENOTUNIQ: ::c_int = 80;
5941
+pub const EBADFD: ::c_int = 81;
5942
+pub const EREMCHG: ::c_int = 82;
5943
+pub const ELIBACC: ::c_int = 83;
5944
+pub const ELIBBAD: ::c_int = 84;
5945
+pub const ELIBSCN: ::c_int = 85;
5946
+pub const ELIBMAX: ::c_int = 86;
5947
+pub const ELIBEXEC: ::c_int = 87;
5948
+pub const EILSEQ: ::c_int = 88;
5949
+pub const ENOSYS: ::c_int = 89;
5950
+pub const ELOOP: ::c_int = 90;
5951
+pub const ERESTART: ::c_int = 91;
5952
+pub const ESTRPIPE: ::c_int = 92;
5953
+pub const ENOTEMPTY: ::c_int = 93;
5954
+pub const EUSERS: ::c_int = 94;
5955
 pub const ENOTSOCK: ::c_int = 95;
5956
 pub const EDESTADDRREQ: ::c_int = 96;
5957
 pub const EMSGSIZE: ::c_int = 97;
5958
@@ -651,26 +732,11 @@ pub const ESHUTDOWN: ::c_int = 143;
5959
 pub const ETOOMANYREFS: ::c_int = 144;
5960
 pub const ETIMEDOUT: ::c_int = 145;
5961
 pub const ECONNREFUSED: ::c_int = 146;
5962
-pub const ELOOP: ::c_int = 90;
5963
-pub const ENAMETOOLONG: ::c_int = 78;
5964
 pub const EHOSTDOWN: ::c_int = 147;
5965
 pub const EHOSTUNREACH: ::c_int = 148;
5966
-pub const ENOTEMPTY: ::c_int = 93;
5967
-pub const EUSERS: ::c_int = 94;
5968
-pub const EDQUOT: ::c_int = 49;
5969
-pub const ESTALE: ::c_int = 151;
5970
-pub const EREMOTE: ::c_int = 66;
5971
-pub const ENOLCK: ::c_int = 46;
5972
-pub const ENOSYS: ::c_int = 89;
5973
-pub const EIDRM: ::c_int = 36;
5974
-pub const ENOMSG: ::c_int = 35;
5975
-pub const EOVERFLOW: ::c_int = 79;
5976
-pub const ECANCELED: ::c_int = 47;
5977
-pub const EILSEQ: ::c_int = 88;
5978
-pub const EBADMSG: ::c_int = 77;
5979
-pub const EMULTIHOP: ::c_int = 74;
5980
-pub const ENOLINK: ::c_int = 67;
5981
-pub const EPROTO: ::c_int = 71;
5982
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
5983
+pub const EALREADY: ::c_int = 149;
5984
+pub const EINPROGRESS: ::c_int = 150;
5985
 
5986
 pub const EAI_SYSTEM: ::c_int = 11;
5987
 
5988
@@ -782,6 +848,8 @@ pub const SOCK_STREAM: ::c_int = 2;
5989
 pub const SOCK_RAW: ::c_int = 4;
5990
 pub const SOCK_RDM: ::c_int = 5;
5991
 pub const SOCK_SEQPACKET: ::c_int = 6;
5992
+pub const IPPROTO_ICMP: ::c_int = 1;
5993
+pub const IPPROTO_ICMPV6: ::c_int = 58;
5994
 pub const IPPROTO_TCP: ::c_int = 6;
5995
 pub const IPPROTO_IP: ::c_int = 0;
5996
 pub const IPPROTO_IPV6: ::c_int = 41;
5997
@@ -815,6 +883,8 @@ pub const SO_RCVTIMEO: ::c_int = 0x1006;
5998
 pub const SO_ERROR: ::c_int = 0x1007;
5999
 pub const SO_TYPE: ::c_int = 0x1008;
6000
 
6001
+pub const MSG_PEEK: ::c_int = 0x2;
6002
+
6003
 pub const IFF_LOOPBACK: ::c_int = 0x8;
6004
 
6005
 pub const SHUT_RD: ::c_int = 0;
6006
@@ -942,21 +1012,34 @@ pub const RTLD_NODELETE: ::c_int = 0x1000;
6007
 pub const RTLD_FIRST: ::c_int = 0x2000;
6008
 pub const RTLD_CONFGEN: ::c_int = 0x10000;
6009
 
6010
+pub const PORT_SOURCE_AIO: ::c_int = 1;
6011
+pub const PORT_SOURCE_TIMER: ::c_int = 2;
6012
+pub const PORT_SOURCE_USER: ::c_int = 3;
6013
+pub const PORT_SOURCE_FD: ::c_int = 4;
6014
+pub const PORT_SOURCE_ALERT: ::c_int = 5;
6015
+pub const PORT_SOURCE_MQ: ::c_int = 6;
6016
+pub const PORT_SOURCE_FILE: ::c_int = 7;
6017
+pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
6018
+pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
6019
+
6020
 f! {
6021
     pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
6022
+        let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
6023
         let fd = fd as usize;
6024
-        (*set).fds_bits[fd / 32] &= !(1 << (fd % 32));
6025
+        (*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
6026
         return
6027
     }
6028
 
6029
     pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
6030
+        let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
6031
         let fd = fd as usize;
6032
-        return ((*set).fds_bits[fd / 32] & (1 << (fd % 32))) != 0
6033
+        return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
6034
     }
6035
 
6036
     pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
6037
+        let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;
6038
         let fd = fd as usize;
6039
-        (*set).fds_bits[fd / 32] |= 1 << (fd % 32);
6040
+        (*set).fds_bits[fd / bits] |= 1 << (fd % bits);
6041
         return
6042
     }
6043
 
6044
@@ -1005,17 +1088,21 @@ extern {
6045
                        serv: *mut ::c_char,
6046
                        sevlen: ::socklen_t,
6047
                        flags: ::c_int) -> ::c_int;
6048
+    #[link_name = "__posix_getpwnam_r"]
6049
     pub fn getpwnam_r(name: *const ::c_char,
6050
                       pwd: *mut passwd,
6051
                       buf: *mut ::c_char,
6052
-                      buflen: ::c_int) -> *const passwd;
6053
+                      buflen: ::size_t,
6054
+                      result: *mut *mut passwd) -> ::c_int;
6055
+
6056
+    #[link_name = "__posix_getpwuid_r"]
6057
     pub fn getpwuid_r(uid: ::uid_t,
6058
                       pwd: *mut passwd,
6059
                       buf: *mut ::c_char,
6060
-                      buflen: ::c_int) -> *const passwd;
6061
+                      buflen: ::size_t,
6062
+                      result: *mut *mut passwd) -> ::c_int;
6063
     pub fn setpwent();
6064
     pub fn getpwent() -> *mut passwd;
6065
-    pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
6066
     pub fn fdatasync(fd: ::c_int) -> ::c_int;
6067
     pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
6068
     pub fn duplocale(base: ::locale_t) -> ::locale_t;
6069
@@ -1030,33 +1117,10 @@ extern {
6070
     pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
6071
     pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
6072
 
6073
-    pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
6074
-                  flags: ::c_int, ...) -> ::c_int;
6075
-    pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
6076
-                     mode: ::c_int, flags: ::c_int) -> ::c_int;
6077
-    pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
6078
-                    mode: ::mode_t, flags: ::c_int) -> ::c_int;
6079
-    pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
6080
-                    owner: ::uid_t, group: ::gid_t,
6081
-                    flags: ::c_int) -> ::c_int;
6082
-    pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
6083
-                   buf: *mut stat, flags: ::c_int) -> ::c_int;
6084
-    pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
6085
-                  newdirfd: ::c_int, newpath: *const ::c_char,
6086
-                  flags: ::c_int) -> ::c_int;
6087
-    pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
6088
-                   mode: ::mode_t) -> ::c_int;
6089
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
6090
+
6091
     pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
6092
                    mode: ::mode_t, dev: dev_t) -> ::c_int;
6093
-    pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
6094
-                      buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
6095
-    pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
6096
-                    newdirfd: ::c_int, newpath: *const ::c_char)
6097
-                    -> ::c_int;
6098
-    pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
6099
-                     linkpath: *const ::c_char) -> ::c_int;
6100
-    pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
6101
-                    flags: ::c_int) -> ::c_int;
6102
     pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
6103
                     mode: ::mode_t) -> ::c_int;
6104
     pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
6105
@@ -1072,4 +1136,59 @@ extern {
6106
                                    abstime: *const ::timespec) -> ::c_int;
6107
     pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
6108
                   options: ::c_int) -> ::c_int;
6109
+
6110
+    pub fn glob(pattern: *const ::c_char,
6111
+                flags: ::c_int,
6112
+                errfunc: Option<extern fn(epath: *const ::c_char,
6113
+                                          errno: ::c_int) -> ::c_int>,
6114
+                pglob: *mut ::glob_t) -> ::c_int;
6115
+
6116
+    pub fn globfree(pglob: *mut ::glob_t);
6117
+
6118
+    pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
6119
+                         -> ::c_int;
6120
+
6121
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
6122
+
6123
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
6124
+
6125
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
6126
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
6127
+                  -> ::c_int;
6128
+
6129
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
6130
+
6131
+    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
6132
+                    flags: ::c_int, addr: *mut ::sockaddr,
6133
+                    addrlen: *mut ::socklen_t) -> ::ssize_t;
6134
+    pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
6135
+    pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
6136
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
6137
+
6138
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
6139
+                address_len: ::socklen_t) -> ::c_int;
6140
+
6141
+    pub fn writev(fd: ::c_int,
6142
+                  iov: *const ::iovec,
6143
+                  iovcnt: ::c_int) -> ::ssize_t;
6144
+    pub fn readv(fd: ::c_int,
6145
+                 iov: *const ::iovec,
6146
+                 iovcnt: ::c_int) -> ::ssize_t;
6147
+
6148
+    pub fn sendmsg(fd: ::c_int,
6149
+                   msg: *const ::msghdr,
6150
+                   flags: ::c_int) -> ::ssize_t;
6151
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
6152
+                   -> ::ssize_t;
6153
+
6154
+    pub fn port_create() -> ::c_int;
6155
+    pub fn port_associate(port: ::c_int, source: ::c_int, object: ::uintptr_t,
6156
+                          events: ::c_int, user: ::uintptr_t) -> ::c_int;
6157
+    pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t)
6158
+                           -> ::c_int;
6159
+    pub fn port_get(port: ::c_int, pe: *mut port_event,
6160
+                    timeout: *const ::timespec) -> ::c_int;
6161
+    pub fn port_getn(port: ::c_int, pe_list: *mut port_event, max: ::c_uint,
6162
+                     nget: *mut ::c_uint, timeout: *const ::timespec)
6163
+                     -> ::c_int;
6164
 }
6165
diff --git third_party/rust/libc/src/unix/uclibc/mips/mips32.rs third_party/rust/libc/src/unix/uclibc/mips/mips32.rs
6166
new file mode 100644
6167
index 000000000000..a81e884e0bc6
6168
--- /dev/null
6169
+++ third_party/rust/libc/src/unix/uclibc/mips/mips32.rs
6170
@@ -0,0 +1,269 @@
6171
+pub type c_char = i8;
6172
+pub type c_long = i32;
6173
+pub type c_ulong = u32;
6174
+pub type clock_t = i32;
6175
+pub type time_t = i32;
6176
+pub type suseconds_t = i32;
6177
+pub type wchar_t = i32;
6178
+pub type off_t = i32;
6179
+pub type ino_t = u32;
6180
+pub type blkcnt_t = i32;
6181
+pub type blksize_t = i32;
6182
+pub type nlink_t = u32;
6183
+pub type fsblkcnt_t = ::c_ulong;
6184
+pub type fsfilcnt_t = ::c_ulong;
6185
+pub type rlim_t = c_ulong;
6186
+
6187
+s! {
6188
+    pub struct stat {
6189
+        pub st_dev: ::dev_t,
6190
+        st_pad1: [::c_long; 2],
6191
+        pub st_ino: ::ino_t,
6192
+        pub st_mode: ::mode_t,
6193
+        pub st_nlink: ::nlink_t,
6194
+        pub st_uid: ::uid_t,
6195
+        pub st_gid: ::gid_t,
6196
+        pub st_rdev: ::dev_t,
6197
+        pub st_pad2: [::c_long; 1],
6198
+        pub st_size: ::off_t,
6199
+        st_pad3: ::c_long,
6200
+        pub st_atime: ::time_t,
6201
+        pub st_atime_nsec: ::c_long,
6202
+        pub st_mtime: ::time_t,
6203
+        pub st_mtime_nsec: ::c_long,
6204
+        pub st_ctime: ::time_t,
6205
+        pub st_ctime_nsec: ::c_long,
6206
+        pub st_blksize: ::blksize_t,
6207
+        pub st_blocks: ::blkcnt_t,
6208
+        st_pad5: [::c_long; 14],
6209
+    }
6210
+
6211
+    pub struct stat64 {
6212
+        pub st_dev: ::dev_t,
6213
+        st_pad1: [::c_long; 2],
6214
+        pub st_ino: ::ino64_t,
6215
+        pub st_mode: ::mode_t,
6216
+        pub st_nlink: ::nlink_t,
6217
+        pub st_uid: ::uid_t,
6218
+        pub st_gid: ::gid_t,
6219
+        pub st_rdev: ::dev_t,
6220
+        st_pad2: [::c_long; 2],
6221
+        pub st_size: ::off64_t,
6222
+        pub st_atime: ::time_t,
6223
+        pub st_atime_nsec: ::c_long,
6224
+        pub st_mtime: ::time_t,
6225
+        pub st_mtime_nsec: ::c_long,
6226
+        pub st_ctime: ::time_t,
6227
+        pub st_ctime_nsec: ::c_long,
6228
+        pub st_blksize: ::blksize_t,
6229
+        st_pad3: ::c_long,
6230
+        pub st_blocks: ::blkcnt64_t,
6231
+        st_pad5: [::c_long; 14],
6232
+    }
6233
+
6234
+    pub struct pthread_attr_t {
6235
+        __size: [u32; 9]
6236
+    }
6237
+
6238
+    pub struct sigaction {
6239
+        pub sa_flags: ::c_uint,
6240
+        pub sa_sigaction: ::sighandler_t,
6241
+        pub sa_mask: sigset_t,
6242
+        _restorer: *mut ::c_void,
6243
+    }
6244
+
6245
+    pub struct stack_t {
6246
+        pub ss_sp: *mut ::c_void,
6247
+        pub ss_size: ::size_t,
6248
+        pub ss_flags: ::c_int,
6249
+    }
6250
+
6251
+    pub struct sigset_t {
6252
+        __val: [::c_ulong; 4],
6253
+    }
6254
+
6255
+    pub struct siginfo_t {
6256
+        pub si_signo: ::c_int,
6257
+        pub si_code: ::c_int,
6258
+        pub si_errno: ::c_int,
6259
+        pub _pad: [::c_int; 29],
6260
+    }
6261
+
6262
+    pub struct glob64_t {
6263
+        pub gl_pathc: ::size_t,
6264
+        pub gl_pathv: *mut *mut ::c_char,
6265
+        pub gl_offs: ::size_t,
6266
+        pub gl_flags: ::c_int,
6267
+
6268
+        __unused1: *mut ::c_void,
6269
+        __unused2: *mut ::c_void,
6270
+        __unused3: *mut ::c_void,
6271
+        __unused4: *mut ::c_void,
6272
+        __unused5: *mut ::c_void,
6273
+    }
6274
+
6275
+    pub struct ipc_perm {
6276
+        pub __key: ::key_t,
6277
+        pub uid: ::uid_t,
6278
+        pub gid: ::gid_t,
6279
+        pub cuid: ::uid_t,
6280
+        pub cgid: ::gid_t,
6281
+        pub mode: ::c_uint,
6282
+        pub __seq: ::c_ushort,
6283
+        __pad1: ::c_ushort,
6284
+        __unused1: ::c_ulong,
6285
+        __unused2: ::c_ulong
6286
+    }
6287
+
6288
+    pub struct shmid_ds {
6289
+        pub shm_perm: ::ipc_perm,
6290
+        pub shm_segsz: ::size_t,
6291
+        pub shm_atime: ::time_t,
6292
+        pub shm_dtime: ::time_t,
6293
+        pub shm_ctime: ::time_t,
6294
+        pub shm_cpid: ::pid_t,
6295
+        pub shm_lpid: ::pid_t,
6296
+        pub shm_nattch: ::shmatt_t,
6297
+        __unused4: ::c_ulong,
6298
+        __unused5: ::c_ulong
6299
+    }
6300
+
6301
+    pub struct msqid_ds {
6302
+        pub msg_perm: ::ipc_perm,
6303
+        #[cfg(target_endian = "big")]
6304
+        __glibc_reserved1: ::c_ulong,
6305
+        pub msg_stime: ::time_t,
6306
+        #[cfg(target_endian = "little")]
6307
+        __glibc_reserved1: ::c_ulong,
6308
+        #[cfg(target_endian = "big")]
6309
+        __glibc_reserved2: ::c_ulong,
6310
+        pub msg_rtime: ::time_t,
6311
+        #[cfg(target_endian = "little")]
6312
+        __glibc_reserved2: ::c_ulong,
6313
+        #[cfg(target_endian = "big")]
6314
+        __glibc_reserved3: ::c_ulong,
6315
+        pub msg_ctime: ::time_t,
6316
+        #[cfg(target_endian = "little")]
6317
+        __glibc_reserved3: ::c_ulong,
6318
+        __msg_cbytes: ::c_ulong,
6319
+        pub msg_qnum: ::msgqnum_t,
6320
+        pub msg_qbytes: ::msglen_t,
6321
+        pub msg_lspid: ::pid_t,
6322
+        pub msg_lrpid: ::pid_t,
6323
+        __glibc_reserved4: ::c_ulong,
6324
+        __glibc_reserved5: ::c_ulong,
6325
+    }
6326
+
6327
+    pub struct statfs {
6328
+        pub f_type: ::c_long,
6329
+        pub f_bsize: ::c_long,
6330
+        pub f_frsize: ::c_long,
6331
+        pub f_blocks: ::fsblkcnt_t,
6332
+        pub f_bfree: ::fsblkcnt_t,
6333
+        pub f_files: ::fsblkcnt_t,
6334
+        pub f_ffree: ::fsblkcnt_t,
6335
+        pub f_bavail: ::fsblkcnt_t,
6336
+        pub f_fsid: ::fsid_t,
6337
+
6338
+        pub f_namelen: ::c_long,
6339
+        f_spare: [::c_long; 6],
6340
+    }
6341
+
6342
+    pub struct msghdr {
6343
+        pub msg_name: *mut ::c_void,
6344
+        pub msg_namelen: ::socklen_t,
6345
+        pub msg_iov: *mut ::iovec,
6346
+        pub msg_iovlen: ::c_int,
6347
+        pub msg_control: *mut ::c_void,
6348
+        pub msg_controllen: ::size_t,
6349
+        pub msg_flags: ::c_int,
6350
+    }
6351
+
6352
+    pub struct cmsghdr {
6353
+        pub cmsg_len: ::size_t,
6354
+        pub cmsg_level: ::c_int,
6355
+        pub cmsg_type: ::c_int,
6356
+    }
6357
+
6358
+    pub struct termios {
6359
+        pub c_iflag: ::tcflag_t,
6360
+        pub c_oflag: ::tcflag_t,
6361
+        pub c_cflag: ::tcflag_t,
6362
+        pub c_lflag: ::tcflag_t,
6363
+        pub c_line: ::cc_t,
6364
+        pub c_cc: [::cc_t; ::NCCS],
6365
+    }
6366
+
6367
+    pub struct flock {
6368
+        pub l_type: ::c_short,
6369
+        pub l_whence: ::c_short,
6370
+        pub l_start: ::off_t,
6371
+        pub l_len: ::off_t,
6372
+        pub l_sysid: ::c_long,
6373
+        pub l_pid: ::pid_t,
6374
+        pad: [::c_long; 4],
6375
+    }
6376
+
6377
+    pub struct sysinfo {
6378
+        pub uptime: ::c_long,
6379
+        pub loads: [::c_ulong; 3],
6380
+        pub totalram: ::c_ulong,
6381
+        pub freeram: ::c_ulong,
6382
+        pub sharedram: ::c_ulong,
6383
+        pub bufferram: ::c_ulong,
6384
+        pub totalswap: ::c_ulong,
6385
+        pub freeswap: ::c_ulong,
6386
+        pub procs: ::c_ushort,
6387
+        pub pad: ::c_ushort,
6388
+        pub totalhigh: ::c_ulong,
6389
+        pub freehigh: ::c_ulong,
6390
+        pub mem_unit: ::c_uint,
6391
+        pub _f: [::c_char; 8],
6392
+    }
6393
+
6394
+    // FIXME this is actually a union
6395
+    pub struct sem_t {
6396
+        #[cfg(target_pointer_width = "32")]
6397
+        __size: [::c_char; 16],
6398
+        #[cfg(target_pointer_width = "64")]
6399
+        __size: [::c_char; 32],
6400
+        __align: [::c_long; 0],
6401
+    }
6402
+}
6403
+
6404
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
6405
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
6406
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
6407
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
6408
+
6409
+pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
6410
+
6411
+pub const SYS_gettid: ::c_long = 4222;   // Valid for O32
6412
+
6413
+#[link(name = "util")]
6414
+extern {
6415
+    pub fn sysctl(name: *mut ::c_int,
6416
+                  namelen: ::c_int,
6417
+                  oldp: *mut ::c_void,
6418
+                  oldlenp: *mut ::size_t,
6419
+                  newp: *mut ::c_void,
6420
+                  newlen: ::size_t)
6421
+                  -> ::c_int;
6422
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
6423
+    pub fn backtrace(buf: *mut *mut ::c_void,
6424
+                     sz: ::c_int) -> ::c_int;
6425
+    pub fn glob64(pattern: *const ::c_char,
6426
+                  flags: ::c_int,
6427
+                  errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
6428
+                                                   errno: ::c_int)
6429
+                                                   -> ::c_int>,
6430
+                  pglob: *mut glob64_t) -> ::c_int;
6431
+    pub fn globfree64(pglob: *mut glob64_t);
6432
+    pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
6433
+    pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
6434
+                                       cpusetsize: ::size_t,
6435
+                                       cpuset: *mut ::cpu_set_t) -> ::c_int;
6436
+    pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
6437
+                                       cpusetsize: ::size_t,
6438
+                                       cpuset: *const ::cpu_set_t) -> ::c_int;
6439
+}
6440
diff --git third_party/rust/libc/src/unix/uclibc/mips/mips64.rs third_party/rust/libc/src/unix/uclibc/mips/mips64.rs
6441
new file mode 100644
6442
index 000000000000..79bac1fa8a47
6443
--- /dev/null
6444
+++ third_party/rust/libc/src/unix/uclibc/mips/mips64.rs
6445
@@ -0,0 +1,209 @@
6446
+pub type blkcnt_t = i64;
6447
+pub type blksize_t = i64;
6448
+pub type c_char = i8;
6449
+pub type c_long = i64;
6450
+pub type c_ulong = u64;
6451
+pub type fsblkcnt_t = ::c_ulong;
6452
+pub type fsfilcnt_t = ::c_ulong;
6453
+pub type ino_t = u64;
6454
+pub type nlink_t = u64;
6455
+pub type off_t = i64;
6456
+pub type rlim_t = ::c_ulong;
6457
+pub type suseconds_t = i64;
6458
+pub type time_t = i64;
6459
+pub type wchar_t = i32;
6460
+
6461
+s! {
6462
+    pub struct stat {
6463
+        pub st_dev: ::c_ulong,
6464
+        st_pad1: [::c_long; 2],
6465
+        pub st_ino: ::ino_t,
6466
+        pub st_mode: ::mode_t,
6467
+        pub st_nlink: ::nlink_t,
6468
+        pub st_uid: ::uid_t,
6469
+        pub st_gid: ::gid_t,
6470
+        pub st_rdev: ::c_ulong,
6471
+        st_pad2: [::c_ulong; 1],
6472
+        pub st_size: ::off_t,
6473
+        st_pad3: ::c_long,
6474
+        pub st_atime: ::time_t,
6475
+        pub st_atime_nsec: ::c_long,
6476
+        pub st_mtime: ::time_t,
6477
+        pub st_mtime_nsec: ::c_long,
6478
+        pub st_ctime: ::time_t,
6479
+        pub st_ctime_nsec: ::c_long,
6480
+        pub st_blksize: ::blksize_t,
6481
+        st_pad4: ::c_long,
6482
+        pub st_blocks: ::blkcnt_t,
6483
+        st_pad5: [::c_long; 7],
6484
+    }
6485
+
6486
+    pub struct stat64 {
6487
+        pub st_dev: ::c_ulong,
6488
+        st_pad1: [::c_long; 2],
6489
+        pub st_ino: ::ino64_t,
6490
+        pub st_mode: ::mode_t,
6491
+        pub st_nlink: ::nlink_t,
6492
+        pub st_uid: ::uid_t,
6493
+        pub st_gid: ::gid_t,
6494
+        pub st_rdev: ::c_ulong,
6495
+        st_pad2: [::c_long; 2],
6496
+        pub st_size: ::off64_t,
6497
+        pub st_atime: ::time_t,
6498
+        pub st_atime_nsec: ::c_long,
6499
+        pub st_mtime: ::time_t,
6500
+        pub st_mtime_nsec: ::c_long,
6501
+        pub st_ctime: ::time_t,
6502
+        pub st_ctime_nsec: ::c_long,
6503
+        pub st_blksize: ::blksize_t,
6504
+        st_pad3: ::c_long,
6505
+        pub st_blocks: ::blkcnt64_t,
6506
+        st_pad5: [::c_long; 7],
6507
+    }
6508
+
6509
+    pub struct pthread_attr_t {
6510
+        __size: [::c_ulong; 7]
6511
+    }
6512
+
6513
+    pub struct sigaction {
6514
+        pub sa_flags: ::c_int,
6515
+        pub sa_sigaction: ::sighandler_t,
6516
+        pub sa_mask: sigset_t,
6517
+        _restorer: *mut ::c_void,
6518
+    }
6519
+
6520
+    pub struct stack_t {
6521
+        pub ss_sp: *mut ::c_void,
6522
+        pub ss_size: ::size_t,
6523
+        pub ss_flags: ::c_int,
6524
+    }
6525
+
6526
+    pub struct sigset_t {
6527
+        __size: [::c_ulong; 16],
6528
+    }
6529
+
6530
+    pub struct siginfo_t {
6531
+        pub si_signo: ::c_int,
6532
+        pub si_code: ::c_int,
6533
+        pub si_errno: ::c_int,
6534
+        _pad: ::c_int,
6535
+        _pad2: [::c_long; 14],
6536
+    }
6537
+
6538
+    pub struct ipc_perm {
6539
+        pub __key: ::key_t,
6540
+        pub uid: ::uid_t,
6541
+        pub gid: ::gid_t,
6542
+        pub cuid: ::uid_t,
6543
+        pub cgid: ::gid_t,
6544
+        pub mode: ::c_uint,
6545
+        pub __seq: ::c_ushort,
6546
+        __pad1: ::c_ushort,
6547
+        __unused1: ::c_ulong,
6548
+        __unused2: ::c_ulong
6549
+    }
6550
+
6551
+    pub struct shmid_ds {
6552
+        pub shm_perm: ::ipc_perm,
6553
+        pub shm_segsz: ::size_t,
6554
+        pub shm_atime: ::time_t,
6555
+        pub shm_dtime: ::time_t,
6556
+        pub shm_ctime: ::time_t,
6557
+        pub shm_cpid: ::pid_t,
6558
+        pub shm_lpid: ::pid_t,
6559
+        pub shm_nattch: ::shmatt_t,
6560
+        __unused4: ::c_ulong,
6561
+        __unused5: ::c_ulong
6562
+    }
6563
+
6564
+    pub struct msqid_ds {
6565
+        pub msg_perm: ::ipc_perm,
6566
+        pub msg_stime: ::time_t,
6567
+        pub msg_rtime: ::time_t,
6568
+        pub msg_ctime: ::time_t,
6569
+        __msg_cbytes: ::c_ulong,
6570
+        pub msg_qnum: ::msgqnum_t,
6571
+        pub msg_qbytes: ::msglen_t,
6572
+        pub msg_lspid: ::pid_t,
6573
+        pub msg_lrpid: ::pid_t,
6574
+        __glibc_reserved4: ::c_ulong,
6575
+        __glibc_reserved5: ::c_ulong,
6576
+    }
6577
+
6578
+    pub struct statfs {
6579
+        pub f_type: ::c_long,
6580
+        pub f_bsize: ::c_long,
6581
+        pub f_frsize: ::c_long,
6582
+        pub f_blocks: ::fsblkcnt_t,
6583
+        pub f_bfree: ::fsblkcnt_t,
6584
+        pub f_files: ::fsblkcnt_t,
6585
+        pub f_ffree: ::fsblkcnt_t,
6586
+        pub f_bavail: ::fsblkcnt_t,
6587
+        pub f_fsid: ::fsid_t,
6588
+
6589
+        pub f_namelen: ::c_long,
6590
+        f_spare: [::c_long; 6],
6591
+    }
6592
+
6593
+    pub struct msghdr {
6594
+        pub msg_name: *mut ::c_void,
6595
+        pub msg_namelen: ::socklen_t,
6596
+        pub msg_iov: *mut ::iovec,
6597
+        pub msg_iovlen: ::size_t,
6598
+        pub msg_control: *mut ::c_void,
6599
+        pub msg_controllen: ::size_t,
6600
+        pub msg_flags: ::c_int,
6601
+    }
6602
+
6603
+    pub struct cmsghdr {
6604
+        pub cmsg_len: ::size_t,
6605
+        pub cmsg_level: ::c_int,
6606
+        pub cmsg_type: ::c_int,
6607
+    }
6608
+
6609
+    pub struct termios {
6610
+        pub c_iflag: ::tcflag_t,
6611
+        pub c_oflag: ::tcflag_t,
6612
+        pub c_cflag: ::tcflag_t,
6613
+        pub c_lflag: ::tcflag_t,
6614
+        pub c_line: ::cc_t,
6615
+        pub c_cc: [::cc_t; ::NCCS],
6616
+    }
6617
+
6618
+    pub struct sysinfo {
6619
+        pub uptime: ::c_long,
6620
+        pub loads: [::c_ulong; 3],
6621
+        pub totalram: ::c_ulong,
6622
+        pub freeram: ::c_ulong,
6623
+        pub sharedram: ::c_ulong,
6624
+        pub bufferram: ::c_ulong,
6625
+        pub totalswap: ::c_ulong,
6626
+        pub freeswap: ::c_ulong,
6627
+        pub procs: ::c_ushort,
6628
+        pub pad: ::c_ushort,
6629
+        pub totalhigh: ::c_ulong,
6630
+        pub freehigh: ::c_ulong,
6631
+        pub mem_unit: ::c_uint,
6632
+        pub _f: [::c_char; 0],
6633
+    }
6634
+
6635
+    // FIXME this is actually a union
6636
+    pub struct sem_t {
6637
+        __size: [::c_char; 32],
6638
+        __align: [::c_long; 0],
6639
+    }
6640
+}
6641
+
6642
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
6643
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
6644
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
6645
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
6646
+
6647
+pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
6648
+
6649
+pub const SYS_gettid: ::c_long = 5178;   // Valid for n64
6650
+
6651
+#[link(name = "util")]
6652
+extern {
6653
+    pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
6654
+}
6655
diff --git third_party/rust/libc/src/unix/uclibc/mips/mod.rs third_party/rust/libc/src/unix/uclibc/mips/mod.rs
6656
new file mode 100644
6657
index 000000000000..cc3ddf254d73
6658
--- /dev/null
6659
+++ third_party/rust/libc/src/unix/uclibc/mips/mod.rs
6660
@@ -0,0 +1,476 @@
6661
+pub const SFD_CLOEXEC: ::c_int = 0x080000;
6662
+
6663
+pub const NCCS: usize = 32;
6664
+
6665
+pub const O_TRUNC: ::c_int = 512;
6666
+
6667
+pub const O_CLOEXEC: ::c_int = 0x80000;
6668
+
6669
+pub const EBFONT: ::c_int = 59;
6670
+pub const ENOSTR: ::c_int = 60;
6671
+pub const ENODATA: ::c_int = 61;
6672
+pub const ETIME: ::c_int = 62;
6673
+pub const ENOSR: ::c_int = 63;
6674
+pub const ENONET: ::c_int = 64;
6675
+pub const ENOPKG: ::c_int = 65;
6676
+pub const EREMOTE: ::c_int = 66;
6677
+pub const ENOLINK: ::c_int = 67;
6678
+pub const EADV: ::c_int = 68;
6679
+pub const ESRMNT: ::c_int = 69;
6680
+pub const ECOMM: ::c_int = 70;
6681
+pub const EPROTO: ::c_int = 71;
6682
+pub const EDOTDOT: ::c_int = 73;
6683
+
6684
+pub const SA_NODEFER: ::c_int = 0x40000000;
6685
+pub const SA_RESETHAND: ::c_int = 0x80000000;
6686
+pub const SA_RESTART: ::c_int = 0x10000000;
6687
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
6688
+
6689
+pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
6690
+
6691
+pub const EFD_CLOEXEC: ::c_int = 0x80000;
6692
+
6693
+pub const BUFSIZ: ::c_uint = 4096;
6694
+pub const TMP_MAX: ::c_uint = 238328;
6695
+pub const FOPEN_MAX: ::c_uint = 16;
6696
+pub const POSIX_FADV_DONTNEED: ::c_int = 4;
6697
+pub const POSIX_FADV_NOREUSE: ::c_int = 5;
6698
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
6699
+pub const _SC_2_C_VERSION: ::c_int = 96;
6700
+pub const O_ACCMODE: ::c_int = 3;
6701
+pub const O_DIRECT: ::c_int = 0x8000;
6702
+pub const O_DIRECTORY: ::c_int = 0x10000;
6703
+pub const O_NOFOLLOW: ::c_int = 0x20000;
6704
+pub const ST_RELATIME: ::c_ulong = 4096;
6705
+pub const NI_MAXHOST: ::socklen_t = 1025;
6706
+
6707
+pub const RLIMIT_NOFILE: ::c_int = 5;
6708
+pub const RLIMIT_AS: ::c_int = 6;
6709
+pub const RLIMIT_RSS: ::c_int = 7;
6710
+pub const RLIMIT_NPROC: ::c_int = 8;
6711
+pub const RLIMIT_MEMLOCK: ::c_int = 9;
6712
+pub const RLIMIT_NLIMITS: ::c_int = 15;
6713
+
6714
+pub const O_APPEND: ::c_int = 8;
6715
+pub const O_CREAT: ::c_int = 256;
6716
+pub const O_EXCL: ::c_int = 1024;
6717
+pub const O_NOCTTY: ::c_int = 2048;
6718
+pub const O_NONBLOCK: ::c_int = 128;
6719
+pub const O_SYNC: ::c_int = 0x10;
6720
+pub const O_RSYNC: ::c_int = 0x10;
6721
+pub const O_DSYNC: ::c_int = 0x10;
6722
+pub const O_FSYNC: ::c_int = 0x10;
6723
+pub const O_ASYNC: ::c_int = 0x1000;
6724
+pub const O_NDELAY: ::c_int = 0x80;
6725
+
6726
+pub const SOCK_NONBLOCK: ::c_int = 128;
6727
+
6728
+pub const EDEADLK: ::c_int = 45;
6729
+pub const ENAMETOOLONG: ::c_int = 78;
6730
+pub const ENOLCK: ::c_int = 46;
6731
+pub const ENOSYS: ::c_int = 89;
6732
+pub const ENOTEMPTY: ::c_int = 93;
6733
+pub const ELOOP: ::c_int = 90;
6734
+pub const ENOMSG: ::c_int = 35;
6735
+pub const EIDRM: ::c_int = 36;
6736
+pub const ECHRNG: ::c_int = 37;
6737
+pub const EL2NSYNC: ::c_int = 38;
6738
+pub const EL3HLT: ::c_int = 39;
6739
+pub const EL3RST: ::c_int = 40;
6740
+pub const ELNRNG: ::c_int = 41;
6741
+pub const EUNATCH: ::c_int = 42;
6742
+pub const ENOCSI: ::c_int = 43;
6743
+pub const EL2HLT: ::c_int = 44;
6744
+pub const EBADE: ::c_int = 50;
6745
+pub const EBADR: ::c_int = 51;
6746
+pub const EXFULL: ::c_int = 52;
6747
+pub const ENOANO: ::c_int = 53;
6748
+pub const EBADRQC: ::c_int = 54;
6749
+pub const EBADSLT: ::c_int = 55;
6750
+pub const EDEADLOCK: ::c_int = 56;
6751
+pub const EMULTIHOP: ::c_int = 74;
6752
+pub const EOVERFLOW: ::c_int = 79;
6753
+pub const ENOTUNIQ: ::c_int = 80;
6754
+pub const EBADFD: ::c_int = 81;
6755
+pub const EBADMSG: ::c_int = 77;
6756
+pub const EREMCHG: ::c_int = 82;
6757
+pub const ELIBACC: ::c_int = 83;
6758
+pub const ELIBBAD: ::c_int = 84;
6759
+pub const ELIBSCN: ::c_int = 85;
6760
+pub const ELIBMAX: ::c_int = 86;
6761
+pub const ELIBEXEC: ::c_int = 87;
6762
+pub const EILSEQ: ::c_int = 88;
6763
+pub const ERESTART: ::c_int = 91;
6764
+pub const ESTRPIPE: ::c_int = 92;
6765
+pub const EUSERS: ::c_int = 94;
6766
+pub const ENOTSOCK: ::c_int = 95;
6767
+pub const EDESTADDRREQ: ::c_int = 96;
6768
+pub const EMSGSIZE: ::c_int = 97;
6769
+pub const EPROTOTYPE: ::c_int = 98;
6770
+pub const ENOPROTOOPT: ::c_int = 99;
6771
+pub const EPROTONOSUPPORT: ::c_int = 120;
6772
+pub const ESOCKTNOSUPPORT: ::c_int = 121;
6773
+pub const EOPNOTSUPP: ::c_int = 122;
6774
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
6775
+pub const EPFNOSUPPORT: ::c_int = 123;
6776
+pub const EAFNOSUPPORT: ::c_int = 124;
6777
+pub const EADDRINUSE: ::c_int = 125;
6778
+pub const EADDRNOTAVAIL: ::c_int = 126;
6779
+pub const ENETDOWN: ::c_int = 127;
6780
+pub const ENETUNREACH: ::c_int = 128;
6781
+pub const ENETRESET: ::c_int = 129;
6782
+pub const ECONNABORTED: ::c_int = 130;
6783
+pub const ECONNRESET: ::c_int = 131;
6784
+pub const ENOBUFS: ::c_int = 132;
6785
+pub const EISCONN: ::c_int = 133;
6786
+pub const ENOTCONN: ::c_int = 134;
6787
+pub const ESHUTDOWN: ::c_int = 143;
6788
+pub const ETOOMANYREFS: ::c_int = 144;
6789
+pub const ETIMEDOUT: ::c_int = 145;
6790
+pub const ECONNREFUSED: ::c_int = 146;
6791
+pub const EHOSTDOWN: ::c_int = 147;
6792
+pub const EHOSTUNREACH: ::c_int = 148;
6793
+pub const EALREADY: ::c_int = 149;
6794
+pub const EINPROGRESS: ::c_int = 150;
6795
+pub const ESTALE: ::c_int = 151;
6796
+pub const EUCLEAN: ::c_int = 135;
6797
+pub const ENOTNAM: ::c_int = 137;
6798
+pub const ENAVAIL: ::c_int = 138;
6799
+pub const EISNAM: ::c_int = 139;
6800
+pub const EREMOTEIO: ::c_int = 140;
6801
+pub const EDQUOT: ::c_int = 1133;
6802
+pub const ENOMEDIUM: ::c_int = 159;
6803
+pub const EMEDIUMTYPE: ::c_int = 160;
6804
+pub const ECANCELED: ::c_int = 158;
6805
+pub const ENOKEY: ::c_int = 161;
6806
+pub const EKEYEXPIRED: ::c_int = 162;
6807
+pub const EKEYREVOKED: ::c_int = 163;
6808
+pub const EKEYREJECTED: ::c_int = 164;
6809
+pub const EOWNERDEAD: ::c_int = 165;
6810
+pub const ENOTRECOVERABLE: ::c_int = 166;
6811
+pub const ERFKILL: ::c_int = 167;
6812
+
6813
+pub const MAP_NORESERVE: ::c_int = 0x400;
6814
+pub const MAP_ANON: ::c_int = 0x800;
6815
+pub const MAP_ANONYMOUS: ::c_int = 0x800;
6816
+pub const MAP_GROWSDOWN: ::c_int = 0x1000;
6817
+pub const MAP_DENYWRITE: ::c_int = 0x2000;
6818
+pub const MAP_EXECUTABLE: ::c_int = 0x4000;
6819
+pub const MAP_LOCKED: ::c_int = 0x8000;
6820
+pub const MAP_POPULATE: ::c_int = 0x10000;
6821
+pub const MAP_NONBLOCK: ::c_int = 0x20000;
6822
+pub const MAP_STACK: ::c_int = 0x40000;
6823
+
6824
+pub const SOCK_STREAM: ::c_int = 2;
6825
+pub const SOCK_DGRAM: ::c_int = 1;
6826
+pub const SOCK_SEQPACKET: ::c_int = 5;
6827
+
6828
+pub const SOL_SOCKET: ::c_int = 0xffff;
6829
+
6830
+pub const SO_REUSEADDR: ::c_int = 0x0004;
6831
+pub const SO_KEEPALIVE: ::c_int = 0x0008;
6832
+pub const SO_DONTROUTE: ::c_int = 0x0010;
6833
+pub const SO_BROADCAST: ::c_int = 0x0020;
6834
+pub const SO_LINGER: ::c_int = 0x0080;
6835
+pub const SO_OOBINLINE: ::c_int = 0x0100;
6836
+pub const SO_REUSEPORT: ::c_int = 0x0200;
6837
+pub const SO_TYPE: ::c_int = 0x1008;
6838
+pub const SO_STYLE: ::c_int = SO_TYPE;
6839
+pub const SO_ERROR: ::c_int = 0x1007;
6840
+pub const SO_SNDBUF: ::c_int = 0x1001;
6841
+pub const SO_RCVBUF: ::c_int = 0x1002;
6842
+pub const SO_SNDLOWAT: ::c_int = 0x1003;
6843
+pub const SO_RCVLOWAT: ::c_int = 0x1004;
6844
+pub const SO_SNDTIMEO: ::c_int = 0x1005;
6845
+pub const SO_RCVTIMEO: ::c_int = 0x1006;
6846
+pub const SO_ACCEPTCONN: ::c_int = 0x1009;
6847
+pub const SO_PROTOCOL: ::c_int = 0x1028;
6848
+pub const SO_DOMAIN: ::c_int = 0x1029;
6849
+pub const SO_NO_CHECK: ::c_int = 11;
6850
+pub const SO_PRIORITY: ::c_int = 12;
6851
+pub const SO_BSDCOMPAT: ::c_int = 14;
6852
+pub const SO_PASSCRED: ::c_int = 17;
6853
+pub const SO_PEERCRED: ::c_int = 18;
6854
+pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
6855
+pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
6856
+pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
6857
+pub const SO_BINDTODEVICE: ::c_int = 25;
6858
+pub const SO_ATTACH_FILTER: ::c_int = 26;
6859
+pub const SO_DETACH_FILTER: ::c_int = 27;
6860
+pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
6861
+pub const SO_PEERNAME: ::c_int = 28;
6862
+pub const SO_TIMESTAMP: ::c_int = 29;
6863
+pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
6864
+pub const SO_PEERSEC: ::c_int = 30;
6865
+pub const SO_SNDBUFFORCE: ::c_int = 31;
6866
+pub const SO_RCVBUFFORCE: ::c_int = 33;
6867
+pub const SO_PASSSEC: ::c_int = 34;
6868
+pub const SO_TIMESTAMPNS: ::c_int = 35;
6869
+pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
6870
+pub const SO_MARK: ::c_int = 36;
6871
+pub const SO_TIMESTAMPING: ::c_int = 37;
6872
+pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
6873
+pub const SO_RXQ_OVFL: ::c_int = 40;
6874
+pub const SO_WIFI_STATUS: ::c_int = 41;
6875
+pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
6876
+pub const SO_PEEK_OFF: ::c_int = 42;
6877
+pub const SO_NOFCS: ::c_int = 43;
6878
+pub const SO_LOCK_FILTER: ::c_int = 44;
6879
+pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
6880
+pub const SO_BUSY_POLL: ::c_int = 46;
6881
+pub const SO_MAX_PACING_RATE: ::c_int = 47;
6882
+pub const SO_BPF_EXTENSIONS: ::c_int = 48;
6883
+
6884
+pub const FIOCLEX: ::c_ulong = 0x6601;
6885
+pub const FIONBIO: ::c_ulong = 0x667e;
6886
+
6887
+pub const SA_ONSTACK: ::c_int = 0x08000000;
6888
+pub const SA_SIGINFO: ::c_int = 0x00000008;
6889
+pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
6890
+
6891
+pub const SIGCHLD: ::c_int = 18;
6892
+pub const SIGBUS: ::c_int = 10;
6893
+pub const SIGTTIN: ::c_int = 26;
6894
+pub const SIGTTOU: ::c_int = 27;
6895
+pub const SIGXCPU: ::c_int = 30;
6896
+pub const SIGXFSZ: ::c_int = 31;
6897
+pub const SIGVTALRM: ::c_int = 28;
6898
+pub const SIGPROF: ::c_int = 29;
6899
+pub const SIGWINCH: ::c_int = 20;
6900
+pub const SIGUSR1: ::c_int = 16;
6901
+pub const SIGUSR2: ::c_int = 17;
6902
+pub const SIGCONT: ::c_int = 25;
6903
+pub const SIGSTOP: ::c_int = 23;
6904
+pub const SIGTSTP: ::c_int = 24;
6905
+pub const SIGURG: ::c_int = 21;
6906
+pub const SIGIO: ::c_int = 22;
6907
+pub const SIGSYS: ::c_int = 12;
6908
+pub const SIGPOLL: ::c_int = 22;
6909
+pub const SIGPWR: ::c_int = 19;
6910
+pub const SIG_SETMASK: ::c_int = 3;
6911
+pub const SIG_BLOCK: ::c_int = 0x1;
6912
+pub const SIG_UNBLOCK: ::c_int = 0x2;
6913
+
6914
+pub const POLLRDNORM: ::c_short = 0x040;
6915
+pub const POLLWRNORM: ::c_short = 0x004;
6916
+pub const POLLRDBAND: ::c_short = 0x080;
6917
+pub const POLLWRBAND: ::c_short = 0x100;
6918
+
6919
+pub const PTHREAD_STACK_MIN: ::size_t = 16384;
6920
+
6921
+pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5;
6922
+pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff;
6923
+pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245;
6924
+pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45;
6925
+pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53;
6926
+pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53;
6927
+pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53;
6928
+pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53;
6929
+pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849;
6930
+pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6;
6931
+pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660;
6932
+pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6;
6933
+pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f;
6934
+pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f;
6935
+pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468;
6936
+pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478;
6937
+pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44;
6938
+pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c;
6939
+pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969;
6940
+pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1;
6941
+pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0;
6942
+pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f;
6943
+pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973;
6944
+pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b;
6945
+pub const TMPFS_MAGIC: ::c_long = 0x01021994;
6946
+pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
6947
+
6948
+pub const VEOF: usize = 16;
6949
+pub const VEOL: usize = 17;
6950
+pub const VEOL2: usize = 6;
6951
+pub const VMIN: usize = 4;
6952
+pub const IEXTEN: ::tcflag_t = 0x00000100;
6953
+pub const TOSTOP: ::tcflag_t = 0x00008000;
6954
+pub const FLUSHO: ::tcflag_t = 0x00002000;
6955
+pub const IUTF8: ::tcflag_t = 0x00004000;
6956
+pub const TCSANOW: ::c_int = 0x540e;
6957
+pub const TCSADRAIN: ::c_int = 0x540f;
6958
+pub const TCSAFLUSH: ::c_int = 0x5410;
6959
+
6960
+pub const CPU_SETSIZE: ::c_int = 0x400;
6961
+
6962
+pub const PTRACE_TRACEME: ::c_uint = 0;
6963
+pub const PTRACE_PEEKTEXT: ::c_uint = 1;
6964
+pub const PTRACE_PEEKDATA: ::c_uint = 2;
6965
+pub const PTRACE_PEEKUSER: ::c_uint = 3;
6966
+pub const PTRACE_POKETEXT: ::c_uint = 4;
6967
+pub const PTRACE_POKEDATA: ::c_uint = 5;
6968
+pub const PTRACE_POKEUSER: ::c_uint = 6;
6969
+pub const PTRACE_CONT: ::c_uint = 7;
6970
+pub const PTRACE_KILL: ::c_uint = 8;
6971
+pub const PTRACE_SINGLESTEP: ::c_uint = 9;
6972
+pub const PTRACE_ATTACH: ::c_uint = 16;
6973
+pub const PTRACE_DETACH: ::c_uint = 17;
6974
+pub const PTRACE_SYSCALL: ::c_uint = 24;
6975
+pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200;
6976
+pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201;
6977
+pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202;
6978
+pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203;
6979
+pub const PTRACE_GETFPREGS: ::c_uint = 14;
6980
+pub const PTRACE_SETFPREGS: ::c_uint = 15;
6981
+pub const PTRACE_GETFPXREGS: ::c_uint = 18;
6982
+pub const PTRACE_SETFPXREGS: ::c_uint = 19;
6983
+pub const PTRACE_GETREGS: ::c_uint = 12;
6984
+pub const PTRACE_SETREGS: ::c_uint = 13;
6985
+
6986
+pub const EFD_NONBLOCK: ::c_int = 0x80;
6987
+
6988
+pub const F_GETLK: ::c_int = 14;
6989
+pub const F_GETOWN: ::c_int = 23;
6990
+pub const F_SETOWN: ::c_int = 24;
6991
+pub const F_SETLK: ::c_int = 6;
6992
+pub const F_SETLKW: ::c_int = 7;
6993
+
6994
+pub const SFD_NONBLOCK: ::c_int = 0x80;
6995
+
6996
+pub const TCGETS: ::c_ulong = 0x540d;
6997
+pub const TCSETS: ::c_ulong = 0x540e;
6998
+pub const TCSETSW: ::c_ulong = 0x540f;
6999
+pub const TCSETSF: ::c_ulong = 0x5410;
7000
+pub const TCGETA: ::c_ulong = 0x5401;
7001
+pub const TCSETA: ::c_ulong = 0x5402;
7002
+pub const TCSETAW: ::c_ulong = 0x5403;
7003
+pub const TCSETAF: ::c_ulong = 0x5404;
7004
+pub const TCSBRK: ::c_ulong = 0x5405;
7005
+pub const TCXONC: ::c_ulong = 0x5406;
7006
+pub const TCFLSH: ::c_ulong = 0x5407;
7007
+pub const TIOCGSOFTCAR: ::c_ulong = 0x5481;
7008
+pub const TIOCSSOFTCAR: ::c_ulong = 0x5482;
7009
+pub const TIOCINQ: ::c_ulong = 0x467f;
7010
+pub const TIOCLINUX: ::c_ulong = 0x5483;
7011
+pub const TIOCGSERIAL: ::c_ulong = 0x5484;
7012
+pub const TIOCEXCL: ::c_ulong = 0x740d;
7013
+pub const TIOCNXCL: ::c_ulong = 0x740e;
7014
+pub const TIOCSCTTY: ::c_ulong = 0x5480;
7015
+pub const TIOCGPGRP: ::c_ulong = 0x40047477;
7016
+pub const TIOCSPGRP: ::c_ulong = 0x80047476;
7017
+pub const TIOCOUTQ: ::c_ulong = 0x7472;
7018
+pub const TIOCSTI: ::c_ulong = 0x5472;
7019
+pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
7020
+pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
7021
+pub const TIOCMGET: ::c_ulong = 0x741d;
7022
+pub const TIOCMBIS: ::c_ulong = 0x741b;
7023
+pub const TIOCMBIC: ::c_ulong = 0x741c;
7024
+pub const TIOCMSET: ::c_ulong = 0x741a;
7025
+pub const FIONREAD: ::c_ulong = 0x467f;
7026
+pub const TIOCCONS: ::c_ulong = 0x80047478;
7027
+
7028
+pub const RTLD_DEEPBIND: ::c_int = 0x10;
7029
+pub const RTLD_GLOBAL: ::c_int = 0x4;
7030
+pub const RTLD_NOLOAD: ::c_int = 0x8;
7031
+
7032
+pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
7033
+pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
7034
+pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
7035
+pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448;
7036
+pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216;
7037
+
7038
+pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567;
7039
+pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123;
7040
+pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF;
7041
+pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000;
7042
+pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC;
7043
+pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
7044
+pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
7045
+pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
7046
+
7047
+pub const MCL_CURRENT: ::c_int = 0x0001;
7048
+pub const MCL_FUTURE: ::c_int = 0x0002;
7049
+
7050
+pub const SIGSTKSZ: ::size_t = 8192;
7051
+pub const CBAUD: ::tcflag_t = 0o0010017;
7052
+pub const TAB1: ::c_int = 0x00000800;
7053
+pub const TAB2: ::c_int = 0x00001000;
7054
+pub const TAB3: ::c_int = 0x00001800;
7055
+pub const CR1: ::c_int  = 0x00000200;
7056
+pub const CR2: ::c_int  = 0x00000400;
7057
+pub const CR3: ::c_int  = 0x00000600;
7058
+pub const FF1: ::c_int  = 0x00008000;
7059
+pub const BS1: ::c_int  = 0x00002000;
7060
+pub const VT1: ::c_int  = 0x00004000;
7061
+pub const VWERASE: usize = 14;
7062
+pub const VREPRINT: usize = 12;
7063
+pub const VSUSP: usize = 10;
7064
+pub const VSTART: usize = 8;
7065
+pub const VSTOP: usize = 9;
7066
+pub const VDISCARD: usize = 13;
7067
+pub const VTIME: usize = 5;
7068
+pub const IXON: ::tcflag_t = 0x00000400;
7069
+pub const IXOFF: ::tcflag_t = 0x00001000;
7070
+pub const ONLCR: ::tcflag_t = 0x4;
7071
+pub const CSIZE: ::tcflag_t = 0x00000030;
7072
+pub const CS6: ::tcflag_t = 0x00000010;
7073
+pub const CS7: ::tcflag_t = 0x00000020;
7074
+pub const CS8: ::tcflag_t = 0x00000030;
7075
+pub const CSTOPB: ::tcflag_t = 0x00000040;
7076
+pub const CREAD: ::tcflag_t = 0x00000080;
7077
+pub const PARENB: ::tcflag_t = 0x00000100;
7078
+pub const PARODD: ::tcflag_t = 0x00000200;
7079
+pub const HUPCL: ::tcflag_t = 0x00000400;
7080
+pub const CLOCAL: ::tcflag_t = 0x00000800;
7081
+pub const ECHOKE: ::tcflag_t = 0x00000800;
7082
+pub const ECHOE: ::tcflag_t = 0x00000010;
7083
+pub const ECHOK: ::tcflag_t = 0x00000020;
7084
+pub const ECHONL: ::tcflag_t = 0x00000040;
7085
+pub const ECHOPRT: ::tcflag_t = 0x00000400;
7086
+pub const ECHOCTL: ::tcflag_t = 0x00000200;
7087
+pub const ISIG: ::tcflag_t = 0x00000001;
7088
+pub const ICANON: ::tcflag_t = 0x00000002;
7089
+pub const PENDIN: ::tcflag_t = 0x00004000;
7090
+pub const NOFLSH: ::tcflag_t = 0x00000080;
7091
+
7092
+pub const B0: ::speed_t = 0o000000;
7093
+pub const B50: ::speed_t = 0o000001;
7094
+pub const B75: ::speed_t = 0o000002;
7095
+pub const B110: ::speed_t = 0o000003;
7096
+pub const B134: ::speed_t = 0o000004;
7097
+pub const B150: ::speed_t = 0o000005;
7098
+pub const B200: ::speed_t = 0o000006;
7099
+pub const B300: ::speed_t = 0o000007;
7100
+pub const B600: ::speed_t = 0o000010;
7101
+pub const B1200: ::speed_t = 0o000011;
7102
+pub const B1800: ::speed_t = 0o000012;
7103
+pub const B2400: ::speed_t = 0o000013;
7104
+pub const B4800: ::speed_t = 0o000014;
7105
+pub const B9600: ::speed_t = 0o000015;
7106
+pub const B19200: ::speed_t = 0o000016;
7107
+pub const B38400: ::speed_t = 0o000017;
7108
+pub const EXTA: ::speed_t = B19200;
7109
+pub const EXTB: ::speed_t = B38400;
7110
+pub const B57600: ::speed_t = 0o010001;
7111
+pub const B115200: ::speed_t = 0o010002;
7112
+pub const B230400: ::speed_t = 0o010003;
7113
+pub const B460800: ::speed_t = 0o010004;
7114
+pub const B500000: ::speed_t = 0o010005;
7115
+pub const B576000: ::speed_t = 0o010006;
7116
+pub const B921600: ::speed_t = 0o010007;
7117
+pub const B1000000: ::speed_t = 0o010010;
7118
+pub const B1152000: ::speed_t = 0o010011;
7119
+pub const B1500000: ::speed_t = 0o010012;
7120
+pub const B2000000: ::speed_t = 0o010013;
7121
+pub const B2500000: ::speed_t = 0o010014;
7122
+pub const B3000000: ::speed_t = 0o010015;
7123
+pub const B3500000: ::speed_t = 0o010016;
7124
+pub const B4000000: ::speed_t = 0o010017;
7125
+
7126
+cfg_if! {
7127
+    if #[cfg(target_arch = "mips")] {
7128
+        mod mips32;
7129
+        pub use self::mips32::*;
7130
+    } else if #[cfg(target_arch = "mips64")] {
7131
+        mod mips64;
7132
+        pub use self::mips64::*;
7133
+    } else {
7134
+        // Unknown target_arch
7135
+    }
7136
+}
7137
diff --git third_party/rust/libc/src/unix/uclibc/mod.rs third_party/rust/libc/src/unix/uclibc/mod.rs
7138
new file mode 100644
7139
index 000000000000..09f7d055f3d0
7140
--- /dev/null
7141
+++ third_party/rust/libc/src/unix/uclibc/mod.rs
7142
@@ -0,0 +1,1769 @@
7143
+use dox::{mem, Option};
7144
+
7145
+pub type sa_family_t = u16;
7146
+pub type pthread_key_t = ::c_uint;
7147
+pub type speed_t = ::c_uint;
7148
+pub type tcflag_t = ::c_uint;
7149
+pub type loff_t = ::c_longlong;
7150
+pub type clockid_t = ::c_int;
7151
+pub type key_t = ::c_int;
7152
+pub type id_t = ::c_uint;
7153
+pub type useconds_t = u32;
7154
+pub type dev_t = u64;
7155
+pub type socklen_t = u32;
7156
+pub type pthread_t = ::c_ulong;
7157
+pub type mode_t = u32;
7158
+pub type ino64_t = u64;
7159
+pub type off64_t = i64;
7160
+pub type blkcnt64_t = i64;
7161
+pub type rlim64_t = u64;
7162
+pub type shmatt_t = ::c_ulong;
7163
+pub type mqd_t = ::c_int;
7164
+pub type msgqnum_t = ::c_ulong;
7165
+pub type msglen_t = ::c_ulong;
7166
+pub type nfds_t = ::c_ulong;
7167
+pub type nl_item = ::c_int;
7168
+pub type idtype_t = ::c_uint;
7169
+
7170
+pub enum fpos64_t {} // TODO: fill this out with a struct
7171
+
7172
+pub enum timezone {}
7173
+
7174
+s! {
7175
+    pub struct sockaddr {
7176
+        pub sa_family: sa_family_t,
7177
+        pub sa_data: [::c_char; 14],
7178
+    }
7179
+
7180
+    pub struct sockaddr_in {
7181
+        pub sin_family: sa_family_t,
7182
+        pub sin_port: ::in_port_t,
7183
+        pub sin_addr: ::in_addr,
7184
+        pub sin_zero: [u8; 8],
7185
+    }
7186
+
7187
+    pub struct sockaddr_in6 {
7188
+        pub sin6_family: sa_family_t,
7189
+        pub sin6_port: ::in_port_t,
7190
+        pub sin6_flowinfo: u32,
7191
+        pub sin6_addr: ::in6_addr,
7192
+        pub sin6_scope_id: u32,
7193
+    }
7194
+
7195
+    pub struct sockaddr_un {
7196
+        pub sun_family: sa_family_t,
7197
+        pub sun_path: [::c_char; 108]
7198
+    }
7199
+
7200
+    pub struct sockaddr_storage {
7201
+        pub ss_family: sa_family_t,
7202
+        __ss_align: ::size_t,
7203
+        #[cfg(target_pointer_width = "32")]
7204
+        __ss_pad2: [u8; 128 - 2 * 4],
7205
+        #[cfg(target_pointer_width = "64")]
7206
+        __ss_pad2: [u8; 128 - 2 * 8],
7207
+    }
7208
+
7209
+    pub struct addrinfo {
7210
+        pub ai_flags: ::c_int,
7211
+        pub ai_family: ::c_int,
7212
+        pub ai_socktype: ::c_int,
7213
+        pub ai_protocol: ::c_int,
7214
+        pub ai_addrlen: socklen_t,
7215
+
7216
+        pub ai_addr: *mut ::sockaddr,
7217
+
7218
+        pub ai_canonname: *mut c_char,
7219
+
7220
+        pub ai_next: *mut addrinfo,
7221
+    }
7222
+
7223
+    pub struct sockaddr_nl {
7224
+        pub nl_family: ::sa_family_t,
7225
+        nl_pad: ::c_ushort,
7226
+        pub nl_pid: u32,
7227
+        pub nl_groups: u32
7228
+    }
7229
+
7230
+    pub struct sockaddr_ll {
7231
+        pub sll_family: ::c_ushort,
7232
+        pub sll_protocol: ::c_ushort,
7233
+        pub sll_ifindex: ::c_int,
7234
+        pub sll_hatype: ::c_ushort,
7235
+        pub sll_pkttype: ::c_uchar,
7236
+        pub sll_halen: ::c_uchar,
7237
+        pub sll_addr: [::c_uchar; 8]
7238
+    }
7239
+
7240
+    pub struct fd_set {
7241
+        fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
7242
+    }
7243
+
7244
+    pub struct tm {
7245
+        pub tm_sec: ::c_int,
7246
+        pub tm_min: ::c_int,
7247
+        pub tm_hour: ::c_int,
7248
+        pub tm_mday: ::c_int,
7249
+        pub tm_mon: ::c_int,
7250
+        pub tm_year: ::c_int,
7251
+        pub tm_wday: ::c_int,
7252
+        pub tm_yday: ::c_int,
7253
+        pub tm_isdst: ::c_int,
7254
+        pub tm_gmtoff: ::c_long,
7255
+        pub tm_zone: *const ::c_char,
7256
+    }
7257
+
7258
+    pub struct sched_param {
7259
+        pub sched_priority: ::c_int,
7260
+    }
7261
+
7262
+    pub struct Dl_info {
7263
+        pub dli_fname: *const ::c_char,
7264
+        pub dli_fbase: *mut ::c_void,
7265
+        pub dli_sname: *const ::c_char,
7266
+        pub dli_saddr: *mut ::c_void,
7267
+    }
7268
+
7269
+    #[cfg_attr(any(all(target_arch = "x86",
7270
+                   target_arch = "x86_64")),
7271
+               repr(packed))]
7272
+    pub struct epoll_event {
7273
+        pub events: ::uint32_t,
7274
+        pub u64: ::uint64_t,
7275
+    }
7276
+
7277
+    pub struct utsname {
7278
+        pub sysname: [::c_char; 65],
7279
+        pub nodename: [::c_char; 65],
7280
+        pub release: [::c_char; 65],
7281
+        pub version: [::c_char; 65],
7282
+        pub machine: [::c_char; 65],
7283
+        pub domainname: [::c_char; 65]
7284
+    }
7285
+
7286
+    pub struct lconv {
7287
+        pub decimal_point: *mut ::c_char,
7288
+        pub thousands_sep: *mut ::c_char,
7289
+        pub grouping: *mut ::c_char,
7290
+        pub int_curr_symbol: *mut ::c_char,
7291
+        pub currency_symbol: *mut ::c_char,
7292
+        pub mon_decimal_point: *mut ::c_char,
7293
+        pub mon_thousands_sep: *mut ::c_char,
7294
+        pub mon_grouping: *mut ::c_char,
7295
+        pub positive_sign: *mut ::c_char,
7296
+        pub negative_sign: *mut ::c_char,
7297
+        pub int_frac_digits: ::c_char,
7298
+        pub frac_digits: ::c_char,
7299
+        pub p_cs_precedes: ::c_char,
7300
+        pub p_sep_by_space: ::c_char,
7301
+        pub n_cs_precedes: ::c_char,
7302
+        pub n_sep_by_space: ::c_char,
7303
+        pub p_sign_posn: ::c_char,
7304
+        pub n_sign_posn: ::c_char,
7305
+        pub int_p_cs_precedes: ::c_char,
7306
+        pub int_p_sep_by_space: ::c_char,
7307
+        pub int_n_cs_precedes: ::c_char,
7308
+        pub int_n_sep_by_space: ::c_char,
7309
+        pub int_p_sign_posn: ::c_char,
7310
+        pub int_n_sign_posn: ::c_char,
7311
+    }
7312
+
7313
+    pub struct sigevent {
7314
+        pub sigev_value: ::sigval,
7315
+        pub sigev_signo: ::c_int,
7316
+        pub sigev_notify: ::c_int,
7317
+        // Actually a union.  We only expose sigev_notify_thread_id because it's
7318
+        // the most useful member
7319
+        pub sigev_notify_thread_id: ::c_int,
7320
+        #[cfg(target_pointer_width = "64")]
7321
+        __unused1: [::c_int; 11],
7322
+        #[cfg(target_pointer_width = "32")]
7323
+        __unused1: [::c_int; 12]
7324
+    }
7325
+
7326
+    pub struct dirent {
7327
+        pub d_ino: ::ino_t,
7328
+        pub d_off: ::off_t,
7329
+        pub d_reclen: ::c_ushort,
7330
+        pub d_type: ::c_uchar,
7331
+        pub d_name: [::c_char; 256],
7332
+    }
7333
+
7334
+    pub struct dirent64 {
7335
+        pub d_ino: ::ino64_t,
7336
+        pub d_off: ::off64_t,
7337
+        pub d_reclen: ::c_ushort,
7338
+        pub d_type: ::c_uchar,
7339
+        pub d_name: [::c_char; 256],
7340
+    }
7341
+
7342
+    pub struct rlimit64 {
7343
+        pub rlim_cur: rlim64_t,
7344
+        pub rlim_max: rlim64_t,
7345
+    }
7346
+
7347
+    pub struct glob_t {
7348
+        pub gl_pathc: ::size_t,
7349
+        pub gl_pathv: *mut *mut c_char,
7350
+        pub gl_offs: ::size_t,
7351
+        pub gl_flags: ::c_int,
7352
+
7353
+        __unused1: *mut ::c_void,
7354
+        __unused2: *mut ::c_void,
7355
+        __unused3: *mut ::c_void,
7356
+        __unused4: *mut ::c_void,
7357
+        __unused5: *mut ::c_void,
7358
+    }
7359
+
7360
+    pub struct ifaddrs {
7361
+        pub ifa_next: *mut ifaddrs,
7362
+        pub ifa_name: *mut c_char,
7363
+        pub ifa_flags: ::c_uint,
7364
+        pub ifa_addr: *mut ::sockaddr,
7365
+        pub ifa_netmask: *mut ::sockaddr,
7366
+        pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
7367
+        pub ifa_data: *mut ::c_void
7368
+    }
7369
+
7370
+    pub struct pthread_mutex_t {
7371
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
7372
+                  target_arch = "powerpc"))]
7373
+        __align: [::c_long; 0],
7374
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
7375
+                      target_arch = "powerpc")))]
7376
+        __align: [::c_longlong; 0],
7377
+        size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
7378
+    }
7379
+
7380
+    pub struct pthread_rwlock_t {
7381
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
7382
+                  target_arch = "powerpc"))]
7383
+        __align: [::c_long; 0],
7384
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
7385
+                      target_arch = "powerpc")))]
7386
+        __align: [::c_longlong; 0],
7387
+        size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
7388
+    }
7389
+
7390
+    pub struct pthread_mutexattr_t {
7391
+        #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
7392
+                  target_arch = "mips64", target_arch = "s390x",
7393
+                  target_arch = "sparc64"))]
7394
+        __align: [::c_int; 0],
7395
+        #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
7396
+                      target_arch = "mips64", target_arch = "s390x",
7397
+                      target_arch = "sparc64")))]
7398
+        __align: [::c_long; 0],
7399
+        size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
7400
+    }
7401
+
7402
+    pub struct pthread_cond_t {
7403
+        __align: [::c_longlong; 0],
7404
+        size: [u8; __SIZEOF_PTHREAD_COND_T],
7405
+    }
7406
+
7407
+    pub struct pthread_condattr_t {
7408
+        __align: [::c_int; 0],
7409
+        size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
7410
+    }
7411
+
7412
+    pub struct passwd {
7413
+        pub pw_name: *mut ::c_char,
7414
+        pub pw_passwd: *mut ::c_char,
7415
+        pub pw_uid: ::uid_t,
7416
+        pub pw_gid: ::gid_t,
7417
+        pub pw_gecos: *mut ::c_char,
7418
+        pub pw_dir: *mut ::c_char,
7419
+        pub pw_shell: *mut ::c_char,
7420
+    }
7421
+
7422
+    pub struct spwd {
7423
+        pub sp_namp: *mut ::c_char,
7424
+        pub sp_pwdp: *mut ::c_char,
7425
+        pub sp_lstchg: ::c_long,
7426
+        pub sp_min: ::c_long,
7427
+        pub sp_max: ::c_long,
7428
+        pub sp_warn: ::c_long,
7429
+        pub sp_inact: ::c_long,
7430
+        pub sp_expire: ::c_long,
7431
+        pub sp_flag: ::c_ulong,
7432
+    }
7433
+
7434
+    pub struct statvfs {
7435
+        pub f_bsize: ::c_ulong,
7436
+        pub f_frsize: ::c_ulong,
7437
+        pub f_blocks: ::fsblkcnt_t,
7438
+        pub f_bfree: ::fsblkcnt_t,
7439
+        pub f_bavail: ::fsblkcnt_t,
7440
+        pub f_files: ::fsfilcnt_t,
7441
+        pub f_ffree: ::fsfilcnt_t,
7442
+        pub f_favail: ::fsfilcnt_t,
7443
+        #[cfg(target_endian = "little")]
7444
+        pub f_fsid: ::c_ulong,
7445
+        #[cfg(target_pointer_width = "32")]
7446
+        __f_unused: ::c_int,
7447
+        #[cfg(target_endian = "big")]
7448
+        pub f_fsid: ::c_ulong,
7449
+        pub f_flag: ::c_ulong,
7450
+        pub f_namemax: ::c_ulong,
7451
+        __f_spare: [::c_int; 6],
7452
+    }
7453
+
7454
+    pub struct dqblk {
7455
+        pub dqb_bhardlimit: ::uint32_t,
7456
+        pub dqb_bsoftlimit: ::uint32_t,
7457
+        pub dqb_curblocks: ::uint32_t,
7458
+        pub dqb_ihardlimit: ::uint32_t,
7459
+        pub dqb_isoftlimit: ::uint32_t,
7460
+        pub dqb_curinodes: ::uint32_t,
7461
+        pub dqb_btime: ::time_t,
7462
+        pub dqb_itime: ::time_t,
7463
+    }
7464
+
7465
+    pub struct signalfd_siginfo {
7466
+        pub ssi_signo: ::uint32_t,
7467
+        pub ssi_errno: ::int32_t,
7468
+        pub ssi_code: ::int32_t,
7469
+        pub ssi_pid: ::uint32_t,
7470
+        pub ssi_uid: ::uint32_t,
7471
+        pub ssi_fd: ::int32_t,
7472
+        pub ssi_tid: ::uint32_t,
7473
+        pub ssi_band: ::uint32_t,
7474
+        pub ssi_overrun: ::uint32_t,
7475
+        pub ssi_trapno: ::uint32_t,
7476
+        pub ssi_status: ::int32_t,
7477
+        pub ssi_int: ::int32_t,
7478
+        pub ssi_ptr: ::uint64_t,
7479
+        pub ssi_utime: ::uint64_t,
7480
+        pub ssi_stime: ::uint64_t,
7481
+        pub ssi_addr: ::uint64_t,
7482
+        _pad: [::uint8_t; 48],
7483
+    }
7484
+
7485
+    pub struct fsid_t {
7486
+        __val: [::c_int; 2],
7487
+    }
7488
+
7489
+    pub struct mq_attr {
7490
+        pub mq_flags: ::c_long,
7491
+        pub mq_maxmsg: ::c_long,
7492
+        pub mq_msgsize: ::c_long,
7493
+        pub mq_curmsgs: ::c_long,
7494
+        pad: [::c_long; 4]
7495
+    }
7496
+
7497
+    pub struct cpu_set_t {
7498
+        #[cfg(target_pointer_width = "32")]
7499
+        bits: [u32; 32],
7500
+        #[cfg(target_pointer_width = "64")]
7501
+        bits: [u64; 16],
7502
+    }
7503
+
7504
+    pub struct if_nameindex {
7505
+        pub if_index: ::c_uint,
7506
+        pub if_name: *mut ::c_char,
7507
+    }
7508
+
7509
+    // System V IPC
7510
+    pub struct msginfo {
7511
+        pub msgpool: ::c_int,
7512
+        pub msgmap: ::c_int,
7513
+        pub msgmax: ::c_int,
7514
+        pub msgmnb: ::c_int,
7515
+        pub msgmni: ::c_int,
7516
+        pub msgssz: ::c_int,
7517
+        pub msgtql: ::c_int,
7518
+        pub msgseg: ::c_ushort,
7519
+    }
7520
+}
7521
+
7522
+// intentionally not public, only used for fd_set
7523
+cfg_if! {
7524
+    if #[cfg(target_pointer_width = "32")] {
7525
+        const ULONG_SIZE: usize = 32;
7526
+    } else if #[cfg(target_pointer_width = "64")] {
7527
+        const ULONG_SIZE: usize = 64;
7528
+    } else {
7529
+        // Unknown target_pointer_width
7530
+    }
7531
+}
7532
+
7533
+pub const EXIT_FAILURE: ::c_int = 1;
7534
+pub const EXIT_SUCCESS: ::c_int = 0;
7535
+pub const RAND_MAX: ::c_int = 2147483647;
7536
+pub const EOF: ::c_int = -1;
7537
+pub const SEEK_SET: ::c_int = 0;
7538
+pub const SEEK_CUR: ::c_int = 1;
7539
+pub const SEEK_END: ::c_int = 2;
7540
+pub const _IOFBF: ::c_int = 0;
7541
+pub const _IONBF: ::c_int = 2;
7542
+pub const _IOLBF: ::c_int = 1;
7543
+
7544
+pub const F_DUPFD: ::c_int = 0;
7545
+pub const F_GETFD: ::c_int = 1;
7546
+pub const F_SETFD: ::c_int = 2;
7547
+pub const F_GETFL: ::c_int = 3;
7548
+pub const F_SETFL: ::c_int = 4;
7549
+
7550
+// Linux-specific fcntls
7551
+pub const F_SETLEASE: ::c_int = 1024;
7552
+pub const F_GETLEASE: ::c_int = 1025;
7553
+pub const F_NOTIFY: ::c_int = 1026;
7554
+pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
7555
+
7556
+// TODO(#235): Include file sealing fcntls once we have a way to verify them.
7557
+
7558
+pub const SIGTRAP: ::c_int = 5;
7559
+
7560
+pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
7561
+pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
7562
+
7563
+pub const CLOCK_REALTIME: clockid_t = 0;
7564
+pub const CLOCK_MONOTONIC: clockid_t = 1;
7565
+pub const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 2;
7566
+pub const CLOCK_THREAD_CPUTIME_ID: clockid_t = 3;
7567
+// TODO(#247) Someday our Travis shall have glibc 2.21 (released in Sep
7568
+// 2014.) See also musl/mod.rs
7569
+// pub const CLOCK_SGI_CYCLE: clockid_t = 10;
7570
+// pub const CLOCK_TAI: clockid_t = 11;
7571
+pub const TIMER_ABSTIME: ::c_int = 1;
7572
+
7573
+pub const RLIMIT_CPU: ::c_int = 0;
7574
+pub const RLIMIT_FSIZE: ::c_int = 1;
7575
+pub const RLIMIT_DATA: ::c_int = 2;
7576
+pub const RLIMIT_STACK: ::c_int = 3;
7577
+pub const RLIMIT_CORE: ::c_int = 4;
7578
+pub const RLIMIT_LOCKS: ::c_int = 10;
7579
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
7580
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
7581
+pub const RLIMIT_NICE: ::c_int = 13;
7582
+pub const RLIMIT_RTPRIO: ::c_int = 14;
7583
+
7584
+pub const RUSAGE_SELF: ::c_int = 0;
7585
+
7586
+pub const O_RDONLY: ::c_int = 0;
7587
+pub const O_WRONLY: ::c_int = 1;
7588
+pub const O_RDWR: ::c_int = 2;
7589
+
7590
+pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
7591
+
7592
+pub const S_IFIFO: ::mode_t = 4096;
7593
+pub const S_IFCHR: ::mode_t = 8192;
7594
+pub const S_IFBLK: ::mode_t = 24576;
7595
+pub const S_IFDIR: ::mode_t = 16384;
7596
+pub const S_IFREG: ::mode_t = 32768;
7597
+pub const S_IFLNK: ::mode_t = 40960;
7598
+pub const S_IFSOCK: ::mode_t = 49152;
7599
+pub const S_IFMT: ::mode_t = 61440;
7600
+pub const S_IRWXU: ::mode_t = 448;
7601
+pub const S_IXUSR: ::mode_t = 64;
7602
+pub const S_IWUSR: ::mode_t = 128;
7603
+pub const S_IRUSR: ::mode_t = 256;
7604
+pub const S_IRWXG: ::mode_t = 56;
7605
+pub const S_IXGRP: ::mode_t = 8;
7606
+pub const S_IWGRP: ::mode_t = 16;
7607
+pub const S_IRGRP: ::mode_t = 32;
7608
+pub const S_IRWXO: ::mode_t = 7;
7609
+pub const S_IXOTH: ::mode_t = 1;
7610
+pub const S_IWOTH: ::mode_t = 2;
7611
+pub const S_IROTH: ::mode_t = 4;
7612
+pub const F_OK: ::c_int = 0;
7613
+pub const R_OK: ::c_int = 4;
7614
+pub const W_OK: ::c_int = 2;
7615
+pub const X_OK: ::c_int = 1;
7616
+pub const STDIN_FILENO: ::c_int = 0;
7617
+pub const STDOUT_FILENO: ::c_int = 1;
7618
+pub const STDERR_FILENO: ::c_int = 2;
7619
+pub const SIGHUP: ::c_int = 1;
7620
+pub const SIGINT: ::c_int = 2;
7621
+pub const SIGQUIT: ::c_int = 3;
7622
+pub const SIGILL: ::c_int = 4;
7623
+pub const SIGABRT: ::c_int = 6;
7624
+pub const SIGFPE: ::c_int = 8;
7625
+pub const SIGKILL: ::c_int = 9;
7626
+pub const SIGSEGV: ::c_int = 11;
7627
+pub const SIGPIPE: ::c_int = 13;
7628
+pub const SIGALRM: ::c_int = 14;
7629
+pub const SIGTERM: ::c_int = 15;
7630
+
7631
+pub const PROT_NONE: ::c_int = 0;
7632
+pub const PROT_READ: ::c_int = 1;
7633
+pub const PROT_WRITE: ::c_int = 2;
7634
+pub const PROT_EXEC: ::c_int = 4;
7635
+
7636
+pub const LC_CTYPE: ::c_int = 0;
7637
+pub const LC_NUMERIC: ::c_int = 1;
7638
+pub const LC_MONETARY: ::c_int = 2;
7639
+pub const LC_TIME: ::c_int = 3;
7640
+pub const LC_COLLATE: ::c_int = 4;
7641
+pub const LC_MESSAGES: ::c_int = 5;
7642
+pub const LC_ALL: ::c_int = 6;
7643
+pub const LC_CTYPE_MASK: ::c_int = (1 << LC_CTYPE);
7644
+pub const LC_NUMERIC_MASK: ::c_int = (1 << LC_NUMERIC);
7645
+pub const LC_TIME_MASK: ::c_int = (1 << LC_TIME);
7646
+pub const LC_COLLATE_MASK: ::c_int = (1 << LC_COLLATE);
7647
+pub const LC_MONETARY_MASK: ::c_int = (1 << LC_MONETARY);
7648
+pub const LC_MESSAGES_MASK: ::c_int = (1 << LC_MESSAGES);
7649
+// LC_ALL_MASK defined per platform
7650
+
7651
+pub const MAP_FILE: ::c_int = 0x0000;
7652
+pub const MAP_SHARED: ::c_int = 0x0001;
7653
+pub const MAP_PRIVATE: ::c_int = 0x0002;
7654
+pub const MAP_FIXED: ::c_int = 0x0010;
7655
+
7656
+pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
7657
+
7658
+// MS_ flags for msync(2)
7659
+pub const MS_ASYNC: ::c_int = 0x0001;
7660
+pub const MS_INVALIDATE: ::c_int = 0x0002;
7661
+pub const MS_SYNC: ::c_int = 0x0004;
7662
+
7663
+// MS_ flags for mount(2)
7664
+pub const MS_RDONLY: ::c_ulong = 0x01;
7665
+pub const MS_NOSUID: ::c_ulong = 0x02;
7666
+pub const MS_NODEV: ::c_ulong = 0x04;
7667
+pub const MS_NOEXEC: ::c_ulong = 0x08;
7668
+pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
7669
+pub const MS_REMOUNT: ::c_ulong = 0x20;
7670
+pub const MS_MANDLOCK: ::c_ulong = 0x40;
7671
+pub const MS_NOATIME: ::c_ulong = 0x0400;
7672
+pub const MS_NODIRATIME: ::c_ulong = 0x0800;
7673
+pub const MS_BIND: ::c_ulong = 0x1000;
7674
+pub const MS_NOUSER: ::c_ulong = 0x80000000;
7675
+pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
7676
+pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
7677
+pub const MS_RMT_MASK: ::c_ulong = 0x800051;
7678
+
7679
+pub const EPERM: ::c_int = 1;
7680
+pub const ENOENT: ::c_int = 2;
7681
+pub const ESRCH: ::c_int = 3;
7682
+pub const EINTR: ::c_int = 4;
7683
+pub const EIO: ::c_int = 5;
7684
+pub const ENXIO: ::c_int = 6;
7685
+pub const E2BIG: ::c_int = 7;
7686
+pub const ENOEXEC: ::c_int = 8;
7687
+pub const EBADF: ::c_int = 9;
7688
+pub const ECHILD: ::c_int = 10;
7689
+pub const EAGAIN: ::c_int = 11;
7690
+pub const ENOMEM: ::c_int = 12;
7691
+pub const EACCES: ::c_int = 13;
7692
+pub const EFAULT: ::c_int = 14;
7693
+pub const ENOTBLK: ::c_int = 15;
7694
+pub const EBUSY: ::c_int = 16;
7695
+pub const EEXIST: ::c_int = 17;
7696
+pub const EXDEV: ::c_int = 18;
7697
+pub const ENODEV: ::c_int = 19;
7698
+pub const ENOTDIR: ::c_int = 20;
7699
+pub const EISDIR: ::c_int = 21;
7700
+pub const EINVAL: ::c_int = 22;
7701
+pub const ENFILE: ::c_int = 23;
7702
+pub const EMFILE: ::c_int = 24;
7703
+pub const ENOTTY: ::c_int = 25;
7704
+pub const ETXTBSY: ::c_int = 26;
7705
+pub const EFBIG: ::c_int = 27;
7706
+pub const ENOSPC: ::c_int = 28;
7707
+pub const ESPIPE: ::c_int = 29;
7708
+pub const EROFS: ::c_int = 30;
7709
+pub const EMLINK: ::c_int = 31;
7710
+pub const EPIPE: ::c_int = 32;
7711
+pub const EDOM: ::c_int = 33;
7712
+pub const ERANGE: ::c_int = 34;
7713
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
7714
+
7715
+pub const SCM_RIGHTS: ::c_int = 0x01;
7716
+pub const SCM_CREDENTIALS: ::c_int = 0x02;
7717
+
7718
+pub const IPPROTO_RAW: ::c_int = 255;
7719
+
7720
+pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
7721
+pub const PROT_GROWSUP: ::c_int = 0x2000000;
7722
+
7723
+pub const MAP_TYPE: ::c_int = 0x000f;
7724
+
7725
+pub const MADV_NORMAL: ::c_int = 0;
7726
+pub const MADV_RANDOM: ::c_int = 1;
7727
+pub const MADV_SEQUENTIAL: ::c_int = 2;
7728
+pub const MADV_WILLNEED: ::c_int = 3;
7729
+pub const MADV_DONTNEED: ::c_int = 4;
7730
+pub const MADV_REMOVE: ::c_int = 9;
7731
+pub const MADV_DONTFORK: ::c_int = 10;
7732
+pub const MADV_DOFORK: ::c_int = 11;
7733
+pub const MADV_MERGEABLE: ::c_int = 12;
7734
+pub const MADV_UNMERGEABLE: ::c_int = 13;
7735
+pub const MADV_HWPOISON: ::c_int = 100;
7736
+
7737
+pub const IFF_UP: ::c_int = 0x1;
7738
+pub const IFF_BROADCAST: ::c_int = 0x2;
7739
+pub const IFF_DEBUG: ::c_int = 0x4;
7740
+pub const IFF_LOOPBACK: ::c_int = 0x8;
7741
+pub const IFF_POINTOPOINT: ::c_int = 0x10;
7742
+pub const IFF_NOTRAILERS: ::c_int = 0x20;
7743
+pub const IFF_RUNNING: ::c_int = 0x40;
7744
+pub const IFF_NOARP: ::c_int = 0x80;
7745
+pub const IFF_PROMISC: ::c_int = 0x100;
7746
+pub const IFF_ALLMULTI: ::c_int = 0x200;
7747
+pub const IFF_MASTER: ::c_int = 0x400;
7748
+pub const IFF_SLAVE: ::c_int = 0x800;
7749
+pub const IFF_MULTICAST: ::c_int = 0x1000;
7750
+pub const IFF_PORTSEL: ::c_int = 0x2000;
7751
+pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
7752
+pub const IFF_DYNAMIC: ::c_int = 0x8000;
7753
+
7754
+pub const SOL_IP: ::c_int = 0;
7755
+pub const SOL_TCP: ::c_int = 6;
7756
+pub const SOL_IPV6: ::c_int = 41;
7757
+pub const SOL_ICMPV6: ::c_int = 58;
7758
+pub const SOL_RAW: ::c_int = 255;
7759
+pub const SOL_DECNET: ::c_int = 261;
7760
+pub const SOL_X25: ::c_int = 262;
7761
+pub const SOL_PACKET: ::c_int = 263;
7762
+pub const SOL_ATM: ::c_int = 264;
7763
+pub const SOL_AAL: ::c_int = 265;
7764
+pub const SOL_IRDA: ::c_int = 266;
7765
+
7766
+pub const AF_UNSPEC: ::c_int = 0;
7767
+pub const AF_UNIX: ::c_int = 1;
7768
+pub const AF_LOCAL: ::c_int = 1;
7769
+pub const AF_INET: ::c_int = 2;
7770
+pub const AF_AX25: ::c_int = 3;
7771
+pub const AF_IPX: ::c_int = 4;
7772
+pub const AF_APPLETALK: ::c_int = 5;
7773
+pub const AF_NETROM: ::c_int = 6;
7774
+pub const AF_BRIDGE: ::c_int = 7;
7775
+pub const AF_ATMPVC: ::c_int = 8;
7776
+pub const AF_X25: ::c_int = 9;
7777
+pub const AF_INET6: ::c_int = 10;
7778
+pub const AF_ROSE: ::c_int = 11;
7779
+pub const AF_DECnet: ::c_int = 12;
7780
+pub const AF_NETBEUI: ::c_int = 13;
7781
+pub const AF_SECURITY: ::c_int = 14;
7782
+pub const AF_KEY: ::c_int = 15;
7783
+pub const AF_NETLINK: ::c_int = 16;
7784
+pub const AF_ROUTE: ::c_int = AF_NETLINK;
7785
+pub const AF_PACKET: ::c_int = 17;
7786
+pub const AF_ASH: ::c_int = 18;
7787
+pub const AF_ECONET: ::c_int = 19;
7788
+pub const AF_ATMSVC: ::c_int = 20;
7789
+pub const AF_SNA: ::c_int = 22;
7790
+pub const AF_IRDA: ::c_int = 23;
7791
+pub const AF_PPPOX: ::c_int = 24;
7792
+pub const AF_WANPIPE: ::c_int = 25;
7793
+pub const AF_LLC: ::c_int = 26;
7794
+pub const AF_CAN: ::c_int = 29;
7795
+pub const AF_TIPC: ::c_int = 30;
7796
+pub const AF_BLUETOOTH: ::c_int = 31;
7797
+pub const AF_IUCV: ::c_int = 32;
7798
+pub const AF_RXRPC: ::c_int = 33;
7799
+pub const AF_ISDN: ::c_int = 34;
7800
+pub const AF_PHONET: ::c_int = 35;
7801
+pub const AF_IEEE802154: ::c_int = 36;
7802
+pub const AF_CAIF: ::c_int = 37;
7803
+pub const AF_ALG: ::c_int = 38;
7804
+
7805
+pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
7806
+pub const PF_UNIX: ::c_int = AF_UNIX;
7807
+pub const PF_LOCAL: ::c_int = AF_LOCAL;
7808
+pub const PF_INET: ::c_int = AF_INET;
7809
+pub const PF_AX25: ::c_int = AF_AX25;
7810
+pub const PF_IPX: ::c_int = AF_IPX;
7811
+pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
7812
+pub const PF_NETROM: ::c_int = AF_NETROM;
7813
+pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
7814
+pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
7815
+pub const PF_X25: ::c_int = AF_X25;
7816
+pub const PF_INET6: ::c_int = AF_INET6;
7817
+pub const PF_ROSE: ::c_int = AF_ROSE;
7818
+pub const PF_DECnet: ::c_int = AF_DECnet;
7819
+pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
7820
+pub const PF_SECURITY: ::c_int = AF_SECURITY;
7821
+pub const PF_KEY: ::c_int = AF_KEY;
7822
+pub const PF_NETLINK: ::c_int = AF_NETLINK;
7823
+pub const PF_ROUTE: ::c_int = AF_ROUTE;
7824
+pub const PF_PACKET: ::c_int = AF_PACKET;
7825
+pub const PF_ASH: ::c_int = AF_ASH;
7826
+pub const PF_ECONET: ::c_int = AF_ECONET;
7827
+pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
7828
+pub const PF_SNA: ::c_int = AF_SNA;
7829
+pub const PF_IRDA: ::c_int = AF_IRDA;
7830
+pub const PF_PPPOX: ::c_int = AF_PPPOX;
7831
+pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
7832
+pub const PF_LLC: ::c_int = AF_LLC;
7833
+pub const PF_CAN: ::c_int = AF_CAN;
7834
+pub const PF_TIPC: ::c_int = AF_TIPC;
7835
+pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
7836
+pub const PF_IUCV: ::c_int = AF_IUCV;
7837
+pub const PF_RXRPC: ::c_int = AF_RXRPC;
7838
+pub const PF_ISDN: ::c_int = AF_ISDN;
7839
+pub const PF_PHONET: ::c_int = AF_PHONET;
7840
+pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
7841
+pub const PF_CAIF: ::c_int = AF_CAIF;
7842
+pub const PF_ALG: ::c_int = AF_ALG;
7843
+
7844
+pub const SOMAXCONN: ::c_int = 128;
7845
+
7846
+pub const MSG_OOB: ::c_int = 1;
7847
+pub const MSG_PEEK: ::c_int = 2;
7848
+pub const MSG_DONTROUTE: ::c_int = 4;
7849
+pub const MSG_CTRUNC: ::c_int = 8;
7850
+pub const MSG_TRUNC: ::c_int = 0x20;
7851
+pub const MSG_DONTWAIT: ::c_int = 0x40;
7852
+pub const MSG_EOR: ::c_int = 0x80;
7853
+pub const MSG_WAITALL: ::c_int = 0x100;
7854
+pub const MSG_FIN: ::c_int = 0x200;
7855
+pub const MSG_SYN: ::c_int = 0x400;
7856
+pub const MSG_CONFIRM: ::c_int = 0x800;
7857
+pub const MSG_RST: ::c_int = 0x1000;
7858
+pub const MSG_ERRQUEUE: ::c_int = 0x2000;
7859
+pub const MSG_NOSIGNAL: ::c_int = 0x4000;
7860
+pub const MSG_MORE: ::c_int = 0x8000;
7861
+pub const MSG_WAITFORONE: ::c_int = 0x10000;
7862
+pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
7863
+
7864
+pub const SOCK_RAW: ::c_int = 3;
7865
+pub const IPPROTO_ICMP: ::c_int = 1;
7866
+pub const IPPROTO_ICMPV6: ::c_int = 58;
7867
+pub const IPPROTO_TCP: ::c_int = 6;
7868
+pub const IPPROTO_IP: ::c_int = 0;
7869
+pub const IPPROTO_IPV6: ::c_int = 41;
7870
+pub const IP_MULTICAST_TTL: ::c_int = 33;
7871
+pub const IP_MULTICAST_LOOP: ::c_int = 34;
7872
+pub const IP_TTL: ::c_int = 2;
7873
+pub const IP_HDRINCL: ::c_int = 3;
7874
+pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
7875
+pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
7876
+
7877
+pub const TCP_NODELAY: ::c_int = 1;
7878
+pub const TCP_MAXSEG: ::c_int = 2;
7879
+pub const TCP_CORK: ::c_int = 3;
7880
+pub const TCP_KEEPIDLE: ::c_int = 4;
7881
+pub const TCP_KEEPINTVL: ::c_int = 5;
7882
+pub const TCP_KEEPCNT: ::c_int = 6;
7883
+pub const TCP_SYNCNT: ::c_int = 7;
7884
+pub const TCP_LINGER2: ::c_int = 8;
7885
+pub const TCP_DEFER_ACCEPT: ::c_int = 9;
7886
+pub const TCP_WINDOW_CLAMP: ::c_int = 10;
7887
+pub const TCP_INFO: ::c_int = 11;
7888
+pub const TCP_QUICKACK: ::c_int = 12;
7889
+pub const TCP_CONGESTION: ::c_int = 13;
7890
+
7891
+pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
7892
+pub const IPV6_V6ONLY: ::c_int = 26;
7893
+
7894
+pub const SO_DEBUG: ::c_int = 1;
7895
+
7896
+pub const SHUT_RD: ::c_int = 0;
7897
+pub const SHUT_WR: ::c_int = 1;
7898
+pub const SHUT_RDWR: ::c_int = 2;
7899
+
7900
+pub const LOCK_SH: ::c_int = 1;
7901
+pub const LOCK_EX: ::c_int = 2;
7902
+pub const LOCK_NB: ::c_int = 4;
7903
+pub const LOCK_UN: ::c_int = 8;
7904
+
7905
+pub const SS_ONSTACK: ::c_int = 1;
7906
+pub const SS_DISABLE: ::c_int = 2;
7907
+
7908
+pub const PATH_MAX: ::c_int = 4096;
7909
+
7910
+pub const FD_SETSIZE: usize = 1024;
7911
+
7912
+pub const EPOLLIN: ::c_int = 0x1;
7913
+pub const EPOLLPRI: ::c_int = 0x2;
7914
+pub const EPOLLOUT: ::c_int = 0x4;
7915
+pub const EPOLLRDNORM: ::c_int = 0x40;
7916
+pub const EPOLLRDBAND: ::c_int = 0x80;
7917
+pub const EPOLLWRNORM: ::c_int = 0x100;
7918
+pub const EPOLLWRBAND: ::c_int = 0x200;
7919
+pub const EPOLLMSG: ::c_int = 0x400;
7920
+pub const EPOLLERR: ::c_int = 0x8;
7921
+pub const EPOLLHUP: ::c_int = 0x10;
7922
+pub const EPOLLET: ::c_int = 0x80000000;
7923
+
7924
+pub const EPOLL_CTL_ADD: ::c_int = 1;
7925
+pub const EPOLL_CTL_MOD: ::c_int = 3;
7926
+pub const EPOLL_CTL_DEL: ::c_int = 2;
7927
+
7928
+pub const MNT_DETACH: ::c_int = 0x2;
7929
+pub const MNT_EXPIRE: ::c_int = 0x4;
7930
+
7931
+pub const MNT_FORCE: ::c_int = 0x1;
7932
+
7933
+pub const Q_SYNC: ::c_int = 0x600;
7934
+pub const Q_QUOTAON: ::c_int = 0x100;
7935
+pub const Q_QUOTAOFF: ::c_int = 0x200;
7936
+pub const Q_GETQUOTA: ::c_int = 0x300;
7937
+pub const Q_SETQUOTA: ::c_int = 0x400;
7938
+
7939
+pub const TCIOFF: ::c_int = 2;
7940
+pub const TCION: ::c_int = 3;
7941
+pub const TCOOFF: ::c_int = 0;
7942
+pub const TCOON: ::c_int = 1;
7943
+pub const TCIFLUSH: ::c_int = 0;
7944
+pub const TCOFLUSH: ::c_int = 1;
7945
+pub const TCIOFLUSH: ::c_int = 2;
7946
+pub const NL0: ::c_int  = 0x00000000;
7947
+pub const NL1: ::c_int  = 0x00000100;
7948
+pub const TAB0: ::c_int = 0x00000000;
7949
+pub const CR0: ::c_int  = 0x00000000;
7950
+pub const FF0: ::c_int  = 0x00000000;
7951
+pub const BS0: ::c_int  = 0x00000000;
7952
+pub const VT0: ::c_int  = 0x00000000;
7953
+pub const VERASE: usize = 2;
7954
+pub const VKILL: usize = 3;
7955
+pub const VINTR: usize = 0;
7956
+pub const VQUIT: usize = 1;
7957
+pub const VLNEXT: usize = 15;
7958
+pub const IGNBRK: ::tcflag_t = 0x00000001;
7959
+pub const BRKINT: ::tcflag_t = 0x00000002;
7960
+pub const IGNPAR: ::tcflag_t = 0x00000004;
7961
+pub const PARMRK: ::tcflag_t = 0x00000008;
7962
+pub const INPCK: ::tcflag_t = 0x00000010;
7963
+pub const ISTRIP: ::tcflag_t = 0x00000020;
7964
+pub const INLCR: ::tcflag_t = 0x00000040;
7965
+pub const IGNCR: ::tcflag_t = 0x00000080;
7966
+pub const ICRNL: ::tcflag_t = 0x00000100;
7967
+pub const IXANY: ::tcflag_t = 0x00000800;
7968
+pub const IMAXBEL: ::tcflag_t = 0x00002000;
7969
+pub const OPOST: ::tcflag_t = 0x1;
7970
+pub const CS5: ::tcflag_t = 0x00000000;
7971
+pub const CRTSCTS: ::tcflag_t = 0x80000000;
7972
+pub const ECHO: ::tcflag_t = 0x00000008;
7973
+
7974
+pub const CLONE_VM: ::c_int = 0x100;
7975
+pub const CLONE_FS: ::c_int = 0x200;
7976
+pub const CLONE_FILES: ::c_int = 0x400;
7977
+pub const CLONE_SIGHAND: ::c_int = 0x800;
7978
+pub const CLONE_PTRACE: ::c_int = 0x2000;
7979
+pub const CLONE_VFORK: ::c_int = 0x4000;
7980
+pub const CLONE_PARENT: ::c_int = 0x8000;
7981
+pub const CLONE_THREAD: ::c_int = 0x10000;
7982
+pub const CLONE_NEWNS: ::c_int = 0x20000;
7983
+pub const CLONE_SYSVSEM: ::c_int = 0x40000;
7984
+pub const CLONE_SETTLS: ::c_int = 0x80000;
7985
+pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
7986
+pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
7987
+pub const CLONE_DETACHED: ::c_int = 0x400000;
7988
+pub const CLONE_UNTRACED: ::c_int = 0x800000;
7989
+pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
7990
+pub const CLONE_NEWUTS: ::c_int = 0x04000000;
7991
+pub const CLONE_NEWIPC: ::c_int = 0x08000000;
7992
+pub const CLONE_NEWUSER: ::c_int = 0x10000000;
7993
+pub const CLONE_NEWPID: ::c_int = 0x20000000;
7994
+pub const CLONE_NEWNET: ::c_int = 0x40000000;
7995
+pub const CLONE_IO: ::c_int = 0x80000000;
7996
+
7997
+pub const WNOHANG: ::c_int = 0x00000001;
7998
+pub const WUNTRACED: ::c_int = 0x00000002;
7999
+pub const WSTOPPED: ::c_int = WUNTRACED;
8000
+pub const WEXITED: ::c_int = 0x00000004;
8001
+pub const WCONTINUED: ::c_int = 0x00000008;
8002
+pub const WNOWAIT: ::c_int = 0x01000000;
8003
+
8004
+pub const __WNOTHREAD: ::c_int = 0x20000000;
8005
+pub const __WALL: ::c_int = 0x40000000;
8006
+pub const __WCLONE: ::c_int = 0x80000000;
8007
+
8008
+pub const SPLICE_F_MOVE: ::c_uint = 0x01;
8009
+pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
8010
+pub const SPLICE_F_MORE: ::c_uint = 0x04;
8011
+pub const SPLICE_F_GIFT: ::c_uint = 0x08;
8012
+
8013
+pub const RTLD_LOCAL: ::c_int = 0;
8014
+
8015
+pub const POSIX_FADV_NORMAL: ::c_int = 0;
8016
+pub const POSIX_FADV_RANDOM: ::c_int = 1;
8017
+pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
8018
+pub const POSIX_FADV_WILLNEED: ::c_int = 3;
8019
+
8020
+pub const AT_FDCWD: ::c_int = -100;
8021
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
8022
+pub const AT_REMOVEDIR: ::c_int = 0x200;
8023
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
8024
+
8025
+pub const LOG_CRON: ::c_int = 9 << 3;
8026
+pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
8027
+pub const LOG_FTP: ::c_int = 11 << 3;
8028
+pub const LOG_PERROR: ::c_int = 0x20;
8029
+
8030
+pub const PIPE_BUF: usize = 4096;
8031
+
8032
+pub const SI_LOAD_SHIFT: ::c_uint = 16;
8033
+
8034
+pub const SIGEV_SIGNAL: ::c_int = 0;
8035
+pub const SIGEV_NONE: ::c_int = 1;
8036
+pub const SIGEV_THREAD: ::c_int = 2;
8037
+
8038
+pub const P_ALL: idtype_t = 0;
8039
+pub const P_PID: idtype_t = 1;
8040
+pub const P_PGID: idtype_t = 2;
8041
+
8042
+pub const UTIME_OMIT: c_long = 1073741822;
8043
+pub const UTIME_NOW: c_long = 1073741823;
8044
+
8045
+pub const L_tmpnam: ::c_uint = 20;
8046
+pub const _PC_LINK_MAX: ::c_int = 0;
8047
+pub const _PC_MAX_CANON: ::c_int = 1;
8048
+pub const _PC_MAX_INPUT: ::c_int = 2;
8049
+pub const _PC_NAME_MAX: ::c_int = 3;
8050
+pub const _PC_PATH_MAX: ::c_int = 4;
8051
+pub const _PC_PIPE_BUF: ::c_int = 5;
8052
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
8053
+pub const _PC_NO_TRUNC: ::c_int = 7;
8054
+pub const _PC_VDISABLE: ::c_int = 8;
8055
+
8056
+pub const _SC_ARG_MAX: ::c_int = 0;
8057
+pub const _SC_CHILD_MAX: ::c_int = 1;
8058
+pub const _SC_CLK_TCK: ::c_int = 2;
8059
+pub const _SC_NGROUPS_MAX: ::c_int = 3;
8060
+pub const _SC_OPEN_MAX: ::c_int = 4;
8061
+pub const _SC_STREAM_MAX: ::c_int = 5;
8062
+pub const _SC_TZNAME_MAX: ::c_int = 6;
8063
+pub const _SC_JOB_CONTROL: ::c_int = 7;
8064
+pub const _SC_SAVED_IDS: ::c_int = 8;
8065
+pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
8066
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
8067
+pub const _SC_TIMERS: ::c_int = 11;
8068
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
8069
+pub const _SC_PRIORITIZED_IO: ::c_int = 13;
8070
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
8071
+pub const _SC_FSYNC: ::c_int = 15;
8072
+pub const _SC_MAPPED_FILES: ::c_int = 16;
8073
+pub const _SC_MEMLOCK: ::c_int = 17;
8074
+pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
8075
+pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
8076
+pub const _SC_MESSAGE_PASSING: ::c_int = 20;
8077
+pub const _SC_SEMAPHORES: ::c_int = 21;
8078
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
8079
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
8080
+pub const _SC_AIO_MAX: ::c_int = 24;
8081
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
8082
+pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
8083
+pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
8084
+pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
8085
+pub const _SC_VERSION: ::c_int = 29;
8086
+pub const _SC_PAGESIZE: ::c_int = 30;
8087
+pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
8088
+pub const _SC_RTSIG_MAX: ::c_int = 31;
8089
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
8090
+pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
8091
+pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
8092
+pub const _SC_TIMER_MAX: ::c_int = 35;
8093
+pub const _SC_BC_BASE_MAX: ::c_int = 36;
8094
+pub const _SC_BC_DIM_MAX: ::c_int = 37;
8095
+pub const _SC_BC_SCALE_MAX: ::c_int = 38;
8096
+pub const _SC_BC_STRING_MAX: ::c_int = 39;
8097
+pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
8098
+pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
8099
+pub const _SC_LINE_MAX: ::c_int = 43;
8100
+pub const _SC_RE_DUP_MAX: ::c_int = 44;
8101
+pub const _SC_2_VERSION: ::c_int = 46;
8102
+pub const _SC_2_C_BIND: ::c_int = 47;
8103
+pub const _SC_2_C_DEV: ::c_int = 48;
8104
+pub const _SC_2_FORT_DEV: ::c_int = 49;
8105
+pub const _SC_2_FORT_RUN: ::c_int = 50;
8106
+pub const _SC_2_SW_DEV: ::c_int = 51;
8107
+pub const _SC_2_LOCALEDEF: ::c_int = 52;
8108
+pub const _SC_IOV_MAX: ::c_int = 60;
8109
+pub const _SC_THREADS: ::c_int = 67;
8110
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
8111
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
8112
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
8113
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
8114
+pub const _SC_TTY_NAME_MAX: ::c_int = 72;
8115
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
8116
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
8117
+pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
8118
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
8119
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
8120
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
8121
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
8122
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
8123
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
8124
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
8125
+pub const _SC_ATEXIT_MAX: ::c_int = 87;
8126
+pub const _SC_XOPEN_VERSION: ::c_int = 89;
8127
+pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
8128
+pub const _SC_XOPEN_UNIX: ::c_int = 91;
8129
+pub const _SC_XOPEN_CRYPT: ::c_int = 92;
8130
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
8131
+pub const _SC_XOPEN_SHM: ::c_int = 94;
8132
+pub const _SC_2_CHAR_TERM: ::c_int = 95;
8133
+pub const _SC_2_UPE: ::c_int = 97;
8134
+pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
8135
+pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
8136
+pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
8137
+pub const _SC_XOPEN_LEGACY: ::c_int = 129;
8138
+pub const _SC_XOPEN_REALTIME: ::c_int = 130;
8139
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
8140
+pub const _SC_HOST_NAME_MAX: ::c_int = 180;
8141
+
8142
+pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
8143
+pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
8144
+
8145
+pub const GLOB_ERR: ::c_int = 1 << 0;
8146
+pub const GLOB_MARK: ::c_int = 1 << 1;
8147
+pub const GLOB_NOSORT: ::c_int = 1 << 2;
8148
+pub const GLOB_DOOFFS: ::c_int = 1 << 3;
8149
+pub const GLOB_NOCHECK: ::c_int = 1 << 4;
8150
+pub const GLOB_APPEND: ::c_int = 1 << 5;
8151
+pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
8152
+
8153
+pub const GLOB_NOSPACE: ::c_int = 1;
8154
+pub const GLOB_ABORTED: ::c_int = 2;
8155
+pub const GLOB_NOMATCH: ::c_int = 3;
8156
+
8157
+pub const POSIX_MADV_NORMAL: ::c_int = 0;
8158
+pub const POSIX_MADV_RANDOM: ::c_int = 1;
8159
+pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
8160
+pub const POSIX_MADV_WILLNEED: ::c_int = 3;
8161
+
8162
+pub const S_IEXEC: mode_t = 64;
8163
+pub const S_IWRITE: mode_t = 128;
8164
+pub const S_IREAD: mode_t = 256;
8165
+
8166
+pub const F_LOCK: ::c_int = 1;
8167
+pub const F_TEST: ::c_int = 3;
8168
+pub const F_TLOCK: ::c_int = 2;
8169
+pub const F_ULOCK: ::c_int = 0;
8170
+
8171
+pub const ST_RDONLY: ::c_ulong = 1;
8172
+pub const ST_NOSUID: ::c_ulong = 2;
8173
+pub const ST_NODEV: ::c_ulong = 4;
8174
+pub const ST_NOEXEC: ::c_ulong = 8;
8175
+pub const ST_SYNCHRONOUS: ::c_ulong = 16;
8176
+pub const ST_MANDLOCK: ::c_ulong = 64;
8177
+pub const ST_WRITE: ::c_ulong = 128;
8178
+pub const ST_APPEND: ::c_ulong = 256;
8179
+pub const ST_IMMUTABLE: ::c_ulong = 512;
8180
+pub const ST_NOATIME: ::c_ulong = 1024;
8181
+pub const ST_NODIRATIME: ::c_ulong = 2048;
8182
+
8183
+pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
8184
+pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
8185
+pub const RTLD_NODELETE: ::c_int = 0x1000;
8186
+pub const RTLD_NOW: ::c_int = 0x2;
8187
+
8188
+pub const TCP_MD5SIG: ::c_int = 14;
8189
+
8190
+pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
8191
+    __align: [],
8192
+    size: [0; __SIZEOF_PTHREAD_MUTEX_T],
8193
+};
8194
+pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
8195
+    __align: [],
8196
+    size: [0; __SIZEOF_PTHREAD_COND_T],
8197
+};
8198
+pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
8199
+    __align: [],
8200
+    size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
8201
+};
8202
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
8203
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
8204
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
8205
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
8206
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
8207
+
8208
+pub const SCHED_OTHER: ::c_int = 0;
8209
+pub const SCHED_FIFO: ::c_int = 1;
8210
+pub const SCHED_RR: ::c_int = 2;
8211
+pub const SCHED_BATCH: ::c_int = 3;
8212
+pub const SCHED_IDLE: ::c_int = 5;
8213
+
8214
+// System V IPC
8215
+pub const IPC_PRIVATE: ::key_t = 0;
8216
+
8217
+pub const IPC_CREAT: ::c_int = 0o1000;
8218
+pub const IPC_EXCL: ::c_int = 0o2000;
8219
+pub const IPC_NOWAIT: ::c_int = 0o4000;
8220
+
8221
+pub const IPC_RMID: ::c_int = 0;
8222
+pub const IPC_SET: ::c_int = 1;
8223
+pub const IPC_STAT: ::c_int = 2;
8224
+pub const IPC_INFO: ::c_int = 3;
8225
+pub const MSG_STAT: ::c_int = 11;
8226
+pub const MSG_INFO: ::c_int = 12;
8227
+
8228
+pub const MSG_NOERROR: ::c_int = 0o10000;
8229
+pub const MSG_EXCEPT: ::c_int = 0o20000;
8230
+
8231
+pub const SHM_R: ::c_int = 0o400;
8232
+pub const SHM_W: ::c_int = 0o200;
8233
+
8234
+pub const SHM_RDONLY: ::c_int = 0o10000;
8235
+pub const SHM_RND: ::c_int = 0o20000;
8236
+pub const SHM_REMAP: ::c_int = 0o40000;
8237
+
8238
+pub const SHM_LOCK: ::c_int = 11;
8239
+pub const SHM_UNLOCK: ::c_int = 12;
8240
+
8241
+pub const SHM_HUGETLB: ::c_int = 0o4000;
8242
+pub const SHM_NORESERVE: ::c_int = 0o10000;
8243
+
8244
+pub const EPOLLRDHUP: ::c_int = 0x2000;
8245
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
8246
+
8247
+pub const QFMT_VFS_OLD: ::c_int = 1;
8248
+pub const QFMT_VFS_V0: ::c_int = 2;
8249
+
8250
+pub const EFD_SEMAPHORE: ::c_int = 0x1;
8251
+
8252
+pub const LOG_NFACILITIES: ::c_int = 24;
8253
+
8254
+pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
8255
+
8256
+pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
8257
+pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
8258
+pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
8259
+pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
8260
+pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
8261
+
8262
+pub const AI_PASSIVE: ::c_int = 0x0001;
8263
+pub const AI_CANONNAME: ::c_int = 0x0002;
8264
+pub const AI_NUMERICHOST: ::c_int = 0x0004;
8265
+pub const AI_V4MAPPED: ::c_int = 0x0008;
8266
+pub const AI_ALL: ::c_int = 0x0010;
8267
+pub const AI_ADDRCONFIG: ::c_int = 0x0020;
8268
+
8269
+pub const AI_NUMERICSERV: ::c_int = 0x0400;
8270
+
8271
+pub const EAI_BADFLAGS: ::c_int = -1;
8272
+pub const EAI_NONAME: ::c_int = -2;
8273
+pub const EAI_AGAIN: ::c_int = -3;
8274
+pub const EAI_FAIL: ::c_int = -4;
8275
+pub const EAI_FAMILY: ::c_int = -6;
8276
+pub const EAI_SOCKTYPE: ::c_int = -7;
8277
+pub const EAI_SERVICE: ::c_int = -8;
8278
+pub const EAI_MEMORY: ::c_int = -10;
8279
+pub const EAI_OVERFLOW: ::c_int = -12;
8280
+
8281
+pub const NI_NUMERICHOST: ::c_int = 1;
8282
+pub const NI_NUMERICSERV: ::c_int = 2;
8283
+pub const NI_NOFQDN: ::c_int = 4;
8284
+pub const NI_NAMEREQD: ::c_int = 8;
8285
+pub const NI_DGRAM: ::c_int = 16;
8286
+
8287
+pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
8288
+pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
8289
+pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
8290
+
8291
+pub const EAI_SYSTEM: ::c_int = -11;
8292
+
8293
+pub const MREMAP_MAYMOVE: ::c_int = 1;
8294
+pub const MREMAP_FIXED: ::c_int = 2;
8295
+
8296
+pub const PR_SET_PDEATHSIG: ::c_int = 1;
8297
+pub const PR_GET_PDEATHSIG: ::c_int = 2;
8298
+
8299
+pub const PR_GET_DUMPABLE: ::c_int = 3;
8300
+pub const PR_SET_DUMPABLE: ::c_int = 4;
8301
+
8302
+pub const PR_GET_UNALIGN: ::c_int = 5;
8303
+pub const PR_SET_UNALIGN: ::c_int = 6;
8304
+pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
8305
+pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
8306
+
8307
+pub const PR_GET_KEEPCAPS: ::c_int = 7;
8308
+pub const PR_SET_KEEPCAPS: ::c_int = 8;
8309
+
8310
+pub const PR_GET_FPEMU: ::c_int = 9;
8311
+pub const PR_SET_FPEMU: ::c_int = 10;
8312
+pub const PR_FPEMU_NOPRINT: ::c_int = 1;
8313
+pub const PR_FPEMU_SIGFPE: ::c_int = 2;
8314
+
8315
+pub const PR_GET_FPEXC: ::c_int = 11;
8316
+pub const PR_SET_FPEXC: ::c_int = 12;
8317
+pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
8318
+pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
8319
+pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
8320
+pub const PR_FP_EXC_UND: ::c_int = 0x040000;
8321
+pub const PR_FP_EXC_RES: ::c_int = 0x080000;
8322
+pub const PR_FP_EXC_INV: ::c_int = 0x100000;
8323
+pub const PR_FP_EXC_DISABLED: ::c_int = 0;
8324
+pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
8325
+pub const PR_FP_EXC_ASYNC: ::c_int = 2;
8326
+pub const PR_FP_EXC_PRECISE: ::c_int = 3;
8327
+
8328
+pub const PR_GET_TIMING: ::c_int = 13;
8329
+pub const PR_SET_TIMING: ::c_int = 14;
8330
+pub const PR_TIMING_STATISTICAL: ::c_int = 0;
8331
+pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
8332
+
8333
+pub const PR_SET_NAME: ::c_int = 15;
8334
+pub const PR_GET_NAME: ::c_int = 16;
8335
+
8336
+pub const PR_GET_ENDIAN: ::c_int = 19;
8337
+pub const PR_SET_ENDIAN: ::c_int = 20;
8338
+pub const PR_ENDIAN_BIG: ::c_int = 0;
8339
+pub const PR_ENDIAN_LITTLE: ::c_int = 1;
8340
+pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
8341
+
8342
+pub const PR_GET_SECCOMP: ::c_int = 21;
8343
+pub const PR_SET_SECCOMP: ::c_int = 22;
8344
+
8345
+pub const PR_CAPBSET_READ: ::c_int = 23;
8346
+pub const PR_CAPBSET_DROP: ::c_int = 24;
8347
+
8348
+pub const PR_GET_TSC: ::c_int = 25;
8349
+pub const PR_SET_TSC: ::c_int = 26;
8350
+pub const PR_TSC_ENABLE: ::c_int = 1;
8351
+pub const PR_TSC_SIGSEGV: ::c_int = 2;
8352
+
8353
+pub const PR_GET_SECUREBITS: ::c_int = 27;
8354
+pub const PR_SET_SECUREBITS: ::c_int = 28;
8355
+
8356
+pub const PR_SET_TIMERSLACK: ::c_int = 29;
8357
+pub const PR_GET_TIMERSLACK: ::c_int = 30;
8358
+
8359
+pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
8360
+pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
8361
+
8362
+pub const PR_MCE_KILL: ::c_int = 33;
8363
+pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
8364
+pub const PR_MCE_KILL_SET: ::c_int = 1;
8365
+
8366
+pub const PR_MCE_KILL_LATE: ::c_int = 0;
8367
+pub const PR_MCE_KILL_EARLY: ::c_int = 1;
8368
+pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
8369
+
8370
+pub const PR_MCE_KILL_GET: ::c_int = 34;
8371
+
8372
+pub const PR_SET_MM: ::c_int = 35;
8373
+pub const PR_SET_MM_START_CODE: ::c_int = 1;
8374
+pub const PR_SET_MM_END_CODE: ::c_int = 2;
8375
+pub const PR_SET_MM_START_DATA: ::c_int = 3;
8376
+pub const PR_SET_MM_END_DATA: ::c_int = 4;
8377
+pub const PR_SET_MM_START_STACK: ::c_int = 5;
8378
+pub const PR_SET_MM_START_BRK: ::c_int = 6;
8379
+pub const PR_SET_MM_BRK: ::c_int = 7;
8380
+pub const PR_SET_MM_ARG_START: ::c_int = 8;
8381
+pub const PR_SET_MM_ARG_END: ::c_int = 9;
8382
+pub const PR_SET_MM_ENV_START: ::c_int = 10;
8383
+pub const PR_SET_MM_ENV_END: ::c_int = 11;
8384
+pub const PR_SET_MM_AUXV: ::c_int = 12;
8385
+pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
8386
+pub const PR_SET_MM_MAP: ::c_int = 14;
8387
+pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
8388
+
8389
+pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
8390
+
8391
+pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
8392
+pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
8393
+
8394
+pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
8395
+pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
8396
+
8397
+pub const PR_GET_TID_ADDRESS: ::c_int = 40;
8398
+
8399
+pub const PR_SET_THP_DISABLE: ::c_int = 41;
8400
+pub const PR_GET_THP_DISABLE: ::c_int = 42;
8401
+
8402
+pub const ABDAY_1: ::nl_item = 0x300;
8403
+pub const ABDAY_2: ::nl_item = 0x301;
8404
+pub const ABDAY_3: ::nl_item = 0x302;
8405
+pub const ABDAY_4: ::nl_item = 0x303;
8406
+pub const ABDAY_5: ::nl_item = 0x304;
8407
+pub const ABDAY_6: ::nl_item = 0x305;
8408
+pub const ABDAY_7: ::nl_item = 0x306;
8409
+
8410
+pub const DAY_1: ::nl_item = 0x307;
8411
+pub const DAY_2: ::nl_item = 0x308;
8412
+pub const DAY_3: ::nl_item = 0x309;
8413
+pub const DAY_4: ::nl_item = 0x30A;
8414
+pub const DAY_5: ::nl_item = 0x30B;
8415
+pub const DAY_6: ::nl_item = 0x30C;
8416
+pub const DAY_7: ::nl_item = 0x30D;
8417
+
8418
+pub const ABMON_1: ::nl_item = 0x30E;
8419
+pub const ABMON_2: ::nl_item = 0x30F;
8420
+pub const ABMON_3: ::nl_item = 0x310;
8421
+pub const ABMON_4: ::nl_item = 0x311;
8422
+pub const ABMON_5: ::nl_item = 0x312;
8423
+pub const ABMON_6: ::nl_item = 0x313;
8424
+pub const ABMON_7: ::nl_item = 0x314;
8425
+pub const ABMON_8: ::nl_item = 0x315;
8426
+pub const ABMON_9: ::nl_item = 0x316;
8427
+pub const ABMON_10: ::nl_item = 0x317;
8428
+pub const ABMON_11: ::nl_item = 0x318;
8429
+pub const ABMON_12: ::nl_item = 0x319;
8430
+
8431
+pub const MON_1: ::nl_item = 0x31A;
8432
+pub const MON_2: ::nl_item = 0x31B;
8433
+pub const MON_3: ::nl_item = 0x31C;
8434
+pub const MON_4: ::nl_item = 0x31D;
8435
+pub const MON_5: ::nl_item = 0x31E;
8436
+pub const MON_6: ::nl_item = 0x31F;
8437
+pub const MON_7: ::nl_item = 0x320;
8438
+pub const MON_8: ::nl_item = 0x321;
8439
+pub const MON_9: ::nl_item = 0x322;
8440
+pub const MON_10: ::nl_item = 0x323;
8441
+pub const MON_11: ::nl_item = 0x324;
8442
+pub const MON_12: ::nl_item = 0x325;
8443
+
8444
+pub const AM_STR: ::nl_item = 0x326;
8445
+pub const PM_STR: ::nl_item = 0x327;
8446
+
8447
+pub const D_T_FMT: ::nl_item = 0x328;
8448
+pub const D_FMT: ::nl_item = 0x329;
8449
+pub const T_FMT: ::nl_item = 0x32A;
8450
+pub const T_FMT_AMPM: ::nl_item = 0x32B;
8451
+
8452
+pub const ERA: ::nl_item = 0x32C;
8453
+pub const ERA_D_FMT: ::nl_item = 0x32E;
8454
+pub const ALT_DIGITS: ::nl_item = 0x32F;
8455
+pub const ERA_D_T_FMT: ::nl_item = 0x330;
8456
+pub const ERA_T_FMT: ::nl_item = 0x331;
8457
+
8458
+pub const CODESET: ::nl_item = 10;
8459
+
8460
+pub const CRNCYSTR: ::nl_item = 0x215;
8461
+
8462
+pub const RADIXCHAR: ::nl_item = 0x100;
8463
+pub const THOUSEP: ::nl_item = 0x101;
8464
+
8465
+pub const NOEXPR: ::nl_item = 0x501;
8466
+pub const YESSTR: ::nl_item = 0x502;
8467
+pub const NOSTR: ::nl_item = 0x503;
8468
+
8469
+pub const FILENAME_MAX: ::c_uint = 4095;
8470
+
8471
+pub const AF_MAX: ::c_int = 39;
8472
+
8473
+f! {
8474
+    pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
8475
+        let fd = fd as usize;
8476
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
8477
+        (*set).fds_bits[fd / size] &= !(1 << (fd % size));
8478
+        return
8479
+    }
8480
+
8481
+    pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool {
8482
+        let fd = fd as usize;
8483
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
8484
+        return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
8485
+    }
8486
+
8487
+    pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
8488
+        let fd = fd as usize;
8489
+        let size = mem::size_of_val(&(*set).fds_bits[0]) * 8;
8490
+        (*set).fds_bits[fd / size] |= 1 << (fd % size);
8491
+        return
8492
+    }
8493
+
8494
+    pub fn FD_ZERO(set: *mut fd_set) -> () {
8495
+        for slot in (*set).fds_bits.iter_mut() {
8496
+            *slot = 0;
8497
+        }
8498
+    }
8499
+
8500
+    pub fn WIFSTOPPED(status: ::c_int) -> bool {
8501
+        (status & 0xff) == 0x7f
8502
+    }
8503
+
8504
+    pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
8505
+        (status >> 8) & 0xff
8506
+    }
8507
+
8508
+    pub fn WIFCONTINUED(status: ::c_int) -> bool {
8509
+        status == 0xffff
8510
+    }
8511
+
8512
+    pub fn WIFSIGNALED(status: ::c_int) -> bool {
8513
+        ((status & 0x7f) + 1) as i8 >= 2
8514
+    }
8515
+
8516
+    pub fn WTERMSIG(status: ::c_int) -> ::c_int {
8517
+        status & 0x7f
8518
+    }
8519
+
8520
+    pub fn WIFEXITED(status: ::c_int) -> bool {
8521
+        (status & 0x7f) == 0
8522
+    }
8523
+
8524
+    pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
8525
+        (status >> 8) & 0xff
8526
+    }
8527
+
8528
+    pub fn WCOREDUMP(status: ::c_int) -> bool {
8529
+        (status & 0x80) != 0
8530
+    }
8531
+
8532
+    pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
8533
+        for slot in cpuset.bits.iter_mut() {
8534
+            *slot = 0;
8535
+        }
8536
+    }
8537
+
8538
+    pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
8539
+        let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
8540
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
8541
+        cpuset.bits[idx] |= 1 << offset;
8542
+        ()
8543
+    }
8544
+
8545
+    pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
8546
+        let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
8547
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
8548
+        cpuset.bits[idx] &= !(1 << offset);
8549
+        ()
8550
+    }
8551
+
8552
+    pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
8553
+        let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]);
8554
+        let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
8555
+        0 != (cpuset.bits[idx] & (1 << offset))
8556
+    }
8557
+
8558
+    pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
8559
+        set1.bits == set2.bits
8560
+    }
8561
+}
8562
+
8563
+extern {
8564
+    pub fn getpwnam_r(name: *const ::c_char,
8565
+                      pwd: *mut passwd,
8566
+                      buf: *mut ::c_char,
8567
+                      buflen: ::size_t,
8568
+                      result: *mut *mut passwd) -> ::c_int;
8569
+    pub fn getpwuid_r(uid: ::uid_t,
8570
+                      pwd: *mut passwd,
8571
+                      buf: *mut ::c_char,
8572
+                      buflen: ::size_t,
8573
+                      result: *mut *mut passwd) -> ::c_int;
8574
+    pub fn fdatasync(fd: ::c_int) -> ::c_int;
8575
+    pub fn mincore(addr: *mut ::c_void, len: ::size_t,
8576
+                   vec: *mut ::c_uchar) -> ::c_int;
8577
+    pub fn clock_getres(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
8578
+    pub fn clock_gettime(clk_id: clockid_t, tp: *mut ::timespec) -> ::c_int;
8579
+    pub fn clock_nanosleep(clk_id: clockid_t,
8580
+                           flags: ::c_int,
8581
+                           rqtp: *const ::timespec,
8582
+                           rmtp:  *mut ::timespec) -> ::c_int;
8583
+    pub fn clock_settime(clk_id: clockid_t, tp: *const ::timespec) -> ::c_int;
8584
+    pub fn prctl(option: ::c_int, ...) -> ::c_int;
8585
+    pub fn pthread_getattr_np(native: ::pthread_t,
8586
+                              attr: *mut ::pthread_attr_t) -> ::c_int;
8587
+    pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
8588
+                                     guardsize: *mut ::size_t) -> ::c_int;
8589
+    pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
8590
+                                 stackaddr: *mut *mut ::c_void,
8591
+                                 stacksize: *mut ::size_t) -> ::c_int;
8592
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
8593
+    pub fn setgroups(ngroups: ::size_t,
8594
+                     ptr: *const ::gid_t) -> ::c_int;
8595
+    pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
8596
+    pub fn sched_setscheduler(pid: ::pid_t,
8597
+                              policy: ::c_int,
8598
+                              param: *const sched_param) -> ::c_int;
8599
+    pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
8600
+    pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
8601
+    pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
8602
+    pub fn epoll_create(size: ::c_int) -> ::c_int;
8603
+    pub fn epoll_create1(flags: ::c_int) -> ::c_int;
8604
+    pub fn epoll_ctl(epfd: ::c_int,
8605
+                     op: ::c_int,
8606
+                     fd: ::c_int,
8607
+                     event: *mut epoll_event) -> ::c_int;
8608
+    pub fn epoll_wait(epfd: ::c_int,
8609
+                      events: *mut epoll_event,
8610
+                      maxevents: ::c_int,
8611
+                      timeout: ::c_int) -> ::c_int;
8612
+    pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
8613
+    pub fn mount(src: *const ::c_char,
8614
+                 target: *const ::c_char,
8615
+                 fstype: *const ::c_char,
8616
+                 flags: ::c_ulong,
8617
+                 data: *const ::c_void) -> ::c_int;
8618
+    pub fn umount(target: *const ::c_char) -> ::c_int;
8619
+    pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
8620
+    pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int,
8621
+                 child_stack: *mut ::c_void,
8622
+                 flags: ::c_int,
8623
+                 arg: *mut ::c_void, ...) -> ::c_int;
8624
+    pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
8625
+    pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
8626
+    pub fn memrchr(cx: *const ::c_void,
8627
+                   c: ::c_int,
8628
+                   n: ::size_t) -> *mut ::c_void;
8629
+    pub fn syscall(num: ::c_long, ...) -> ::c_long;
8630
+    pub fn sendfile(out_fd: ::c_int,
8631
+                    in_fd: ::c_int,
8632
+                    offset: *mut off_t,
8633
+                    count: ::size_t) -> ::ssize_t;
8634
+    pub fn splice(fd_in: ::c_int,
8635
+                  off_in: *mut ::loff_t,
8636
+                  fd_out: ::c_int,
8637
+                  off_out: *mut ::loff_t,
8638
+                  len: ::size_t,
8639
+                  flags: ::c_uint) -> ::ssize_t;
8640
+    pub fn tee(fd_in: ::c_int,
8641
+               fd_out: ::c_int,
8642
+               len: ::size_t,
8643
+               flags: ::c_uint) -> ::ssize_t;
8644
+    pub fn vmsplice(fd: ::c_int,
8645
+                    iov: *const ::iovec,
8646
+                    nr_segs: ::size_t,
8647
+                    flags: ::c_uint) -> ::ssize_t;
8648
+
8649
+    pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
8650
+                         advise: ::c_int) -> ::c_int;
8651
+    pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
8652
+    pub fn utimensat(dirfd: ::c_int, path: *const ::c_char,
8653
+                     times: *const ::timespec, flag: ::c_int) -> ::c_int;
8654
+    pub fn duplocale(base: ::locale_t) -> ::locale_t;
8655
+    pub fn freelocale(loc: ::locale_t);
8656
+    pub fn newlocale(mask: ::c_int,
8657
+                     locale: *const ::c_char,
8658
+                     base: ::locale_t) -> ::locale_t;
8659
+    pub fn uselocale(loc: ::locale_t) -> ::locale_t;
8660
+    pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
8661
+    pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
8662
+    pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
8663
+    pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
8664
+    pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
8665
+    pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
8666
+    pub fn mmap64(addr: *mut ::c_void,
8667
+                  len: ::size_t,
8668
+                  prot: ::c_int,
8669
+                  flags: ::c_int,
8670
+                  fd: ::c_int,
8671
+                  offset: off64_t)
8672
+                  -> *mut ::c_void;
8673
+    pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
8674
+    pub fn openat64(fd: ::c_int,
8675
+                    path: *const c_char,
8676
+                    oflag: ::c_int, ...) -> ::c_int;
8677
+    pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
8678
+                   offset: off64_t) -> ::ssize_t;
8679
+    pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
8680
+                    offset: off64_t) -> ::ssize_t;
8681
+    pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
8682
+    pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
8683
+                       result: *mut *mut ::dirent64) -> ::c_int;
8684
+    pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
8685
+    pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
8686
+    pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
8687
+    pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
8688
+
8689
+    pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
8690
+
8691
+    pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
8692
+                   mode: ::mode_t, dev: dev_t) -> ::c_int;
8693
+    pub fn ppoll(fds: *mut ::pollfd,
8694
+                 nfds: nfds_t,
8695
+                 timeout: *const ::timespec,
8696
+                 sigmask: *const sigset_t) -> ::c_int;
8697
+    pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
8698
+                                     clock_id: *mut clockid_t) -> ::c_int;
8699
+    pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
8700
+                                     clock_id: clockid_t) -> ::c_int;
8701
+    pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
8702
+                                       pshared: ::c_int) -> ::c_int;
8703
+    pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
8704
+                                       pshared: *mut ::c_int) -> ::c_int;
8705
+    pub fn sched_getaffinity(pid: ::pid_t,
8706
+                             cpusetsize: ::size_t,
8707
+                             cpuset: *mut cpu_set_t) -> ::c_int;
8708
+    pub fn sched_setaffinity(pid: ::pid_t,
8709
+                             cpusetsize: ::size_t,
8710
+                             cpuset: *const cpu_set_t) -> ::c_int;
8711
+    pub fn unshare(flags: ::c_int) -> ::c_int;
8712
+    pub fn sem_timedwait(sem: *mut sem_t,
8713
+                         abstime: *const ::timespec) -> ::c_int;
8714
+    pub fn accept4(fd: ::c_int, addr: *mut ::sockaddr, len: *mut ::socklen_t,
8715
+                   flg: ::c_int) -> ::c_int;
8716
+    pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
8717
+                                   abstime: *const ::timespec) -> ::c_int;
8718
+    pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
8719
+                                        pshared: ::c_int) -> ::c_int;
8720
+    pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
8721
+                                        pshared: *mut ::c_int) -> ::c_int;
8722
+    pub fn ptsname_r(fd: ::c_int,
8723
+                     buf: *mut ::c_char,
8724
+                     buflen: ::size_t) -> ::c_int;
8725
+    pub fn clearenv() -> ::c_int;
8726
+    pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
8727
+                  options: ::c_int) -> ::c_int;
8728
+
8729
+    pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
8730
+
8731
+    pub fn setpwent();
8732
+    pub fn getpwent() -> *mut passwd;
8733
+    pub fn setspent();
8734
+    pub fn endspent();
8735
+    pub fn getspent() -> *mut spwd;
8736
+    pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
8737
+
8738
+    pub fn shm_open(name: *const c_char, oflag: ::c_int,
8739
+                    mode: mode_t) -> ::c_int;
8740
+
8741
+    // System V IPC
8742
+    pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
8743
+    pub fn shmat(shmid: ::c_int,
8744
+                 shmaddr: *const ::c_void,
8745
+                 shmflg: ::c_int) -> *mut ::c_void;
8746
+    pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
8747
+    pub fn shmctl(shmid: ::c_int,
8748
+                  cmd: ::c_int,
8749
+                  buf: *mut ::shmid_ds) -> ::c_int;
8750
+    pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
8751
+    pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
8752
+    pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
8753
+    pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
8754
+                  msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t;
8755
+    pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
8756
+                  msgflg: ::c_int) -> ::c_int;
8757
+
8758
+    pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
8759
+                    -> ::c_int;
8760
+    pub fn __errno_location() -> *mut ::c_int;
8761
+
8762
+    pub fn fopen64(filename: *const c_char,
8763
+                   mode: *const c_char) -> *mut ::FILE;
8764
+    pub fn freopen64(filename: *const c_char, mode: *const c_char,
8765
+                     file: *mut ::FILE) -> *mut ::FILE;
8766
+    pub fn tmpfile64() -> *mut ::FILE;
8767
+    pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
8768
+    pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
8769
+    pub fn fseeko64(stream: *mut ::FILE,
8770
+                    offset: ::off64_t,
8771
+                    whence: ::c_int) -> ::c_int;
8772
+    pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
8773
+    pub fn readahead(fd: ::c_int, offset: ::off64_t,
8774
+                     count: ::size_t) -> ::ssize_t;
8775
+    pub fn getxattr(path: *const c_char, name: *const c_char,
8776
+                    value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
8777
+    pub fn lgetxattr(path: *const c_char, name: *const c_char,
8778
+                     value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
8779
+    pub fn fgetxattr(filedes: ::c_int, name: *const c_char,
8780
+                     value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
8781
+    pub fn setxattr(path: *const c_char, name: *const c_char,
8782
+                    value: *const ::c_void, size: ::size_t,
8783
+                    flags: ::c_int) -> ::c_int;
8784
+    pub fn lsetxattr(path: *const c_char, name: *const c_char,
8785
+                     value: *const ::c_void, size: ::size_t,
8786
+                     flags: ::c_int) -> ::c_int;
8787
+    pub fn fsetxattr(filedes: ::c_int, name: *const c_char,
8788
+                     value: *const ::c_void, size: ::size_t,
8789
+                     flags: ::c_int) -> ::c_int;
8790
+    pub fn listxattr(path: *const c_char, list: *mut c_char,
8791
+                     size: ::size_t) -> ::ssize_t;
8792
+    pub fn llistxattr(path: *const c_char, list: *mut c_char,
8793
+                      size: ::size_t) -> ::ssize_t;
8794
+    pub fn flistxattr(filedes: ::c_int, list: *mut c_char,
8795
+                      size: ::size_t) -> ::ssize_t;
8796
+    pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
8797
+    pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
8798
+    pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
8799
+    pub fn signalfd(fd: ::c_int,
8800
+                    mask: *const ::sigset_t,
8801
+                    flags: ::c_int) -> ::c_int;
8802
+    pub fn quotactl(cmd: ::c_int,
8803
+                    special: *const ::c_char,
8804
+                    id: ::c_int,
8805
+                    data: *mut ::c_char) -> ::c_int;
8806
+    pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
8807
+    pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
8808
+    pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
8809
+    pub fn mq_receive(mqd: ::mqd_t,
8810
+                      msg_ptr: *mut ::c_char,
8811
+                      msg_len: ::size_t,
8812
+                      msq_prio: *mut ::c_uint) -> ::ssize_t;
8813
+    pub fn mq_send(mqd: ::mqd_t,
8814
+                   msg_ptr: *const ::c_char,
8815
+                   msg_len: ::size_t,
8816
+                   msq_prio: ::c_uint) -> ::c_int;
8817
+    pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
8818
+    pub fn mq_setattr(mqd: ::mqd_t,
8819
+                      newattr: *const ::mq_attr,
8820
+                      oldattr: *mut ::mq_attr) -> ::c_int;
8821
+    pub fn epoll_pwait(epfd: ::c_int,
8822
+                       events: *mut ::epoll_event,
8823
+                       maxevents: ::c_int,
8824
+                       timeout: ::c_int,
8825
+                       sigmask: *const ::sigset_t) -> ::c_int;
8826
+    pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
8827
+    pub fn sigtimedwait(set: *const sigset_t,
8828
+                        info: *mut siginfo_t,
8829
+                        timeout: *const ::timespec) -> ::c_int;
8830
+    pub fn sigwaitinfo(set: *const sigset_t,
8831
+                       info: *mut siginfo_t) -> ::c_int;
8832
+    pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
8833
+    pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit,
8834
+                   old_limit: *mut ::rlimit) -> ::c_int;
8835
+    pub fn prlimit64(pid: ::pid_t,
8836
+                     resource: ::c_int,
8837
+                     new_limit: *const ::rlimit64,
8838
+                     old_limit: *mut ::rlimit64) -> ::c_int;
8839
+    pub fn reboot(how_to: ::c_int) -> ::c_int;
8840
+    pub fn setfsgid(gid: ::gid_t) -> ::c_int;
8841
+    pub fn setfsuid(uid: ::uid_t) -> ::c_int;
8842
+    pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
8843
+    pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
8844
+
8845
+    // Not available now on Android
8846
+    pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
8847
+                    mode: ::mode_t) -> ::c_int;
8848
+    pub fn if_nameindex() -> *mut if_nameindex;
8849
+    pub fn if_freenameindex(ptr: *mut if_nameindex);
8850
+    pub fn sync_file_range(fd: ::c_int, offset: ::off64_t,
8851
+                           nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
8852
+    pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
8853
+    pub fn freeifaddrs(ifa: *mut ::ifaddrs);
8854
+
8855
+    pub fn mremap(addr: *mut ::c_void,
8856
+                  len: ::size_t,
8857
+                  new_len: ::size_t,
8858
+                  flags: ::c_int,
8859
+                  ...) -> *mut ::c_void;
8860
+
8861
+    pub fn glob(pattern: *const c_char,
8862
+                flags: ::c_int,
8863
+                errfunc: Option<extern fn(epath: *const c_char,
8864
+                                          errno: ::c_int) -> ::c_int>,
8865
+                pglob: *mut ::glob_t) -> ::c_int;
8866
+    pub fn globfree(pglob: *mut ::glob_t);
8867
+
8868
+    pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
8869
+
8870
+    pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
8871
+
8872
+    pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
8873
+    pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
8874
+                  -> ::c_int;
8875
+
8876
+    pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
8877
+
8878
+    pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
8879
+                    flags: ::c_int, addr: *mut ::sockaddr,
8880
+                    addrlen: *mut ::socklen_t) -> ::ssize_t;
8881
+    pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
8882
+
8883
+    pub fn bind(socket: ::c_int, address: *const ::sockaddr,
8884
+                address_len: ::socklen_t) -> ::c_int;
8885
+
8886
+    pub fn writev(fd: ::c_int,
8887
+                  iov: *const ::iovec,
8888
+                  iovcnt: ::c_int) -> ::ssize_t;
8889
+    pub fn readv(fd: ::c_int,
8890
+                 iov: *const ::iovec,
8891
+                 iovcnt: ::c_int) -> ::ssize_t;
8892
+
8893
+    pub fn sendmsg(fd: ::c_int,
8894
+                   msg: *const ::msghdr,
8895
+                   flags: ::c_int) -> ::ssize_t;
8896
+    pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
8897
+                   -> ::ssize_t;
8898
+}
8899
+
8900
+cfg_if! {
8901
+    if #[cfg(target_arch = "mips")] {
8902
+        mod mips;
8903
+        pub use self::mips::*;
8904
+    } else if #[cfg(target_arch = "x86_64")] {
8905
+        mod x86_64;
8906
+        pub use self::x86_64::*;
8907
+    } else {
8908
+        pub use unsupported_target;
8909
+    }
8910
+}
8911
+
8912
diff --git third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs
8913
new file mode 100644
8914
index 000000000000..27222013479c
8915
--- /dev/null
8916
+++ third_party/rust/libc/src/unix/uclibc/x86_64/mod.rs
8917
@@ -0,0 +1,312 @@
8918
+//! Definitions for l4re-uclibc on 64bit systems
8919
+
8920
+pub type blkcnt_t = i64;
8921
+pub type blksize_t = i64;
8922
+pub type c_char = u8;
8923
+pub type c_long = i64;
8924
+pub type c_ulong = u64;
8925
+pub type fsblkcnt_t = ::c_ulong;
8926
+pub type fsfilcnt_t = ::c_ulong;
8927
+pub type fsword_t = ::c_long;
8928
+pub type ino_t = ::c_ulong;
8929
+pub type nlink_t = ::c_uint;
8930
+pub type off_t = ::c_long;
8931
+pub type rlim_t = c_ulong;
8932
+pub type rlim64_t = u64;
8933
+pub type suseconds_t = ::c_long;
8934
+pub type time_t = ::c_int;
8935
+pub type wchar_t = ::c_int;
8936
+
8937
+// ToDo, used?
8938
+//pub type d_ino = ::c_ulong;
8939
+pub type nfds_t = ::c_ulong;
8940
+
8941
+s! {
8942
+    // ------------------------------------------------------------
8943
+    // networking
8944
+    pub struct in_addr {
8945
+        pub s_addr: in_addr_t,
8946
+    }
8947
+
8948
+    pub struct in6_addr {
8949
+        pub s6_addr: [u8; 16],
8950
+        __align: [u32; 0],
8951
+    }
8952
+
8953
+    pub struct sockaddr {
8954
+        pub sa_family: sa_family_t,
8955
+        pub sa_data: [::c_char; 14],
8956
+    }
8957
+
8958
+    pub struct sockaddr_in {
8959
+        pub sin_family: sa_family_t,
8960
+        pub sin_port: ::in_port_t,
8961
+        pub sin_addr: ::in_addr,
8962
+        pub sin_zero: [u8; 8],
8963
+    }
8964
+
8965
+    pub struct sockaddr_in6 {
8966
+        pub sin6_family: sa_family_t,
8967
+        pub sin6_port: in_port_t,
8968
+        pub sin6_flowinfo: u32,
8969
+        pub sin6_addr: ::in6_addr,
8970
+        pub sin6_scope_id: u32,
8971
+    }
8972
+
8973
+    // ------------------------------------------------------------
8974
+    // definitions below are *unverified* and might **break** the software
8975
+    pub struct stat { // ToDo
8976
+        pub st_dev: ::c_ulong,
8977
+        st_pad1: [::c_long; 2],
8978
+        pub st_ino: ::ino_t,
8979
+        pub st_mode: ::mode_t,
8980
+        pub st_nlink: ::nlink_t,
8981
+        pub st_uid: ::uid_t,
8982
+        pub st_gid: ::gid_t,
8983
+        pub st_rdev: u64,
8984
+        pub st_pad2: [u64; 1],
8985
+        pub st_size: off_t,
8986
+        st_pad3: ::c_long,
8987
+        pub st_atime: ::time_t,
8988
+        pub st_atime_nsec: ::c_long,
8989
+        pub st_mtime: ::time_t,
8990
+        pub st_mtime_nsec: ::c_long,
8991
+        pub st_ctime: ::time_t,
8992
+        pub st_ctime_nsec: ::c_long,
8993
+        pub st_blksize: ::blksize_t,
8994
+        st_pad4: ::c_long,
8995
+        pub st_blocks: ::blkcnt_t,
8996
+        st_pad5: [::c_long; 7],
8997
+    }
8998
+
8999
+    pub struct statvfs { // ToDo: broken
9000
+        pub f_bsize: ::c_ulong,
9001
+        pub f_frsize: ::c_ulong,
9002
+        pub f_blocks: ::fsblkcnt_t,
9003
+        pub f_bfree: ::fsblkcnt_t,
9004
+        pub f_bavail: ::fsblkcnt_t,
9005
+        pub f_files: ::fsfilcnt_t,
9006
+        pub f_ffree: ::fsfilcnt_t,
9007
+        pub f_favail: ::fsfilcnt_t,
9008
+        #[cfg(target_endian = "little")]
9009
+        pub f_fsid: ::c_ulong,
9010
+        #[cfg(target_pointer_width = "32")]
9011
+        __f_unused: ::c_int,
9012
+        #[cfg(target_endian = "big")]
9013
+        pub f_fsid: ::c_ulong,
9014
+        pub f_flag: ::c_ulong,
9015
+        pub f_namemax: ::c_ulong,
9016
+        __f_spare: [::c_int; 6],
9017
+    }
9018
+
9019
+    pub struct dirent { // Todo
9020
+        pub d_ino: ino_64_t,
9021
+        pub d_off: off64_t,
9022
+        d_reclen: u16,
9023
+        pub d_type: u8,
9024
+        pub d_name: [i8; 256],
9025
+    }
9026
+
9027
+    pub struct dirent64 { //
9028
+        pub d_ino: ino64_t,
9029
+        pub d_off: off64_t,
9030
+        pub d_reclen: u16,
9031
+        pub d_type: u8,
9032
+        pub d_name: [i8; 256],
9033
+    }
9034
+
9035
+    pub struct pthread_attr_t { // ToDo
9036
+        __size: [u64; 7]
9037
+    }
9038
+
9039
+    pub struct sigaction { // TODO!!
9040
+        pub sa_sigaction: ::sighandler_t,
9041
+        pub sa_mask: ::sigset_t,
9042
+        #[cfg(target_arch = "sparc64")]
9043
+        __reserved0: ::c_int,
9044
+        pub sa_flags: ::c_int,
9045
+        _restorer: *mut ::c_void,
9046
+    }
9047
+
9048
+    pub struct stack_t { // ToDo
9049
+        pub ss_sp: *mut ::c_void,
9050
+        pub ss_flags: ::c_int,
9051
+        pub ss_size: ::size_t
9052
+    }
9053
+
9054
+    pub struct statfs { // ToDo
9055
+        pub f_type: fsword_t,
9056
+        pub f_bsize: fsword_t,
9057
+        pub f_blocks: ::fsblkcnt_t,
9058
+        pub f_bfree: ::fsblkcnt_t,
9059
+        pub f_bavail: ::fsblkcnt_t,
9060
+        pub f_files: ::fsfilcnt_t,
9061
+        pub f_ffree: ::fsfilcnt_t,
9062
+        pub f_fsid: ::fsid_t,
9063
+        pub f_namelen: fsword_t,
9064
+        pub f_frsize: fsword_t,
9065
+        f_spare: [fsword_t; 5],
9066
+    }
9067
+
9068
+    pub struct msghdr { // ToDo
9069
+        pub msg_name: *mut ::c_void,
9070
+        pub msg_namelen: ::socklen_t,
9071
+        pub msg_iov: *mut ::iovec,
9072
+        pub msg_iovlen: ::size_t,
9073
+        pub msg_control: *mut ::c_void,
9074
+        pub msg_controllen: ::size_t,
9075
+        pub msg_flags: ::c_int,
9076
+    }
9077
+
9078
+    pub struct termios { // ToDo
9079
+        pub c_iflag: ::tcflag_t,
9080
+        pub c_oflag: ::tcflag_t,
9081
+        pub c_cflag: ::tcflag_t,
9082
+        pub c_lflag: ::tcflag_t,
9083
+        pub c_line: ::cc_t,
9084
+        pub c_cc: [::cc_t; ::NCCS],
9085
+    }
9086
+
9087
+    pub struct sem_t { // ToDo
9088
+        #[cfg(target_pointer_width = "32")]
9089
+        __size: [::c_char; 16],
9090
+        #[cfg(target_pointer_width = "64")]
9091
+        __size: [::c_char; 32],
9092
+        __align: [::c_long; 0],
9093
+    }
9094
+
9095
+    pub struct pthread_mutex_t { // ToDo
9096
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
9097
+                  target_arch = "powerpc"))]
9098
+        __align: [::c_long; 0],
9099
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
9100
+                      target_arch = "powerpc")))]
9101
+        __align: [::c_longlong; 0],
9102
+        size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
9103
+    }
9104
+
9105
+    pub struct pthread_mutexattr_t { // ToDo
9106
+        #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
9107
+                  target_arch = "mips64", target_arch = "s390x",
9108
+                  target_arch = "sparc64"))]
9109
+        __align: [::c_int; 0],
9110
+        #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
9111
+                      target_arch = "mips64", target_arch = "s390x",
9112
+                      target_arch = "sparc64")))]
9113
+        __align: [::c_long; 0],
9114
+        size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
9115
+    }
9116
+
9117
+    pub struct pthread_cond_t { // ToDo
9118
+        __align: [::c_longlong; 0],
9119
+        size: [u8; __SIZEOF_PTHREAD_COND_T],
9120
+    }
9121
+
9122
+    pub struct pthread_condattr_t { // ToDo
9123
+        __align: [::c_int; 0],
9124
+        size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
9125
+    }
9126
+
9127
+    pub struct pthread_rwlock_t { // ToDo
9128
+        #[cfg(any(target_arch = "mips", target_arch = "arm",
9129
+                  target_arch = "powerpc"))]
9130
+        __align: [::c_long; 0],
9131
+        #[cfg(not(any(target_arch = "mips", target_arch = "arm",
9132
+                      target_arch = "powerpc")))]
9133
+        __align: [::c_longlong; 0],
9134
+        size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
9135
+    }
9136
+
9137
+    pub struct sigset_t { // ToDo
9138
+        __val: [::c_ulong; 16],
9139
+    }
9140
+
9141
+    pub struct sysinfo { // ToDo
9142
+        pub uptime: ::c_long,
9143
+        pub loads: [::c_ulong; 3],
9144
+        pub totalram: ::c_ulong,
9145
+        pub freeram: ::c_ulong,
9146
+        pub sharedram: ::c_ulong,
9147
+        pub bufferram: ::c_ulong,
9148
+        pub totalswap: ::c_ulong,
9149
+        pub freeswap: ::c_ulong,
9150
+        pub procs: ::c_ushort,
9151
+        pub pad: ::c_ushort,
9152
+        pub totalhigh: ::c_ulong,
9153
+        pub freehigh: ::c_ulong,
9154
+        pub mem_unit: ::c_uint,
9155
+        pub _f: [::c_char; 0],
9156
+    }
9157
+
9158
+    pub struct glob_t { // ToDo
9159
+        pub gl_pathc: ::size_t,
9160
+        pub gl_pathv: *mut *mut c_char,
9161
+        pub gl_offs: ::size_t,
9162
+        pub gl_flags: ::c_int,
9163
+        __unused1: *mut ::c_void,
9164
+        __unused2: *mut ::c_void,
9165
+        __unused3: *mut ::c_void,
9166
+        __unused4: *mut ::c_void,
9167
+        __unused5: *mut ::c_void,
9168
+    }
9169
+
9170
+    pub struct stat64 { // ToDo
9171
+        pub st_dev: ::dev_t,
9172
+        pub st_ino: ::ino64_t,
9173
+        pub st_nlink: ::nlink_t,
9174
+        pub st_mode: ::mode_t,
9175
+        pub st_uid: ::uid_t,
9176
+        pub st_gid: ::gid_t,
9177
+        __pad0: ::c_int,
9178
+        pub st_rdev: ::dev_t,
9179
+        pub st_size: ::off_t,
9180
+        pub st_blksize: ::blksize_t,
9181
+        pub st_blocks: ::blkcnt64_t,
9182
+        pub st_atime: ::time_t,
9183
+        pub st_atime_nsec: ::c_long,
9184
+        pub st_mtime: ::time_t,
9185
+        pub st_mtime_nsec: ::c_long,
9186
+        pub st_ctime: ::time_t,
9187
+        pub st_ctime_nsec: ::c_long,
9188
+        __reserved: [::c_long; 3],
9189
+    }
9190
+
9191
+    pub struct rlimit64 { // ToDo
9192
+        pub rlim_cur: rlim64_t,
9193
+        pub rlim_max: rlim64_t,
9194
+    }
9195
+
9196
+    pub struct cpu_set_t { // ToDo
9197
+        #[cfg(target_pointer_width = "32")]
9198
+        bits: [u32; 32],
9199
+        #[cfg(target_pointer_width = "64")]
9200
+        bits: [u64; 16],
9201
+    }
9202
+
9203
+    pub struct timespec { // ToDo
9204
+        tv_sec: time_t, // seconds
9205
+        tv_nsec: ::c_ulong, // nanoseconds
9206
+    }
9207
+
9208
+    pub struct fsid_t { // ToDo
9209
+        __val: [::c_int; 2],
9210
+    }
9211
+}
9212
+
9213
+// constants
9214
+pub const O_CLOEXEC: ::c_int = 0x80000;
9215
+pub const O_DIRECTORY: ::c_int = 0200000;
9216
+pub const NCCS: usize = 32;
9217
+pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
9218
+pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
9219
+pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
9220
+pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
9221
+pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
9222
+pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
9223
+pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
9224
+pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
9225
+pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
9226
+
9227
+extern {
9228
+    pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
9229
+}
9230
diff --git toolkit/library/gtest/rust/Cargo.lock toolkit/library/gtest/rust/Cargo.lock
9231
index 2561f3856303..ab148dfb5e13 100644
9232
--- toolkit/library/gtest/rust/Cargo.lock
9233
+++ toolkit/library/gtest/rust/Cargo.lock
9234
@@ -121,7 +121,7 @@ version = "0.1.5"
9235
 source = "registry+https://github.com/rust-lang/crates.io-index"
9236
 dependencies = [
9237
  "gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
9238
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9239
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9240
 ]
9241
 
9242
 [[package]]
9243
@@ -132,7 +132,7 @@ dependencies = [
9244
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9245
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
9246
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9247
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9248
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9249
  "libloading 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
9250
 ]
9251
 
9252
@@ -143,7 +143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9253
 dependencies = [
9254
  "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
9255
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9256
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9257
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9258
  "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
9259
  "term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
9260
  "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
9261
@@ -157,7 +157,7 @@ version = "0.3.0"
9262
 source = "registry+https://github.com/rust-lang/crates.io-index"
9263
 dependencies = [
9264
  "core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
9265
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9266
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9267
 ]
9268
 
9269
 [[package]]
9270
@@ -165,7 +165,7 @@ name = "core-foundation-sys"
9271
 version = "0.3.1"
9272
 source = "registry+https://github.com/rust-lang/crates.io-index"
9273
 dependencies = [
9274
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9275
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9276
 ]
9277
 
9278
 [[package]]
9279
@@ -174,7 +174,7 @@ version = "0.7.0"
9280
 source = "registry+https://github.com/rust-lang/crates.io-index"
9281
 dependencies = [
9282
  "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
9283
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9284
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9285
  "serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
9286
 ]
9287
 
9288
@@ -185,7 +185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9289
 dependencies = [
9290
  "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
9291
  "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9292
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9293
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9294
 ]
9295
 
9296
 [[package]]
9297
@@ -318,7 +318,7 @@ name = "freetype"
9298
 version = "0.2.0"
9299
 source = "registry+https://github.com/rust-lang/crates.io-index"
9300
 dependencies = [
9301
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9302
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9303
 ]
9304
 
9305
 [[package]]
9306
@@ -348,7 +348,7 @@ dependencies = [
9307
  "env_logger 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
9308
  "euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
9309
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9310
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9311
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9312
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9313
  "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
9314
  "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
9315
@@ -443,7 +443,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9316
 
9317
 [[package]]
9318
 name = "libc"
9319
-version = "0.2.20"
9320
+version = "0.2.24"
9321
 source = "registry+https://github.com/rust-lang/crates.io-index"
9322
 
9323
 [[package]]
9324
@@ -472,7 +472,7 @@ name = "memchr"
9325
 version = "1.0.1"
9326
 source = "registry+https://github.com/rust-lang/crates.io-index"
9327
 dependencies = [
9328
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9329
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9330
 ]
9331
 
9332
 [[package]]
9333
@@ -543,7 +543,7 @@ name = "num_cpus"
9334
 version = "1.2.1"
9335
 source = "registry+https://github.com/rust-lang/crates.io-index"
9336
 dependencies = [
9337
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9338
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9339
 ]
9340
 
9341
 [[package]]
9342
@@ -605,7 +605,7 @@ version = "0.2.0"
9343
 source = "registry+https://github.com/rust-lang/crates.io-index"
9344
 dependencies = [
9345
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9346
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9347
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9348
  "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9349
  "smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
9350
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9351
@@ -690,7 +690,7 @@ name = "rand"
9352
 version = "0.3.15"
9353
 source = "registry+https://github.com/rust-lang/crates.io-index"
9354
 dependencies = [
9355
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9356
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9357
 ]
9358
 
9359
 [[package]]
9360
@@ -699,7 +699,7 @@ version = "0.6.0"
9361
 source = "registry+https://github.com/rust-lang/crates.io-index"
9362
 dependencies = [
9363
  "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
9364
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9365
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9366
  "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
9367
  "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9368
 ]
9369
@@ -730,7 +730,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9370
 name = "rust_url_capi"
9371
 version = "0.0.1"
9372
 dependencies = [
9373
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9374
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9375
  "nsstring 0.1.0",
9376
  "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
9377
 ]
9378
@@ -803,7 +803,7 @@ dependencies = [
9379
  "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
9380
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9381
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9382
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9383
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9384
  "serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
9385
  "serde_codegen 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
9386
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9387
@@ -858,7 +858,7 @@ version = "0.1.5"
9388
 source = "registry+https://github.com/rust-lang/crates.io-index"
9389
 dependencies = [
9390
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9391
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9392
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9393
 ]
9394
 
9395
 [[package]]
9396
@@ -963,7 +963,7 @@ name = "syntex_errors"
9397
 version = "0.54.0"
9398
 source = "registry+https://github.com/rust-lang/crates.io-index"
9399
 dependencies = [
9400
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9401
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9402
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9403
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
9404
  "syntex_pos 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)",
9405
@@ -985,7 +985,7 @@ version = "0.54.0"
9406
 source = "registry+https://github.com/rust-lang/crates.io-index"
9407
 dependencies = [
9408
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9409
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9410
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9411
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9412
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
9413
  "syntex_errors 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)",
9414
@@ -1019,7 +1019,7 @@ version = "0.2.3"
9415
 source = "registry+https://github.com/rust-lang/crates.io-index"
9416
 dependencies = [
9417
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9418
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9419
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9420
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9421
 ]
9422
 
9423
@@ -1029,7 +1029,7 @@ version = "3.0.0"
9424
 source = "registry+https://github.com/rust-lang/crates.io-index"
9425
 dependencies = [
9426
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9427
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9428
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9429
 ]
9430
 
9431
 [[package]]
9432
@@ -1057,7 +1057,7 @@ version = "0.1.36"
9433
 source = "registry+https://github.com/rust-lang/crates.io-index"
9434
 dependencies = [
9435
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9436
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9437
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9438
  "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
9439
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9440
 ]
9441
@@ -1223,7 +1223,7 @@ name = "x11"
9442
 version = "2.12.1"
9443
 source = "registry+https://github.com/rust-lang/crates.io-index"
9444
 dependencies = [
9445
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9446
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9447
  "metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
9448
 ]
9449
 
9450
@@ -1290,7 +1290,7 @@ dependencies = [
9451
 "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
9452
 "checksum khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "09c9d3760673c427d46f91a0350f0a84a52e6bc5a84adf26dc610b6c52436630"
9453
 "checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b"
9454
-"checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5"
9455
+"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc"
9456
 "checksum libloading 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fd1835a714c1f67ba073a493493c23686a480e2614e208c921834808b1f19d8f"
9457
 "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
9458
 "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
9459
diff --git toolkit/library/rust/Cargo.lock toolkit/library/rust/Cargo.lock
9460
index d69359a9a640..99443b59f1af 100644
9461
--- toolkit/library/rust/Cargo.lock
9462
+++ toolkit/library/rust/Cargo.lock
9463
@@ -119,7 +119,7 @@ version = "0.1.5"
9464
 source = "registry+https://github.com/rust-lang/crates.io-index"
9465
 dependencies = [
9466
  "gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
9467
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9468
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9469
 ]
9470
 
9471
 [[package]]
9472
@@ -130,7 +130,7 @@ dependencies = [
9473
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9474
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
9475
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9476
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9477
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9478
  "libloading 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
9479
 ]
9480
 
9481
@@ -141,7 +141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9482
 dependencies = [
9483
  "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
9484
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9485
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9486
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9487
  "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
9488
  "term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
9489
  "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
9490
@@ -155,7 +155,7 @@ version = "0.3.0"
9491
 source = "registry+https://github.com/rust-lang/crates.io-index"
9492
 dependencies = [
9493
  "core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
9494
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9495
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9496
 ]
9497
 
9498
 [[package]]
9499
@@ -163,7 +163,7 @@ name = "core-foundation-sys"
9500
 version = "0.3.1"
9501
 source = "registry+https://github.com/rust-lang/crates.io-index"
9502
 dependencies = [
9503
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9504
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9505
 ]
9506
 
9507
 [[package]]
9508
@@ -172,7 +172,7 @@ version = "0.7.0"
9509
 source = "registry+https://github.com/rust-lang/crates.io-index"
9510
 dependencies = [
9511
  "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
9512
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9513
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9514
  "serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
9515
 ]
9516
 
9517
@@ -183,7 +183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9518
 dependencies = [
9519
  "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
9520
  "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9521
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9522
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9523
 ]
9524
 
9525
 [[package]]
9526
@@ -316,7 +316,7 @@ name = "freetype"
9527
 version = "0.2.0"
9528
 source = "registry+https://github.com/rust-lang/crates.io-index"
9529
 dependencies = [
9530
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9531
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9532
 ]
9533
 
9534
 [[package]]
9535
@@ -346,7 +346,7 @@ dependencies = [
9536
  "env_logger 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
9537
  "euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
9538
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9539
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9540
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9541
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9542
  "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
9543
  "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
9544
@@ -441,7 +441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9545
 
9546
 [[package]]
9547
 name = "libc"
9548
-version = "0.2.20"
9549
+version = "0.2.24"
9550
 source = "registry+https://github.com/rust-lang/crates.io-index"
9551
 
9552
 [[package]]
9553
@@ -470,7 +470,7 @@ name = "memchr"
9554
 version = "1.0.1"
9555
 source = "registry+https://github.com/rust-lang/crates.io-index"
9556
 dependencies = [
9557
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9558
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9559
 ]
9560
 
9561
 [[package]]
9562
@@ -530,7 +530,7 @@ name = "num_cpus"
9563
 version = "1.2.1"
9564
 source = "registry+https://github.com/rust-lang/crates.io-index"
9565
 dependencies = [
9566
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9567
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9568
 ]
9569
 
9570
 [[package]]
9571
@@ -592,7 +592,7 @@ version = "0.2.0"
9572
 source = "registry+https://github.com/rust-lang/crates.io-index"
9573
 dependencies = [
9574
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9575
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9576
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9577
  "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9578
  "smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
9579
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9580
@@ -677,7 +677,7 @@ name = "rand"
9581
 version = "0.3.15"
9582
 source = "registry+https://github.com/rust-lang/crates.io-index"
9583
 dependencies = [
9584
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9585
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9586
 ]
9587
 
9588
 [[package]]
9589
@@ -686,7 +686,7 @@ version = "0.6.0"
9590
 source = "registry+https://github.com/rust-lang/crates.io-index"
9591
 dependencies = [
9592
  "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
9593
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9594
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9595
  "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
9596
  "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9597
 ]
9598
@@ -717,7 +717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
9599
 name = "rust_url_capi"
9600
 version = "0.0.1"
9601
 dependencies = [
9602
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9603
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9604
  "nsstring 0.1.0",
9605
  "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
9606
 ]
9607
@@ -790,7 +790,7 @@ dependencies = [
9608
  "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
9609
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9610
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9611
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9612
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9613
  "serde 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
9614
  "serde_codegen 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
9615
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9616
@@ -845,7 +845,7 @@ version = "0.1.5"
9617
 source = "registry+https://github.com/rust-lang/crates.io-index"
9618
 dependencies = [
9619
  "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9620
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9621
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9622
 ]
9623
 
9624
 [[package]]
9625
@@ -950,7 +950,7 @@ name = "syntex_errors"
9626
 version = "0.54.0"
9627
 source = "registry+https://github.com/rust-lang/crates.io-index"
9628
 dependencies = [
9629
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9630
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9631
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9632
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
9633
  "syntex_pos 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)",
9634
@@ -972,7 +972,7 @@ version = "0.54.0"
9635
 source = "registry+https://github.com/rust-lang/crates.io-index"
9636
 dependencies = [
9637
  "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
9638
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9639
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9640
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
9641
  "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
9642
  "syntex_errors 0.54.0 (registry+https://github.com/rust-lang/crates.io-index)",
9643
@@ -1006,7 +1006,7 @@ version = "0.2.3"
9644
 source = "registry+https://github.com/rust-lang/crates.io-index"
9645
 dependencies = [
9646
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9647
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9648
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9649
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9650
 ]
9651
 
9652
@@ -1016,7 +1016,7 @@ version = "3.0.0"
9653
 source = "registry+https://github.com/rust-lang/crates.io-index"
9654
 dependencies = [
9655
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9656
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9657
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9658
 ]
9659
 
9660
 [[package]]
9661
@@ -1044,7 +1044,7 @@ version = "0.1.36"
9662
 source = "registry+https://github.com/rust-lang/crates.io-index"
9663
 dependencies = [
9664
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
9665
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9666
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9667
  "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
9668
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
9669
 ]
9670
@@ -1210,7 +1210,7 @@ name = "x11"
9671
 version = "2.12.1"
9672
 source = "registry+https://github.com/rust-lang/crates.io-index"
9673
 dependencies = [
9674
- "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
9675
+ "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
9676
  "metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
9677
 ]
9678
 
9679
@@ -1277,7 +1277,7 @@ dependencies = [
9680
 "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
9681
 "checksum khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "09c9d3760673c427d46f91a0350f0a84a52e6bc5a84adf26dc610b6c52436630"
9682
 "checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b"
9683
-"checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5"
9684
+"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc"
9685
 "checksum libloading 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fd1835a714c1f67ba073a493493c23686a480e2614e208c921834808b1f19d8f"
9686
 "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
9687
 "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
(-)b/www/firefox/files/patch-bug702179 (-9 / +8 lines)
Lines 1-13 Link Here
1
--- js/src/moz.build.orig	2015-12-16 12:32:04.574425000 +0100
1
Don't build static JS lib to make sure DTrace probes are picked up.
2
+++ js/src/moz.build	2015-12-16 12:32:09.032032000 +0100
2
3
@@ -671,10 +671,6 @@ CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
3
--- js/src/build/moz.build.orig	2017-04-16 18:00:50 UTC
4
 CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
4
+++ js/src/build/moz.build
5
 LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
5
@@ -71,7 +71,3 @@ if CONFIG['OS_ARCH'] == 'SunOS':
6
     ]
6
 
7
 
8
 OS_LIBS += CONFIG['REALTIME_LIBS']
9
-
7
-NO_EXPAND_LIBS = True
10
-NO_EXPAND_LIBS = True
8
-
11
-
9
-DIST_INSTALL = True
12
-DIST_INSTALL = True
10
-
11
 # Prepare self-hosted JS code for embedding
12
 GENERATED_FILES += ['selfhosted.out.h']
13
 selfhosted = GENERATED_FILES['selfhosted.out.h']
(-)b/www/firefox/files/patch-bug826985 (-12 lines)
Lines 51-68 index b483cd1..f1dd1f0 100644 Link Here
51
     # basic stuff for everything
51
     # basic stuff for everything
52
     'include_internal_video_render': 0,
52
     'include_internal_video_render': 0,
53
     'clang_use_chrome_plugins': 0,
53
     'clang_use_chrome_plugins': 0,
54
diff --git media/webrtc/signaling/test/common.build media/webrtc/signaling/test/common.build
55
index b483cd1..f1dd1f0 100644
56
--- media/webrtc/signaling/test/common.build
57
+++ media/webrtc/signaling/test/common.build
58
@@ -99,6 +99,7 @@ if CONFIG['JS_SHARED_LIBRARY']:
59
 
60
 USE_LIBS += ['mozglue']
61
 
62
+OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
63
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
64
 OS_LIBS += CONFIG['REALTIME_LIBS']
65
 
66
diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
54
diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
67
index 239a292..bab496c 100644
55
index 239a292..bab496c 100644
68
--- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
56
--- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
(-)b/www/firefox/files/patch-bug847568 (-1 / +1 lines)
Lines 261-267 index 9297e4d6f501..d8e273887e4b 100644 Link Here
261
+option('--with-system-harfbuzz',
261
+option('--with-system-harfbuzz',
262
+       help="Use system harfbuzz (located with pkgconfig)")
262
+       help="Use system harfbuzz (located with pkgconfig)")
263
+
263
+
264
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.3',
264
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.6',
265
+                                    when='--with-system-harfbuzz')
265
+                                    when='--with-system-harfbuzz')
266
+
266
+
267
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
267
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
(-)a/www/firefox/files/patch-bug981348 (-61 lines)
Removed Link Here
1
diff --git dom/system/OSFileConstants.cpp dom/system/OSFileConstants.cpp
2
index 88bba9baa401..99f240952dfe 100644
3
--- dom/system/OSFileConstants.cpp
4
+++ dom/system/OSFileConstants.cpp
5
@@ -16,14 +16,17 @@
6
 #include "dirent.h"
7
 #include "poll.h"
8
 #include "sys/stat.h"
9
-#if defined(ANDROID)
10
+#if defined(XP_LINUX)
11
 #include <sys/vfs.h>
12
 #define statvfs statfs
13
+#define f_frsize f_bsize
14
 #else
15
 #include "sys/statvfs.h"
16
+#endif // defined(XP_LINUX)
17
+#if !defined(ANDROID)
18
 #include "sys/wait.h"
19
 #include <spawn.h>
20
-#endif // defined(ANDROID)
21
+#endif // !defined(ANDROID)
22
 #endif // defined(XP_UNIX)
23
 
24
 #if defined(XP_LINUX)
25
@@ -699,7 +702,7 @@ static const dom::ConstantSpec gLibcProperties[] =
26
 
27
   { "OSFILE_SIZEOF_STATVFS", JS::Int32Value(sizeof (struct statvfs)) },
28
 
29
-  { "OSFILE_OFFSETOF_STATVFS_F_BSIZE", JS::Int32Value(offsetof (struct statvfs, f_bsize)) },
30
+  { "OSFILE_OFFSETOF_STATVFS_F_FRSIZE", JS::Int32Value(offsetof (struct statvfs, f_frsize)) },
31
   { "OSFILE_OFFSETOF_STATVFS_F_BAVAIL", JS::Int32Value(offsetof (struct statvfs, f_bavail)) },
32
 
33
 #endif // defined(XP_UNIX)
34
diff --git toolkit/components/osfile/modules/osfile_unix_back.jsm toolkit/components/osfile/modules/osfile_unix_back.jsm
35
index a028dda7d5ec..f5c632e3d7e5 100644
36
--- toolkit/components/osfile/modules/osfile_unix_back.jsm
37
+++ toolkit/components/osfile/modules/osfile_unix_back.jsm
38
@@ -228,8 +228,8 @@
39
          let statvfs = new SharedAll.HollowStructure("statvfs",
40
            Const.OSFILE_SIZEOF_STATVFS);
41
 
42
-         statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BSIZE,
43
-                        "f_bsize", Type.unsigned_long.implementation);
44
+         statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_FRSIZE,
45
+                        "f_frsize", Type.unsigned_long.implementation);
46
          statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BAVAIL,
47
                         "f_bavail", Type.fsblkcnt_t.implementation);
48
 
49
diff --git toolkit/components/osfile/modules/osfile_unix_front.jsm toolkit/components/osfile/modules/osfile_unix_front.jsm
50
index bd60d4d8419c..a8cd6b546b0e 100644
51
--- toolkit/components/osfile/modules/osfile_unix_front.jsm
52
+++ toolkit/components/osfile/modules/osfile_unix_front.jsm
53
@@ -399,7 +399,7 @@
54
        throw_on_negative("statvfs",  (UnixFile.statvfs || UnixFile.statfs)(sourcePath, fileSystemInfoPtr));
55
 
56
        let bytes = new Type.uint64_t.implementation(
57
-                        fileSystemInfo.f_bsize * fileSystemInfo.f_bavail);
58
+                        fileSystemInfo.f_frsize * fileSystemInfo.f_bavail);
59
 
60
        return bytes.value;
61
      };
(-)a/www/firefox/files/patch-python_futures_concurrent_futures_process.py (-15 lines)
Removed Link Here
1
--- python/futures/concurrent/futures/process.py.orig	2017-04-11 04:15:19 UTC
2
+++ python/futures/concurrent/futures/process.py
3
@@ -247,7 +247,11 @@ def _check_system_limits():
4
     _system_limits_checked = True
5
     try:
6
         import os
7
-        nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
8
+        if sys.platform.startswith('freebsd'):
9
+            # sem(4) confuses sysconf(3) on FreeBSD < 11.1
10
+            nsems_max = -1
11
+        else:
12
+            nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
13
     except (AttributeError, ValueError):
14
         # sysconf not available or setting not available
15
         return
(-)b/www/firefox/files/patch-rust-option (-49 / +520 lines)
Lines 1-4 Link Here
1
Revert bug 1284816 and bug 1341967 to postpone bustage on non-x86 archs.
1
Revert bug 1284816, bug 1341967, bug 1336153 to postpone bustage on non-x86 archs.
2
2
3
diff --git browser/confvars.sh browser/confvars.sh
3
diff --git browser/confvars.sh browser/confvars.sh
4
index d8dcd99c2757..740d9d3e5fcf 100755
4
index d8dcd99c2757..740d9d3e5fcf 100755
Lines 56-66 index 267d989f1597..f709820e60ae 100644 Link Here
56
     if not rustc_info:
56
     if not rustc_info:
57
         die(dedent('''\
57
         die(dedent('''\
58
         Rust compiler not found.
58
         Rust compiler not found.
59
@@ -97,6 +110,9 @@ def rust_compiler(rustc_info, cargo_info):
60
 
61
     return True
62
 
63
+set_define('MOZ_RUST', rust_compiler)
64
+set_config('MOZ_RUST', rust_compiler)
65
+
66
 @template
67
 def rust_triple_alias(host_or_target):
68
     """Template defining the alias used for rustc's --target flag.
69
@@ -227,7 +243,8 @@ set_config('RUST_HOST_TARGET', rust_host_triple)
70
 
71
 @depends(rust_target_triple)
72
 def rust_target_env_name(triple):
73
-    return triple.upper().replace('-','_')
74
+    if triple:
75
+        return triple.upper().replace('-','_')
76
 
77
 # We need this to form various Cargo environment variables, as there is no
78
 # uppercase function in make, and we don't want to shell out just for
79
@@ -235,5 +252,6 @@ def rust_target_env_name(triple):
80
 set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
81
 
82
 # Until we remove all the other Rust checks in old-configure.
83
+add_old_configure_assignment('MOZ_RUST', rust_compiler)
84
 add_old_configure_assignment('RUSTC', rustc)
85
 add_old_configure_assignment('RUST_TARGET', rust_target_triple)
86
diff --git config/rules.mk config/rules.mk
87
index 94cc5556e3d0..7b143ebc5146 100644
88
--- config/rules.mk
89
+++ config/rules.mk
90
@@ -900,6 +900,7 @@ endif
91
 
92
 $(foreach file,$(DUMP_SYMS_TARGETS),$(eval $(call syms_template,$(file),$(file)_syms.track)))
93
 
94
+ifdef MOZ_RUST
95
 cargo_host_flag := --target=$(RUST_HOST_TARGET)
96
 cargo_target_flag := --target=$(RUST_TARGET)
97
 
98
@@ -1055,6 +1056,7 @@ force-cargo-host-program-build:
99
 
100
 $(HOST_RUST_PROGRAMS): force-cargo-host-program-build
101
 endif # HOST_RUST_PROGRAMS
102
+endif # MOZ_RUST
103
 
104
 $(SOBJS):
105
 	$(REPORT_BUILD)
59
diff --git dom/media/MediaPrefs.h dom/media/MediaPrefs.h
106
diff --git dom/media/MediaPrefs.h dom/media/MediaPrefs.h
60
index 4dcc659222a4..559334d89fd1 100644
107
index 4dcc659222a4..559334d89fd1 100644
61
--- dom/media/MediaPrefs.h
108
--- dom/media/MediaPrefs.h
62
+++ dom/media/MediaPrefs.h
109
+++ dom/media/MediaPrefs.h
63
@@ -165,7 +165,7 @@ private:
110
@@ -183,7 +183,7 @@ private:
64
   DECL_MEDIA_PREF("media.ogg.flac.enabled",                   FlacInOgg, bool, false);
111
   DECL_MEDIA_PREF("media.ogg.flac.enabled",                   FlacInOgg, bool, false);
65
   DECL_MEDIA_PREF("media.flac.enabled",                       FlacEnabled, bool, true);
112
   DECL_MEDIA_PREF("media.flac.enabled",                       FlacEnabled, bool, true);
66
 
113
 
Lines 69-74 index 4dcc659222a4..559334d89fd1 100644 Link Here
69
   DECL_MEDIA_PREF("media.rust.test_mode",                     RustTestMode, bool, false);
116
   DECL_MEDIA_PREF("media.rust.test_mode",                     RustTestMode, bool, false);
70
 #endif
117
 #endif
71
 
118
 
119
diff --git dom/media/gtest/moz.build dom/media/gtest/moz.build
120
index c66ac4a9437f..e2203c0a4321 100644
121
--- dom/media/gtest/moz.build
122
+++ dom/media/gtest/moz.build
123
@@ -22,7 +22,6 @@ UNIFIED_SOURCES += [
124
     'TestMozPromise.cpp',
125
     'TestMP3Demuxer.cpp',
126
     'TestMP4Demuxer.cpp',
127
-    'TestRust.cpp',
128
     'TestTrackEncoder.cpp',
129
     'TestVideoSegment.cpp',
130
     'TestVideoUtils.cpp',
131
@@ -36,6 +35,9 @@ if CONFIG['MOZ_WEBM_ENCODER']:
132
         'TestWebMWriter.cpp',
133
     ]
134
 
135
+if CONFIG['MOZ_RUST']:
136
+    UNIFIED_SOURCES += ['TestRust.cpp',]
137
+
138
 TEST_HARNESS_FILES.gtest += [
139
     '../test/gizmo-frag.mp4',
140
     '../test/gizmo.mp4',
141
diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build
142
index c65b53b80f63..8953f646e831 100644
143
--- media/libcubeb/src/moz.build
144
+++ media/libcubeb/src/moz.build
145
@@ -32,7 +32,8 @@ if CONFIG['MOZ_PULSEAUDIO']:
146
         'cubeb_pulse.c',
147
     ]
148
     DEFINES['USE_PULSE'] = True
149
-    DEFINES['USE_PULSE_RUST'] = True
150
+    if CONFIG['MOZ_RUST']:
151
+        DEFINES['USE_PULSE_RUST'] = True
152
 
153
 if CONFIG['MOZ_JACK']:
154
     SOURCES += [
72
diff --git media/libstagefright/binding/DecoderData.cpp media/libstagefright/binding/DecoderData.cpp
155
diff --git media/libstagefright/binding/DecoderData.cpp media/libstagefright/binding/DecoderData.cpp
73
index 109ea329d154..a06e533b1e62 100644
156
index 109ea329d154..a06e533b1e62 100644
74
--- media/libstagefright/binding/DecoderData.cpp
157
--- media/libstagefright/binding/DecoderData.cpp
Lines 84-99 index 109ea329d154..a06e533b1e62 100644 Link Here
84
+#endif // MOZ_RUST_MP4PARSE
167
+#endif // MOZ_RUST_MP4PARSE
85
 
168
 
86
 using namespace stagefright;
169
 using namespace stagefright;
87
 
170
 using mozilla::media::TimeUnit;
88
@@ -187,6 +189,7 @@ MP4VideoInfo::Update(const MetaData* aMetaData, const char* aMimeType)
171
@@ -177,6 +179,7 @@ MP4VideoInfo::Update(const MetaData* aMetaData, const char* aMimeType)
89
 
172
   FindData(aMetaData, kKeyAVCC, mExtraData);
90
 }
173
 }
91
 
174
 
92
+#ifdef MOZ_RUST_MP4PARSE
175
+#ifdef MOZ_RUST_MP4PARSE
93
 static void
176
 static void
94
 UpdateTrackProtectedInfo(mozilla::TrackInfo& aConfig,
177
 UpdateTrackProtectedInfo(mozilla::TrackInfo& aConfig,
95
                          const mp4parse_sinf_info& aSinf)
178
                          const mp4parse_sinf_info& aSinf)
96
@@ -266,6 +269,7 @@ MP4VideoInfo::Update(const mp4parse_track_info* track,
179
@@ -263,6 +266,7 @@ MP4VideoInfo::Update(const mp4parse_track_info* track,
97
     mExtraData->AppendElements(video->extra_data.data, video->extra_data.length);
180
     mExtraData->AppendElements(video->extra_data.data, video->extra_data.length);
98
   }
181
   }
99
 }
182
 }
Lines 105-111 diff --git media/libstagefright/binding/MP4Metadata.cpp media/libstagefright/bin Link Here
105
index 5c3810d99a38..5d14dfd8b8a9 100644
188
index 5c3810d99a38..5d14dfd8b8a9 100644
106
--- media/libstagefright/binding/MP4Metadata.cpp
189
--- media/libstagefright/binding/MP4Metadata.cpp
107
+++ media/libstagefright/binding/MP4Metadata.cpp
190
+++ media/libstagefright/binding/MP4Metadata.cpp
108
@@ -19,14 +19,18 @@
191
@@ -20,14 +20,18 @@
109
 #include "mp4_demuxer/MP4Metadata.h"
192
 #include "mp4_demuxer/MP4Metadata.h"
110
 #include "mp4_demuxer/Stream.h"
193
 #include "mp4_demuxer/Stream.h"
111
 #include "MediaPrefs.h"
194
 #include "MediaPrefs.h"
Lines 123-130 index 5c3810d99a38..5d14dfd8b8a9 100644 Link Here
123
+#endif // MOZ_RUST_MP4PARSE
206
+#endif // MOZ_RUST_MP4PARSE
124
 
207
 
125
 using namespace stagefright;
208
 using namespace stagefright;
126
 
209
 using mozilla::media::TimeUnit;
127
@@ -101,6 +103,7 @@ private:
210
@@ -105,6 +109,7 @@ private:
128
   bool mCanSeek;
211
   bool mCanSeek;
129
 };
212
 };
130
 
213
 
Lines 132-150 index 5c3810d99a38..5d14dfd8b8a9 100644 Link Here
132
 // Wrap an mp4_demuxer::Stream to remember the read offset.
215
 // Wrap an mp4_demuxer::Stream to remember the read offset.
133
 
216
 
134
 class RustStreamAdaptor {
217
 class RustStreamAdaptor {
135
@@ -145,9 +149,11 @@ private:
218
@@ -151,6 +156,7 @@ private:
136
   RustStreamAdaptor mRustSource;
219
   RustStreamAdaptor mRustSource;
137
   mozilla::UniquePtr<mp4parse_parser, FreeMP4Parser> mRustParser;
220
   mozilla::UniquePtr<mp4parse_parser, FreeMP4Parser> mRustParser;
138
 };
221
 };
139
+#endif // MOZ_RUST_MP4PARSE
222
+#endif // MOZ_RUST_MP4PARSE
140
 
223
 
224
 class IndiceWrapperStagefright : public IndiceWrapper {
225
 public:
226
@@ -187,6 +193,7 @@ IndiceWrapperStagefright::GetIndice(size_t aIndex, Index::Indice& aIndice) const
227
   return true;
228
 }
229
 
230
+#ifdef MOZ_RUST_MP4PARSE
231
 // the owner of mIndice is rust mp4 paser, so lifetime of this class
232
 // SHOULD NOT longer than rust parser.
233
 class IndiceWrapperRust : public IndiceWrapper
234
@@ -232,9 +239,11 @@ IndiceWrapperRust::GetIndice(size_t aIndex, Index::Indice& aIndice) const
235
   aIndice.sync = indice->sync;
236
   return true;
237
 }
238
+#endif // MOZ_RUST_MP4PARSE
239
 
141
 MP4Metadata::MP4Metadata(Stream* aSource)
240
 MP4Metadata::MP4Metadata(Stream* aSource)
142
  : mStagefright(MakeUnique<MP4MetadataStagefright>(aSource))
241
  : mStagefright(MakeUnique<MP4MetadataStagefright>(aSource))
143
+#ifdef MOZ_RUST_MP4PARSE
242
+#ifdef MOZ_RUST_MP4PARSE
144
  , mRust(MakeUnique<MP4MetadataRust>(aSource))
243
  , mRust(MakeUnique<MP4MetadataRust>(aSource))
145
  , mPreferRust(false)
244
  , mPreferRust(MediaPrefs::EnableRustMP4Parser())
146
  , mReportedAudioTrackTelemetry(false)
245
  , mReportedAudioTrackTelemetry(false)
147
@@ -155,6 +161,7 @@ MP4Metadata::MP4Metadata(Stream* aSource)
246
@@ -242,6 +251,7 @@ MP4Metadata::MP4Metadata(Stream* aSource)
148
 #ifndef RELEASE_OR_BETA
247
 #ifndef RELEASE_OR_BETA
149
  , mRustTestMode(MediaPrefs::RustTestMode())
248
  , mRustTestMode(MediaPrefs::RustTestMode())
150
 #endif
249
 #endif
Lines 152-195 index 5c3810d99a38..5d14dfd8b8a9 100644 Link Here
152
 {
251
 {
153
 }
252
 }
154
 
253
 
155
@@ -186,6 +193,7 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
254
@@ -274,8 +284,11 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
156
 {
255
   MP4Metadata::ResultAndTrackCount numTracks =
157
   uint32_t numTracks = mStagefright->GetNumberTracks(aType);
256
     mStagefright->GetNumberTracks(aType);
158
 
257
 
159
+#ifdef MOZ_RUST_MP4PARSE
258
+#ifdef MOZ_RUST_MP4PARSE
160
   if (!mRust) {
259
   if (!mRust) {
260
+#endif // MOZ_RUST_MP4PARSE
161
     return numTracks;
261
     return numTracks;
262
+#ifdef MOZ_RUST_MP4PARSE
162
   }
263
   }
163
@@ -211,10 +219,12 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
164
     mPreferRust = true;
165
     return numTracksRust;
166
   }
167
+#endif // MOZ_RUST_MP4PARSE
168
 
264
 
169
   return numTracks;
265
   MP4Metadata::ResultAndTrackCount numTracksRust =
266
@@ -350,8 +363,10 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
267
   // Same non-error numbers, just return any.
268
   // (Choosing Rust here, in case it carries a warning, we'd want to know that.)
269
   return numTracksRust;
270
+#endif // MOZ_RUST_MP4PARSE
170
 }
271
 }
171
 
272
 
172
+#ifdef MOZ_RUST_MP4PARSE
273
+#ifdef MOZ_RUST_MP4PARSE
173
 bool MP4Metadata::ShouldPreferRust() const {
274
 bool MP4Metadata::ShouldPreferRust() const {
174
   if (!mRust) {
275
   if (!mRust) {
175
     return false;
276
     return false;
176
@@ -245,6 +255,7 @@ bool MP4Metadata::ShouldPreferRust() const {
277
@@ -389,6 +404,7 @@ bool MP4Metadata::ShouldPreferRust() const {
177
   // Otherwise, fall back.
278
   // Otherwise, fall back.
178
   return false;
279
   return false;
179
 }
280
 }
180
+#endif // MOZ_RUST_MP4PARSE
281
+#endif // MOZ_RUST_MP4PARSE
181
 
282
 
182
 mozilla::UniquePtr<mozilla::TrackInfo>
283
 static const char*
183
 MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
284
 GetDifferentField(const mozilla::TrackInfo& info,
184
@@ -253,6 +264,7 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
285
@@ -443,6 +459,7 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
185
   mozilla::UniquePtr<mozilla::TrackInfo> info =
286
   MP4Metadata::ResultAndTrackInfo info =
186
       mStagefright->GetTrackInfo(aType, aTrackNumber);
287
     mStagefright->GetTrackInfo(aType, aTrackNumber);
187
 
288
 
188
+#ifdef MOZ_RUST_MP4PARSE
289
+#ifdef MOZ_RUST_MP4PARSE
189
   if (!mRust) {
290
   if (!mRust) {
190
     return info;
291
     return info;
191
   }
292
   }
192
@@ -305,6 +317,7 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackTyp
293
@@ -514,6 +531,7 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
193
   if (mPreferRust) {
294
   if (mPreferRust) {
194
     return infoRust;
295
     return infoRust;
195
   }
296
   }
Lines 197-211 index 5c3810d99a38..5d14dfd8b8a9 100644 Link Here
197
 
298
 
198
   return info;
299
   return info;
199
 }
300
 }
200
@@ -319,6 +334,7 @@ const CryptoFile&
301
@@ -528,6 +546,7 @@ MP4Metadata::ResultAndCryptoFile
201
 MP4Metadata::Crypto() const
302
 MP4Metadata::Crypto() const
202
 {
303
 {
203
   const CryptoFile& crypto = mStagefright->Crypto();
304
   MP4Metadata::ResultAndCryptoFile crypto = mStagefright->Crypto();
204
+#ifdef MOZ_RUST_MP4PARSE
305
+#ifdef MOZ_RUST_MP4PARSE
205
   const CryptoFile& rustCrypto = mRust->Crypto();
306
   MP4Metadata::ResultAndCryptoFile rustCrypto = mRust->Crypto();
206
 
307
 
207
 #ifndef RELEASE_OR_BETA
308
 #ifndef RELEASE_OR_BETA
208
@@ -330,6 +347,7 @@ MP4Metadata::Crypto() const
309
@@ -548,6 +567,7 @@ MP4Metadata::Crypto() const
209
   if (mPreferRust) {
310
   if (mPreferRust) {
210
     return rustCrypto;
311
     return rustCrypto;
211
   }
312
   }
Lines 213-229 index 5c3810d99a38..5d14dfd8b8a9 100644 Link Here
213
 
314
 
214
   return crypto;
315
   return crypto;
215
 }
316
 }
216
@@ -594,6 +612,7 @@ MP4MetadataStagefright::Metadata(Stream* aSource)
317
@@ -556,17 +576,22 @@ MP4Metadata::ResultAndIndice
217
   return parser->Metadata();
318
 MP4Metadata::GetTrackIndice(mozilla::TrackID aTrackID)
319
 {
320
   FallibleTArray<Index::Indice> indiceSF;
321
+#ifdef MOZ_RUST_MP4PARSE
322
   if (!mPreferRust
323
 #ifndef RELEASE_OR_BETA
324
       || mRustTestMode
325
 #endif
326
      ) {
327
+#endif // MOZ_RUST_MP4PARSE
328
     MediaResult rv = mStagefright->ReadTrackIndex(indiceSF, aTrackID);
329
     if (NS_FAILED(rv)) {
330
       return {Move(rv), nullptr};
331
     }
332
+#ifdef MOZ_RUST_MP4PARSE
333
   }
334
+#endif // MOZ_RUST_MP4PARSE
335
 
336
+#ifdef MOZ_RUST_MP4PARSE
337
   mp4parse_byte_data indiceRust = {};
338
   if (mPreferRust
339
 #ifndef RELEASE_OR_BETA
340
@@ -592,13 +617,18 @@ MP4Metadata::GetTrackIndice(mozilla::TrackID aTrackID)
341
     }
342
   }
343
 #endif
344
+#endif // MOZ_RUST_MP4PARSE
345
 
346
   UniquePtr<IndiceWrapper> indice;
347
+#ifdef MOZ_RUST_MP4PARSE
348
   if (mPreferRust) {
349
     indice = mozilla::MakeUnique<IndiceWrapperRust>(indiceRust);
350
   } else {
351
+#endif // MOZ_RUST_MP4PARSE
352
     indice = mozilla::MakeUnique<IndiceWrapperStagefright>(indiceSF);
353
+#ifdef MOZ_RUST_MP4PARSE
354
   }
355
+#endif // MOZ_RUST_MP4PARSE
356
 
357
   return {NS_OK, Move(indice)};
358
 }
359
@@ -856,6 +886,7 @@ MP4MetadataStagefright::Metadata(Stream* aSource)
360
   return {NS_OK, Move(buffer)};
218
 }
361
 }
219
 
362
 
220
+#ifdef MOZ_RUST_MP4PARSE
363
+#ifdef MOZ_RUST_MP4PARSE
221
 bool
364
 bool
222
 RustStreamAdaptor::Read(uint8_t* buffer, uintptr_t size, size_t* bytes_read)
365
 RustStreamAdaptor::Read(uint8_t* buffer, uintptr_t size, size_t* bytes_read)
223
 {
366
 {
224
@@ -859,5 +878,6 @@ MP4MetadataRust::Metadata(Stream* aSource)
367
@@ -1152,5 +1183,6 @@ MP4MetadataRust::Metadata(Stream* aSource)
225
   MOZ_ASSERT(false, "Not yet implemented");
368
   MOZ_ASSERT(false, "Not yet implemented");
226
   return nullptr;
369
   return {NS_ERROR_NOT_IMPLEMENTED, nullptr};
227
 }
370
 }
228
+#endif // MOZ_RUST_MP4PARSE
371
+#endif // MOZ_RUST_MP4PARSE
229
 
372
 
Lines 272-278 diff --git media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h media/ Link Here
272
index 492c9c1c1bc3..e16dbbd1155e 100644
415
index 492c9c1c1bc3..e16dbbd1155e 100644
273
--- media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
416
--- media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
274
+++ media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
417
+++ media/libstagefright/binding/include/mp4_demuxer/MP4Metadata.h
275
@@ -36,6 +36,7 @@ public:
418
@@ -13,7 +13,9 @@
419
 #include "MediaInfo.h"
420
 #include "MediaResult.h"
421
 #include "Stream.h"
422
+#ifdef MOZ_RUST_MP4PARSE
423
 #include "mp4parse.h"
424
+#endif // MOZ_RUST_MP4PARSE
425
 
426
 namespace mp4_demuxer {
427
 
428
@@ -82,6 +84,7 @@ public:
276
 
429
 
277
 private:
430
 private:
278
   UniquePtr<MP4MetadataStagefright> mStagefright;
431
   UniquePtr<MP4MetadataStagefright> mStagefright;
Lines 280-286 index 492c9c1c1bc3..e16dbbd1155e 100644 Link Here
280
   UniquePtr<MP4MetadataRust> mRust;
433
   UniquePtr<MP4MetadataRust> mRust;
281
   mutable bool mPreferRust;
434
   mutable bool mPreferRust;
282
   mutable bool mReportedAudioTrackTelemetry;
435
   mutable bool mReportedAudioTrackTelemetry;
283
@@ -44,6 +45,7 @@ private:
436
@@ -90,6 +93,7 @@ private:
284
   mutable bool mRustTestMode;
437
   mutable bool mRustTestMode;
285
 #endif
438
 #endif
286
   bool ShouldPreferRust() const;
439
   bool ShouldPreferRust() const;
Lines 288-293 index 492c9c1c1bc3..e16dbbd1155e 100644 Link Here
288
 };
441
 };
289
 
442
 
290
 } // namespace mp4_demuxer
443
 } // namespace mp4_demuxer
444
diff --git media/libstagefright/gtest/moz.build media/libstagefright/gtest/moz.build
445
index be4d56fc93f7..66fdd365f8f3 100644
446
--- media/libstagefright/gtest/moz.build
447
+++ media/libstagefright/gtest/moz.build
448
@@ -38,12 +38,13 @@ TEST_HARNESS_FILES.gtest += [
449
     'test_case_1351094.mp4',
450
 ]
451
 
452
-UNIFIED_SOURCES += ['TestMP4Rust.cpp',]
453
-TEST_HARNESS_FILES.gtest += [
454
-    '../../../dom/media/test/street.mp4',
455
-]
456
-LOCAL_INCLUDES += [
457
-    '../binding/include',
458
-]
459
+if CONFIG['MOZ_RUST']:
460
+    UNIFIED_SOURCES += ['TestMP4Rust.cpp',]
461
+    TEST_HARNESS_FILES.gtest += [
462
+        '../../../dom/media/test/street.mp4',
463
+    ]
464
+    LOCAL_INCLUDES += [
465
+        '../binding/include',
466
+    ]
467
 
468
 FINAL_LIBRARY = 'xul-gtest'
469
diff --git media/libstagefright/moz.build media/libstagefright/moz.build
470
index af5d1194d621..6725a0179989 100644
471
--- media/libstagefright/moz.build
472
+++ media/libstagefright/moz.build
473
@@ -83,9 +83,10 @@ SOURCES += [
474
     'system/core/libutils/VectorImpl.cpp',
475
 ]
476
 
477
-EXPORTS += [
478
-    'binding/include/mp4parse.h',
479
-]
480
+if CONFIG['MOZ_RUST']:
481
+    EXPORTS += [
482
+        'binding/include/mp4parse.h',
483
+    ]
484
 
485
 UNIFIED_SOURCES += [
486
     'binding/Adts.cpp',
291
diff --git mobile/android/confvars.sh mobile/android/confvars.sh
487
diff --git mobile/android/confvars.sh mobile/android/confvars.sh
292
index e79b6f5c0707..eb62763acaf7 100644
488
index e79b6f5c0707..eb62763acaf7 100644
293
--- mobile/android/confvars.sh
489
--- mobile/android/confvars.sh
Lines 301-321 index e79b6f5c0707..eb62763acaf7 100644 Link Here
301
 # use custom widget for html:select
497
 # use custom widget for html:select
302
 MOZ_USE_NATIVE_POPUP_WINDOWS=1
498
 MOZ_USE_NATIVE_POPUP_WINDOWS=1
303
 
499
 
500
diff --git netwerk/base/moz.build netwerk/base/moz.build
501
index 61d022a9660e..e5ca1d77d859 100644
502
--- netwerk/base/moz.build
503
+++ netwerk/base/moz.build
504
@@ -256,7 +256,7 @@ UNIFIED_SOURCES += [
505
     'TLSServerSocket.cpp',
506
 ]
507
 
508
-if CONFIG['MOZ_RUST_URLPARSE']:
509
+if CONFIG['MOZ_RUST'] and CONFIG['MOZ_RUST_URLPARSE']:
510
     EXPORTS.mozilla.net += [ 'RustURL.h' ]
511
     UNIFIED_SOURCES += [ 'RustURL.cpp' ]
512
 
513
diff --git netwerk/base/nsStandardURL.cpp netwerk/base/nsStandardURL.cpp
514
index 608b918a4ecf..20bcdeb34ab8 100644
515
--- netwerk/base/nsStandardURL.cpp
516
+++ netwerk/base/nsStandardURL.cpp
517
@@ -858,6 +858,7 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
518
         if (!SegmentIs(spec, mScheme, "resource") &&
519
             !SegmentIs(spec, mScheme, "chrome")) {
520
             nsAutoCString ipString;
521
+#ifdef MOZ_RUST
522
             if (encHost.Length() > 0 &&
523
                 encHost.First() == '[' && encHost.Last() == ']' &&
524
                 ValidIPv6orHostname(encHost.get(), encHost.Length())) {
525
@@ -866,7 +867,9 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
526
                     return rv;
527
                 }
528
                 encHost = ipString;
529
-            } else if (NS_SUCCEEDED(NormalizeIPv4(encHost, ipString))) {
530
+            } else
531
+#endif
532
+            if (NS_SUCCEEDED(NormalizeIPv4(encHost, ipString))) {
533
                 encHost = ipString;
534
             }
535
         }
536
@@ -2112,6 +2115,7 @@ nsStandardURL::SetHost(const nsACString &input)
537
 
538
     if (!SegmentIs(mScheme, "resource") && !SegmentIs(mScheme, "chrome")) {
539
         nsAutoCString ipString;
540
+#ifdef MOZ_RUST
541
         if (hostBuf.Length() > 0 &&
542
             hostBuf.First() == '[' && hostBuf.Last() == ']' &&
543
             ValidIPv6orHostname(hostBuf.get(), hostBuf.Length())) {
544
@@ -2120,7 +2124,9 @@ nsStandardURL::SetHost(const nsACString &input)
545
                 return rv;
546
             }
547
             hostBuf = ipString;
548
-        } else if (NS_SUCCEEDED(NormalizeIPv4(hostBuf, ipString))) {
549
+        } else
550
+#endif
551
+        if (NS_SUCCEEDED(NormalizeIPv4(hostBuf, ipString))) {
552
           hostBuf = ipString;
553
         }
554
     }
555
diff --git old-configure.in old-configure.in
556
index 717a94fcc692..54b29d737cc1 100644
557
--- old-configure.in
558
+++ old-configure.in
559
@@ -2330,9 +2330,14 @@ if test -n "$MOZ_MULET"; then
560
 fi
561
 
562
 # Propagate feature switches for code written in rust from confvars.sh
563
-if test -n "$MOZ_RUST_URLPARSE"; then
564
-    AC_DEFINE(MOZ_RUST_URLPARSE)
565
-    AC_SUBST(MOZ_RUST_URLPARSE)
566
+if test -n "$MOZ_RUST"; then
567
+    if test -n "$MOZ_RUST_MP4PARSE"; then
568
+        AC_DEFINE(MOZ_RUST_MP4PARSE)
569
+    fi
570
+    if test -n "$MOZ_RUST_URLPARSE"; then
571
+        AC_DEFINE(MOZ_RUST_URLPARSE)
572
+        AC_SUBST(MOZ_RUST_URLPARSE)
573
+    fi
574
 fi
575
 
576
 AC_SUBST(MOZ_PHOENIX)
304
diff --git toolkit/components/telemetry/Histograms.json toolkit/components/telemetry/Histograms.json
577
diff --git toolkit/components/telemetry/Histograms.json toolkit/components/telemetry/Histograms.json
305
index 061c55f6a5b6..e49dfd176952 100644
578
index 061c55f6a5b6..e49dfd176952 100644
306
--- toolkit/components/telemetry/Histograms.json
579
--- toolkit/components/telemetry/Histograms.json
307
+++ toolkit/components/telemetry/Histograms.json
580
+++ toolkit/components/telemetry/Histograms.json
308
@@ -6996,7 +6996,8 @@
581
@@ -8320,7 +8320,8 @@
309
     "expires_in_version": "55",
582
     "expires_in_version": "60",
310
     "kind": "boolean",
583
     "kind": "boolean",
311
     "bug_numbers": [1220885],
584
     "bug_numbers": [1220885],
312
-    "description": "(Bug 1220885) Whether the rust mp4 demuxer successfully parsed a stream segment."
585
-    "description": "Whether the rust mp4 demuxer successfully parsed a stream segment."
313
+    "description": "(Bug 1220885) Whether the rust mp4 demuxer successfully parsed a stream segment.",
586
+    "description": "Whether the rust mp4 demuxer successfully parsed a stream segment.",
314
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
587
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
315
   },
588
   },
316
   "MEDIA_RUST_MP4PARSE_ERROR_CODE": {
589
   "MEDIA_RUST_MP4PARSE_ERROR_CODE": {
317
     "alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
590
     "record_in_processes": ["main", "content"],
318
@@ -7004,21 +7005,24 @@
591
@@ -8329,7 +8330,8 @@
319
     "kind": "enumerated",
592
     "kind": "enumerated",
320
     "n_values": 32,
593
     "n_values": 32,
321
     "bug_numbers": [1238420],
594
     "bug_numbers": [1238420],
Lines 324-331 index 061c55f6a5b6..e49dfd176952 100644 Link Here
324
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
597
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
325
   },
598
   },
326
   "MEDIA_RUST_MP4PARSE_TRACK_MATCH_AUDIO": {
599
   "MEDIA_RUST_MP4PARSE_TRACK_MATCH_AUDIO": {
327
     "alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
600
     "record_in_processes": ["main", "content"],
328
     "expires_in_version": "55",
601
@@ -8337,7 +8339,8 @@
602
     "expires_in_version": "60",
329
     "kind": "boolean",
603
     "kind": "boolean",
330
     "bug_numbers": [1231169],
604
     "bug_numbers": [1231169],
331
-    "description": "Whether rust and stagefight mp4 parser audio track results match."
605
-    "description": "Whether rust and stagefight mp4 parser audio track results match."
Lines 333-340 index 061c55f6a5b6..e49dfd176952 100644 Link Here
333
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
607
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
334
   },
608
   },
335
   "MEDIA_RUST_MP4PARSE_TRACK_MATCH_VIDEO": {
609
   "MEDIA_RUST_MP4PARSE_TRACK_MATCH_VIDEO": {
336
     "alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
610
     "record_in_processes": ["main", "content"],
337
     "expires_in_version": "55",
611
@@ -8345,7 +8348,8 @@
612
     "expires_in_version": "60",
338
     "kind": "boolean",
613
     "kind": "boolean",
339
     "bug_numbers": [1231169],
614
     "bug_numbers": [1231169],
340
-    "description": "Whether rust and stagefight mp4 parser video track results match."
615
-    "description": "Whether rust and stagefight mp4 parser video track results match."
Lines 342-345 index 061c55f6a5b6..e49dfd176952 100644 Link Here
342
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
617
+    "cpp_guard": "MOZ_RUST_MP4PARSE"
343
   },
618
   },
344
   "MEDIA_WMF_DECODE_ERROR": {
619
   "MEDIA_WMF_DECODE_ERROR": {
345
     "expires_in_version": "55",
620
     "record_in_processes": ["main", "content", "gpu"],
621
diff --git toolkit/library/gtest/moz.build toolkit/library/gtest/moz.build
622
index 69a8fb1f4893..c684f48e456e 100644
623
--- toolkit/library/gtest/moz.build
624
+++ toolkit/library/gtest/moz.build
625
@@ -7,7 +7,6 @@
626
 FINAL_TARGET = 'dist/bin/gtest'
627
 
628
 USE_LIBS += [
629
-    'gkrust-gtest',
630
     'static:xul',
631
     # xul-gtest is an intermediate static library. It is used as FINAL_TARGET
632
     # for gtest code.
633
@@ -21,6 +20,11 @@ USE_LIBS += [
634
 # before StaticXULComponentStart.
635
 Libxul('xul-gtest-real')
636
 
637
+if CONFIG['MOZ_RUST']:
638
+    USE_LIBS += [
639
+        'gkrust-gtest',
640
+    ]
641
+
642
 DIRS += [
643
     'static',
644
 ]
645
diff --git toolkit/library/moz.build toolkit/library/moz.build
646
index 650f6eaba980..191e90ceb09a 100644
647
--- toolkit/library/moz.build
648
+++ toolkit/library/moz.build
649
@@ -63,7 +63,7 @@ def Libxul(name):
650
 
651
     # This option should go away in bug 1290972, but we need to wait until
652
     # Rust 1.12 has been released.
653
-    if CONFIG['OS_ARCH'] == 'Darwin':
654
+    if CONFIG['MOZ_RUST'] and CONFIG['OS_ARCH'] == 'Darwin':
655
         LDFLAGS += ['-Wl,-no_compact_unwind']
656
 
657
 Libxul('xul')
658
@@ -343,4 +343,5 @@ USE_LIBS += ['StaticXULComponentsEnd']
659
 # The above library needs to be last for C++ purposes.  This library,
660
 # however, is entirely composed of Rust code, and needs to come after
661
 # all the C++ code so any possible C++ -> Rust calls can be resolved.
662
-USE_LIBS += ['gkrust']
663
+if CONFIG['MOZ_RUST']:
664
+    USE_LIBS += ['gkrust']
665
diff --git toolkit/moz.configure toolkit/moz.configure
666
index ac9d123224ce..e90da70f0fa5 100644
667
--- toolkit/moz.configure
668
+++ toolkit/moz.configure
669
@@ -88,8 +88,7 @@ include('../js/moz.configure')
670
 
671
 # Rust
672
 # ==============================================================
673
-include('../build/moz.configure/rust.configure',
674
-        when='--enable-compile-environment')
675
+include('../build/moz.configure/rust.configure')
676
 
677
 
678
 # L10N
679
@@ -623,13 +622,13 @@ id_and_secret_keyfile('Leanplum SDK')
680
 option('--enable-stylo', nargs='?', choices=('build',),
681
        help='Include Stylo in the build and/or enable it at runtime')
682
 
683
-@depends('--enable-stylo')
684
-def stylo_config(value):
685
+@depends('--enable-stylo', '--enable-rust')
686
+def stylo_config(value, rust_enabled):
687
     build_stylo = None
688
     enable_stylo = None
689
 
690
     # The default is to not build Stylo at all.
691
-    if value.origin == 'default':
692
+    if not rust_enabled or value.origin == 'default':
693
         pass
694
     elif value == 'build':
695
         build_stylo = True
696
@@ -769,12 +768,14 @@ set_config('SERVO_TARGET_DIR', servo_target_dir)
697
 option('--enable-webrender', nargs='?', choices=('build',),
698
        help='Include WebRender in the build and/or enable it at runtime')
699
 
700
-@depends('--enable-webrender', milestone)
701
-def webrender(value, milestone):
702
+@depends('--enable-webrender', '--enable-rust', milestone)
703
+def webrender(value, rust_enabled, milestone):
704
     build_webrender = None
705
     enable_webrender = None
706
 
707
-    if value.origin == 'default':
708
+    if not rust_enabled:
709
+        pass
710
+    elif value.origin == 'default':
711
         # if nothing is specified, default to just building on Nightly
712
         build_webrender = milestone.is_nightly
713
     elif value == 'build':
714
diff --git toolkit/toolkit.mozbuild toolkit/toolkit.mozbuild
715
index b845aab48023..9215afc6dd2d 100644
716
--- toolkit/toolkit.mozbuild
717
+++ toolkit/toolkit.mozbuild
718
@@ -133,16 +133,23 @@ if CONFIG['MOZ_PREF_EXTENSIONS']:
719
 
720
 DIRS += [
721
     '/devtools',
722
-    '/toolkit/library',
723
-    '/toolkit/library/gtest/rust',
724
-    '/toolkit/library/rust',
725
-    '/toolkit/library/StaticXULComponentsEnd',
726
     '/services',
727
     '/startupcache',
728
     '/js/ductwork/debugger',
729
     '/other-licenses/snappy',
730
 ]
731
 
732
+if CONFIG['MOZ_RUST']:
733
+    DIRS += [
734
+        '/toolkit/library/gtest/rust',
735
+        '/toolkit/library/rust',
736
+    ]
737
+
738
+DIRS += [
739
+    '/toolkit/library/StaticXULComponentsEnd',
740
+    '/toolkit/library',
741
+]
742
+
743
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
744
     DIRS += ['/toolkit/system/gnome']
745
 
746
diff --git toolkit/xre/nsAppRunner.cpp toolkit/xre/nsAppRunner.cpp
747
index 667c2eb1b365..6fb6cf102baa 100644
748
--- toolkit/xre/nsAppRunner.cpp
749
+++ toolkit/xre/nsAppRunner.cpp
750
@@ -227,11 +227,13 @@
751
 extern uint32_t gRestartMode;
752
 extern void InstallSignalHandlers(const char *ProgramName);
753
 
754
+#ifdef MOZ_RUST
755
 // This workaround is fixed in Rust 1.19. For details, see bug 1358151.
756
 // Implementation in toolkit/library/rust/shared/lib.rs
757
 extern "C" {
758
   void rust_init_please_remove_this_after_updating_rust_1_19();
759
 }
760
+#endif
761
 
762
 #define FILE_COMPATIBILITY_INFO NS_LITERAL_CSTRING("compatibility.ini")
763
 #define FILE_INVALIDATE_CACHES NS_LITERAL_CSTRING(".purgecaches")
764
@@ -3122,8 +3124,10 @@ XREMain::XRE_mainInit(bool* aExitFlag)
765
     return 1;
766
   *aExitFlag = false;
767
 
768
+#ifdef MOZ_RUST
769
   // This workaround is fixed in Rust 1.19. For details, see bug 1358151.
770
   rust_init_please_remove_this_after_updating_rust_1_19();
771
+#endif
772
 
773
   atexit(UnexpectedExit);
774
   auto expectedShutdown = mozilla::MakeScopeExit([&] {
775
diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
776
index e6bb623c258b..c49d61dce605 100644
777
--- xpcom/base/nsDebugImpl.cpp
778
+++ xpcom/base/nsDebugImpl.cpp
779
@@ -148,14 +148,20 @@ nsDebugImpl::Abort(const char* aFile, int32_t aLine)
780
   return NS_OK;
781
 }
782
 
783
+#ifdef MOZ_RUST
784
 // From toolkit/library/rust/lib.rs
785
 extern "C" void intentional_panic(const char* message);
786
+#endif
787
 
788
 NS_IMETHODIMP
789
 nsDebugImpl::RustPanic(const char* aMessage)
790
 {
791
+#ifdef MOZ_RUST
792
   intentional_panic(aMessage);
793
   return NS_OK;
794
+#else
795
+  return NS_ERROR_NOT_IMPLEMENTED;
796
+#endif
797
 }
798
 
799
 NS_IMETHODIMP
800
diff --git xpcom/rust/nsstring/gtest/moz.build xpcom/rust/nsstring/gtest/moz.build
801
index 197411678815..5bed9e57e57d 100644
802
--- xpcom/rust/nsstring/gtest/moz.build
803
+++ xpcom/rust/nsstring/gtest/moz.build
804
@@ -4,8 +4,9 @@
805
 # License, v. 2.0. If a copy of the MPL was not distributed with this
806
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
807
 
808
-UNIFIED_SOURCES += [
809
-    'Test.cpp'
810
-]
811
+if CONFIG['MOZ_RUST']:
812
+    UNIFIED_SOURCES += [
813
+        'Test.cpp'
814
+    ]
815
 
816
 FINAL_LIBRARY = 'xul-gtest'
(-)b/www/firefox/files/patch-third__party_python_futures_concurrent_futures_process.py (+15 lines)
Added Link Here
1
--- third_party/python/futures/concurrent/futures/process.py.orig	2017-04-11 04:15:19 UTC
2
+++ third_party/python/futures/concurrent/futures/process.py
3
@@ -247,7 +247,11 @@ def _check_system_limits():
4
     _system_limits_checked = True
5
     try:
6
         import os
7
-        nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
8
+        if sys.platform.startswith('freebsd'):
9
+            # sem(4) confuses sysconf(3) on FreeBSD < 11.1
10
+            nsems_max = -1
11
+        else:
12
+            nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
13
     except (AttributeError, ValueError):
14
         # sysconf not available or setting not available
15
         return

Return to bug 219963