New upstream version 2018.7

This commit is contained in:
Simon McVittie 2018-07-25 11:00:57 +01:00
commit 97a0aa1a42
199 changed files with 1261 additions and 49717 deletions

View File

@ -238,6 +238,13 @@ if USE_LIBSOUP
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-soup.c
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
else
if USE_AVAHI
libostree_1_la_SOURCES += src/libostree/ostree-soup-uri.h \
src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
endif
endif
endif

View File

@ -45,7 +45,7 @@ if BUILDOPT_USE_STATIC_COMPILER
ostree_boot_SCRIPTS = ostree-prepare-root
ostree-prepare-root : $(ostree_prepare_root_SOURCES)
$(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(AM_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES)
$(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(ostree_prepare_root_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES)
else
ostree_boot_PROGRAMS += ostree-prepare-root
ostree_prepare_root_CFLAGS = $(AM_CFLAGS) -Isrc/switchroot

View File

@ -466,20 +466,25 @@ check_PROGRAMS = $(am__EXEEXT_11) $(am__EXEEXT_12) $(am__EXEEXT_13)
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_35 = src/libostree/ostree-fetcher-soup.c
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_36 = $(OT_INTERNAL_SOUP_CFLAGS)
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_37 = $(OT_INTERNAL_SOUP_LIBS)
@USE_LIBMOUNT_TRUE@am__append_38 = $(OT_DEP_LIBMOUNT_CFLAGS)
@USE_LIBMOUNT_TRUE@am__append_39 = $(OT_DEP_LIBMOUNT_LIBS)
@USE_SELINUX_TRUE@am__append_40 = $(OT_DEP_SELINUX_CFLAGS)
@USE_SELINUX_TRUE@am__append_41 = $(OT_DEP_SELINUX_LIBS)
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@am__append_38 = src/libostree/ostree-soup-uri.h \
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@ src/libostree/ostree-soup-uri.c \
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@ src/libostree/ostree-soup-form.c \
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@ $(NULL)
@USE_LIBMOUNT_TRUE@am__append_39 = $(OT_DEP_LIBMOUNT_CFLAGS)
@USE_LIBMOUNT_TRUE@am__append_40 = $(OT_DEP_LIBMOUNT_LIBS)
@USE_SELINUX_TRUE@am__append_41 = $(OT_DEP_SELINUX_CFLAGS)
@USE_SELINUX_TRUE@am__append_42 = $(OT_DEP_SELINUX_LIBS)
# When compiling this is set via config.h, but g-ir-scanner can't use that
@BUILDOPT_INTROSPECTION_TRUE@@ENABLE_EXPERIMENTAL_API_TRUE@am__append_42 = -DOSTREE_ENABLE_EXPERIMENTAL_API=1
@BUILDOPT_INTROSPECTION_TRUE@am__append_43 = OSTree-1.0.gir
@BUILDOPT_INTROSPECTION_TRUE@@ENABLE_EXPERIMENTAL_API_TRUE@am__append_43 = -DOSTREE_ENABLE_EXPERIMENTAL_API=1
@BUILDOPT_INTROSPECTION_TRUE@am__append_44 = OSTree-1.0.gir
@BUILDOPT_INTROSPECTION_TRUE@am__append_45 = OSTree-1.0.typelib
@BUILDOPT_INTROSPECTION_TRUE@am__append_46 = $(gir_DATA) $(typelib_DATA)
@ENABLE_EXPERIMENTAL_API_TRUE@am__append_47 = \
@BUILDOPT_INTROSPECTION_TRUE@am__append_45 = OSTree-1.0.gir
@BUILDOPT_INTROSPECTION_TRUE@am__append_46 = OSTree-1.0.typelib
@BUILDOPT_INTROSPECTION_TRUE@am__append_47 = $(gir_DATA) $(typelib_DATA)
@ENABLE_EXPERIMENTAL_API_TRUE@am__append_48 = \
@ENABLE_EXPERIMENTAL_API_TRUE@ $(NULL)
@USE_CURL_OR_SOUP_TRUE@am__append_48 = src/ostree/ot-remote-builtin-add-cookie.c \
@USE_CURL_OR_SOUP_TRUE@am__append_49 = src/ostree/ot-remote-builtin-add-cookie.c \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ot-remote-builtin-delete-cookie.c \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ot-remote-builtin-list-cookies.c \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ot-remote-cookie-util.h \
@ -487,59 +492,59 @@ check_PROGRAMS = $(am__EXEEXT_11) $(am__EXEEXT_12) $(am__EXEEXT_13)
@USE_CURL_OR_SOUP_TRUE@ $(NULL) src/ostree/ot-builtin-pull.c
# Eventually once we stop things from using this, we should support disabling this
@USE_LIBSOUP_TRUE@am__append_49 = src/ostree/ot-builtin-trivial-httpd.c
@USE_LIBSOUP_TRUE@am__append_50 = ostree-trivial-httpd
@USE_LIBSOUP_TRUE@am__append_50 = src/ostree/ot-builtin-trivial-httpd.c
@USE_LIBSOUP_TRUE@am__append_51 = ostree-trivial-httpd
# This is necessary for the cookie jar bits
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_51 = $(OT_INTERNAL_SOUP_CFLAGS)
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_52 = $(OT_INTERNAL_SOUP_LIBS)
@USE_LIBARCHIVE_TRUE@am__append_53 = $(OT_DEP_LIBARCHIVE_CFLAGS)
@USE_LIBARCHIVE_TRUE@am__append_54 = $(OT_DEP_LIBARCHIVE_LIBS)
@BUILDOPT_SYSTEMD_TRUE@am__append_55 = ostree-remount
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_52 = $(OT_INTERNAL_SOUP_CFLAGS)
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__append_53 = $(OT_INTERNAL_SOUP_LIBS)
@USE_LIBARCHIVE_TRUE@am__append_54 = $(OT_DEP_LIBARCHIVE_CFLAGS)
@USE_LIBARCHIVE_TRUE@am__append_55 = $(OT_DEP_LIBARCHIVE_LIBS)
@BUILDOPT_SYSTEMD_TRUE@am__append_56 = ostree-remount
# It is built anyway as a side-effect of having the symlink in tests/,
# and if we declare it here, it gets cleaned up properly
@BUILDOPT_SYSTEMD_FALSE@am__append_56 = ostree-remount
@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__append_57 = ostree-prepare-root
@BUILDOPT_SYSTEMD_FALSE@am__append_57 = ostree-remount
@BUILDOPT_USE_STATIC_COMPILER_FALSE@am__append_58 = ostree-prepare-root
# This is the "new mode" of using a generator for /var; see
# https://github.com/ostreedev/ostree/issues/855
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_58 = -DHAVE_SYSTEMD_AND_LIBMOUNT=1
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_59 = -DHAVE_SYSTEMD_AND_LIBMOUNT=1
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_60 = -DHAVE_SYSTEMD_AND_LIBMOUNT=1
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@systemdsystemgenerator_PROGRAMS = ostree-system-generator$(EXEEXT)
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_60 = $(systemdsystemgenerator_PROGRAMS)
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_61 = $(systemdsystemgenerator_PROGRAMS)
# Allow the distcheck install under $prefix test to pass
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_61 = --with-systemdsystemgeneratordir='$${libdir}/systemd/system-generators'
@BUILDOPT_FUSE_TRUE@am__append_62 = rofiles-fuse
@BUILDOPT_ASAN_TRUE@am__append_63 = OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc
@ENABLE_EXPERIMENTAL_API_TRUE@am__append_64 = $(experimental_test_scripts)
@ENABLE_EXPERIMENTAL_API_FALSE@am__append_65 = $(experimental_test_scripts)
@BUILDOPT_FUSE_TRUE@am__append_66 = tests/test-rofiles-fuse.sh
@BUILDOPT_FUSE_TRUE@am__append_67 = tests/rofiles-fuse-symlink-stamp
@BUILDOPT_FUSE_FALSE@am__append_68 = tests/test-rofiles-fuse.sh
@USE_LIBSOUP_TRUE@am__append_69 = tests/test-remote-cookies.sh
@BUILDOPT_GJS_TRUE@am__append_70 = $(js_tests) $(js_installed_tests)
@BUILDOPT_GJS_FALSE@am__append_71 = $(js_tests)
@BUILDOPT_GJS_FALSE@am__append_72 = $(js_installed_tests)
@ENABLE_INSTALLED_TESTS_FALSE@am__append_73 = -rpath $(abs_builddir)
@USE_AVAHI_TRUE@am__append_74 = tests/test-repo-finder-avahi
@USE_LIBARCHIVE_TRUE@am__append_75 = tests/test-libarchive-import
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@am__append_76 = $(_installed_or_uninstalled_test_scripts)
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@am__append_77 = $(_installed_or_uninstalled_test_programs)
@ENABLE_INSTALLED_TESTS_TRUE@am__append_78 = install-installed-tests-extra
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@am__append_62 = --with-systemdsystemgeneratordir='$${libdir}/systemd/system-generators'
@BUILDOPT_FUSE_TRUE@am__append_63 = rofiles-fuse
@BUILDOPT_ASAN_TRUE@am__append_64 = OT_SKIP_READDIR_RAND=1 G_SLICE=always-malloc
@ENABLE_EXPERIMENTAL_API_TRUE@am__append_65 = $(experimental_test_scripts)
@ENABLE_EXPERIMENTAL_API_FALSE@am__append_66 = $(experimental_test_scripts)
@BUILDOPT_FUSE_TRUE@am__append_67 = tests/test-rofiles-fuse.sh
@BUILDOPT_FUSE_TRUE@am__append_68 = tests/rofiles-fuse-symlink-stamp
@BUILDOPT_FUSE_FALSE@am__append_69 = tests/test-rofiles-fuse.sh
@USE_LIBSOUP_TRUE@am__append_70 = tests/test-remote-cookies.sh
@BUILDOPT_GJS_TRUE@am__append_71 = $(js_tests) $(js_installed_tests)
@BUILDOPT_GJS_FALSE@am__append_72 = $(js_tests)
@BUILDOPT_GJS_FALSE@am__append_73 = $(js_installed_tests)
@ENABLE_INSTALLED_TESTS_FALSE@am__append_74 = -rpath $(abs_builddir)
@USE_AVAHI_TRUE@am__append_75 = tests/test-repo-finder-avahi
@USE_LIBARCHIVE_TRUE@am__append_76 = tests/test-libarchive-import
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@am__append_77 = $(_installed_or_uninstalled_test_scripts)
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@am__append_78 = $(_installed_or_uninstalled_test_programs)
@ENABLE_INSTALLED_TESTS_TRUE@am__append_79 = install-installed-tests-extra
# Allow the distcheck install under $prefix test to pass
@BUILDOPT_SYSTEMD_TRUE@am__append_79 = --with-systemdsystemunitdir='$${libdir}/systemd/system'
@BUILDOPT_SYSTEMD_TRUE@am__append_80 = --with-systemdsystemunitdir='$${libdir}/systemd/system'
# We're using the system grub2-mkconfig generator
@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_80 = src/boot/grub2/grub2-15_ostree
@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_81 = install-grub2-config-hook
@BUILDOPT_TRIVIAL_HTTPD_TRUE@@ENABLE_MAN_TRUE@am__append_82 = ostree-trivial-httpd.1
@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_81 = src/boot/grub2/grub2-15_ostree
@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_82 = install-grub2-config-hook
@BUILDOPT_TRIVIAL_HTTPD_TRUE@@ENABLE_MAN_TRUE@am__append_83 = ostree-trivial-httpd.1
# We still want to distribute the source, even if we are not building it
@BUILDOPT_TRIVIAL_HTTPD_FALSE@@ENABLE_MAN_TRUE@am__append_83 = man/ostree-trivial-httpd.xml
@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_84 = rofiles-fuse.1
@ENABLE_MAN_TRUE@am__append_85 = $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml)
@ENABLE_MAN_TRUE@am__append_86 = \
@BUILDOPT_TRIVIAL_HTTPD_FALSE@@ENABLE_MAN_TRUE@am__append_84 = man/ostree-trivial-httpd.xml
@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_85 = rofiles-fuse.1
@ENABLE_MAN_TRUE@am__append_86 = $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml)
@ENABLE_MAN_TRUE@am__append_87 = \
@ENABLE_MAN_TRUE@ $(man1_MANS) \
@ENABLE_MAN_TRUE@ $(man5_MANS) \
@ENABLE_MAN_TRUE@ $(NULL)
@ -783,6 +788,9 @@ am__objects_4 = $(am__objects_1)
@USE_CURL_TRUE@ src/libostree/libostree_1_la-ostree-soup-form.lo \
@USE_CURL_TRUE@ $(am__objects_1)
@USE_CURL_FALSE@@USE_LIBSOUP_TRUE@am__objects_10 = src/libostree/libostree_1_la-ostree-fetcher-soup.lo
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@am__objects_11 = src/libostree/libostree_1_la-ostree-soup-uri.lo \
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@ src/libostree/libostree_1_la-ostree-soup-form.lo \
@USE_AVAHI_TRUE@@USE_CURL_FALSE@@USE_LIBSOUP_FALSE@ $(am__objects_1)
am_libostree_1_la_OBJECTS = \
src/libostree/libostree_1_la-ostree-async-progress.lo \
src/libostree/libostree_1_la-ostree-cmdprivate.lo \
@ -836,7 +844,8 @@ am_libostree_1_la_OBJECTS = \
src/libostree/libostree_1_la-ostree-repo-finder-override.lo \
$(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
$(am__objects_8) $(am__objects_9) $(am__objects_10)
$(am__objects_8) $(am__objects_9) $(am__objects_10) \
$(am__objects_11)
nodist_libostree_1_la_OBJECTS = \
src/libostree/libostree_1_la-ostree-enumtypes.lo \
$(am__objects_1)
@ -997,13 +1006,13 @@ am__ostree_SOURCES_DIST = src/ostree/main.c \
src/ostree/ot-remote-cookie-util.c \
src/ostree/ot-builtin-pull.c \
src/ostree/ot-builtin-trivial-httpd.c
@USE_CURL_OR_SOUP_TRUE@am__objects_11 = src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT) \
@USE_CURL_OR_SOUP_TRUE@am__objects_12 = src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT) \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT) \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT) \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ostree-ot-remote-cookie-util.$(OBJEXT) \
@USE_CURL_OR_SOUP_TRUE@ $(am__objects_1) \
@USE_CURL_OR_SOUP_TRUE@ src/ostree/ostree-ot-builtin-pull.$(OBJEXT)
@USE_LIBSOUP_TRUE@am__objects_12 = src/ostree/ostree-ot-builtin-trivial-httpd.$(OBJEXT)
@USE_LIBSOUP_TRUE@am__objects_13 = src/ostree/ostree-ot-builtin-trivial-httpd.$(OBJEXT)
am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \
src/ostree/ostree-ot-builtin-admin.$(OBJEXT) \
src/ostree/ostree-ot-builtin-cat.$(OBJEXT) \
@ -1059,7 +1068,7 @@ am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \
src/ostree/ostree-ot-remote-builtin-show-url.$(OBJEXT) \
src/ostree/ostree-ot-remote-builtin-refs.$(OBJEXT) \
src/ostree/ostree-ot-remote-builtin-summary.$(OBJEXT) \
$(am__objects_1) $(am__objects_11) $(am__objects_12)
$(am__objects_1) $(am__objects_12) $(am__objects_13)
nodist_ostree_OBJECTS = src/ostree/ostree-parse-datetime.$(OBJEXT) \
$(am__objects_1)
ostree_OBJECTS = $(am_ostree_OBJECTS) $(nodist_ostree_OBJECTS)
@ -1729,7 +1738,7 @@ am__EXEEXT_23 = tests/test-basic.sh tests/test-basic-user.sh \
tests/test-repo-finder-mount-integration.sh \
tests/test-summary-collections.sh \
tests/test-pull-collections.sh $(am__EXEEXT_2) \
$(am__EXEEXT_20) $(am__append_66) $(am__append_69) \
$(am__EXEEXT_20) $(am__append_67) $(am__append_70) \
$(am__EXEEXT_22)
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@am__EXEEXT_24 = \
@ENABLE_INSTALLED_TESTS_EXCLUSIVE_FALSE@ $(am__EXEEXT_23)
@ -1858,6 +1867,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@
GPGME_CONFIG = @GPGME_CONFIG@
GPGME_PTHREAD_CFLAGS = @GPGME_PTHREAD_CFLAGS@
GPGME_PTHREAD_LIBS = @GPGME_PTHREAD_LIBS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GREP = @GREP@
GRUB2_MKCONFIG = @GRUB2_MKCONFIG@
GTKDOC_CHECK = @GTKDOC_CHECK@
@ -1914,6 +1924,8 @@ OT_DEP_GIO_UNIX_CFLAGS = @OT_DEP_GIO_UNIX_CFLAGS@
OT_DEP_GIO_UNIX_LIBS = @OT_DEP_GIO_UNIX_LIBS@
OT_DEP_GPGME_CFLAGS = @OT_DEP_GPGME_CFLAGS@
OT_DEP_GPGME_LIBS = @OT_DEP_GPGME_LIBS@
OT_DEP_GPG_ERROR_CFLAGS = @OT_DEP_GPG_ERROR_CFLAGS@
OT_DEP_GPG_ERROR_LIBS = @OT_DEP_GPG_ERROR_LIBS@
OT_DEP_LIBARCHIVE_CFLAGS = @OT_DEP_LIBARCHIVE_CFLAGS@
OT_DEP_LIBARCHIVE_LIBS = @OT_DEP_LIBARCHIVE_LIBS@
OT_DEP_LIBMOUNT_CFLAGS = @OT_DEP_LIBMOUNT_CFLAGS@
@ -2026,21 +2038,21 @@ AM_CFLAGS = -std=gnu99 -fno-strict-aliasing $(WARN_CFLAGS)
# Allow the distcheck install under $prefix test to pass
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man \
--disable-maintainer-mode $(NULL) $(am__append_61) \
$(am__append_79) \
--disable-maintainer-mode $(NULL) $(am__append_62) \
$(am__append_80) \
BASH_COMPLETIONSDIR='$${datadir}/bash-completion/completions'
SUBDIRS = . $(am__append_14)
NULL =
BUILT_SOURCES = $(nodist_libostree_1_la_SOURCES)
MANPAGES =
CLEANFILES = $(am__append_13) $(BUILT_SOURCES) $(am__append_46) \
CLEANFILES = $(am__append_13) $(BUILT_SOURCES) $(am__append_47) \
src/ostree/parse-datetime.c tests/libreaddir-rand.so \
tests/ostree-symlink-stamp \
tests/ostree-prepare-root-symlink-stamp \
tests/ostree-remount-symlink-stamp \
tests/rofiles-fuse-symlink-stamp tests/ostree \
tests/ostree-prepare-root tests/ostree-remount \
tests/rofiles-fuse $(am__append_86)
tests/rofiles-fuse $(am__append_87)
EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) autogen.sh \
COPYING README.md $(am__append_15) libglnx/README.md \
libglnx/COPYING libglnx/libglnx.m4 $(NULL) \
@ -2056,8 +2068,8 @@ EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) autogen.sh \
src/libostree/ostree-repo-deprecated.h \
src/libostree/ostree-version.h src/ostree/parse-datetime.y \
buildutil/tap-driver.sh buildutil/tap-test tests/glib.supp \
tests/ostree.supp $(NULL) $(am__append_65) $(am__append_68) \
$(am__append_71) tests/libtest.sh $(am__append_72) \
tests/ostree.supp $(NULL) $(am__append_66) $(am__append_69) \
$(am__append_72) tests/libtest.sh $(am__append_73) \
tests/libostreetest.h tests/libtest.sh \
tests/gpg-verify-data/README.md $(NULL) \
src/boot/dracut/module-setup.sh src/boot/dracut/ostree.conf \
@ -2066,11 +2078,11 @@ EXTRA_DIST = $(all_dist_test_scripts) $(all_dist_test_data) autogen.sh \
src/boot/ostree-remount.service \
src/boot/ostree-finalize-staged.service \
src/boot/grub2/grub2-15_ostree \
src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_83) \
$(am__append_85)
src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_84) \
$(am__append_86)
bin_SCRIPTS =
lib_LTLIBRARIES = libostree-1.la
pkglibexec_SCRIPTS = $(am__append_80)
pkglibexec_SCRIPTS = $(am__append_81)
noinst_LTLIBRARIES = $(am__append_1) libglnx.la libbsdiff.la \
libotutil.la libostree-kernel-args.la $(am__append_17) \
libostreetest.la
@ -2078,11 +2090,11 @@ privlibdir = $(pkglibdir)
privlib_LTLIBRARIES =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = src/libostree/ostree-1.pc
INTROSPECTION_GIRS = $(am__append_43)
INTROSPECTION_GIRS = $(am__append_44)
girdir = $(datadir)/gir-1.0
gir_DATA = $(am__append_44)
gir_DATA = $(am__append_45)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(am__append_45)
typelib_DATA = $(am__append_46)
gsettings_SCHEMAS =
ostree_bootdir = $(prefix)/lib/ostree
@ -2101,7 +2113,7 @@ AM_TESTS_ENVIRONMENT = G_TEST_SRCDIR="$(abs_srcdir)" \
pwd)$${LD_LIBRARY_PATH:+:$${LD_LIBRARY_PATH}} PATH=$$(cd \
$(top_builddir)/tests && pwd):$${PATH} \
OSTREE_FEATURES="$(OSTREE_FEATURES)" PYTHONUNBUFFERED=1 \
$(NULL) $(am__append_63)
$(NULL) $(am__append_64)
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/buildutil/tap-driver.sh
LOG_COMPILER = $(top_srcdir)/buildutil/tap-test
installed_test_LTLIBRARIES = $(am__append_12)
@ -2141,14 +2153,14 @@ all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installe
# This initializes some more variables
# This is a special facility to chain together hooks easily
INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_78) \
$(am__append_81)
INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_79) \
$(am__append_82)
ALL_LOCAL_RULES = tests/libreaddir-rand.so
shortened_sysconfdir = $$(echo "$(sysconfdir)" | sed -e 's|^$(prefix)||' -e 's|^/||')
OSTREE_GITREV = $(shell cd $(srcdir) && if command -v git >/dev/null 2>&1 && test -d .git; then git describe --abbrev=42 --tags --always HEAD; fi)
ACLOCAL_AMFLAGS = -I buildutil -I libglnx ${ACLOCAL_FLAGS}
GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in \
gtk-doc.make $(am__append_60)
gtk-doc.make $(am__append_61)
OT_INTERNAL_GIO_UNIX_CFLAGS = $(OT_DEP_GIO_UNIX_CFLAGS)
OT_INTERNAL_GIO_UNIX_LIBS = $(OT_DEP_GIO_UNIX_LIBS)
OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
@ -2373,7 +2385,7 @@ libostree_1_la_SOURCES = src/libostree/ostree-async-progress.c \
src/libostree/ostree-repo-finder-override.c $(NULL) \
$(am__append_18) $(am__append_19) $(am__append_20) \
$(am__append_21) $(am__append_22) $(am__append_31) \
$(am__append_32) $(am__append_35)
$(am__append_32) $(am__append_35) $(am__append_38)
libostree_experimental_headers = \
$(NULL)
@ -2389,8 +2401,8 @@ libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff \
$(OT_DEP_CRYPTO_CFLAGS) -fvisibility=hidden \
'-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) \
extern' $(am__append_25) $(am__append_27) $(am__append_29) \
$(am__append_33) $(am__append_36) $(am__append_38) \
$(am__append_40)
$(am__append_33) $(am__append_36) $(am__append_39) \
$(am__append_41)
libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions $(addprefix $(wl_versionscript_arg),$(symbol_files))
libostree_1_la_LIBADD = libotutil.la libglnx.la libbsdiff.la \
libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) \
@ -2398,13 +2410,13 @@ libostree_1_la_LIBADD = libotutil.la libglnx.la libbsdiff.la \
$(OT_DEP_ZLIB_LIBS) $(OT_DEP_CRYPTO_LIBS) $(am__append_24) \
$(bupsplitpath) $(am__append_26) $(am__append_28) \
$(am__append_30) $(am__append_34) $(am__append_37) \
$(am__append_39) $(am__append_41)
$(am__append_40) $(am__append_42)
EXTRA_libostree_1_la_DEPENDENCIES = $(symbol_files)
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_EXPORT_PACKAGES = ostree-1
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_INCLUDES = Gio-2.0
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_CFLAGS = \
@BUILDOPT_INTROSPECTION_TRUE@ $(libostree_1_la_CFLAGS) \
@BUILDOPT_INTROSPECTION_TRUE@ $(am__append_42)
@BUILDOPT_INTROSPECTION_TRUE@ $(am__append_43)
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_LIBS = libostree-1.la
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Ostree --symbol-prefix=ostree $(GI_SCANNERFLAGS)
@BUILDOPT_INTROSPECTION_TRUE@OSTree_1_0_gir_FILES = $(libostreeinclude_HEADERS) $(filter-out %-private.h %/ostree-soup-uri.h $(libostree_experimental_headers),$(libostree_1_la_SOURCES))
@ -2434,7 +2446,7 @@ ostree_SOURCES = src/ostree/main.c src/ostree/ot-builtin-admin.c \
src/ostree/ot-builtin-static-delta.c src/ostree/ot-main.h \
src/ostree/ot-main.c src/ostree/ot-dump.h src/ostree/ot-dump.c \
src/ostree/ot-editor.c src/ostree/ot-editor.h \
src/ostree/parse-datetime.h $(NULL) $(am__append_47) \
src/ostree/parse-datetime.h $(NULL) $(am__append_48) \
src/ostree/ot-admin-builtin-init-fs.c \
src/ostree/ot-admin-builtin-diff.c \
src/ostree/ot-admin-builtin-deploy.c \
@ -2464,7 +2476,7 @@ ostree_SOURCES = src/ostree/main.c src/ostree/ot-builtin-admin.c \
src/ostree/ot-remote-builtin-show-url.c \
src/ostree/ot-remote-builtin-refs.c \
src/ostree/ot-remote-builtin-summary.c $(NULL) \
$(am__append_48) $(am__append_49)
$(am__append_49) $(am__append_50)
nodist_ostree_SOURCES = \
src/ostree/parse-datetime.c \
$(NULL)
@ -2476,11 +2488,11 @@ ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/sr
ostree_bin_shared_ldadd = $(AM_LDFLAGS) libglnx.la libotutil.la libostree-1.la \
$(OT_INTERNAL_GIO_UNIX_LIBS)
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(am__append_51) \
$(am__append_53)
ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la \
libostree-kernel-args.la $(LIBSYSTEMD_LIBS) $(am__append_52) \
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(am__append_52) \
$(am__append_54)
ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la \
libostree-kernel-args.la $(LIBSYSTEMD_LIBS) $(am__append_53) \
$(am__append_55)
@USE_LIBSOUP_TRUE@ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
@USE_LIBSOUP_TRUE@ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
@USE_LIBSOUP_TRUE@ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
@ -2489,7 +2501,7 @@ ostree_prepare_root_SOURCES = \
src/switchroot/ostree-prepare-root.c \
$(NULL)
ostree_prepare_root_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_58)
ostree_prepare_root_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_59)
# We're using our internal generator
@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_TRUE@ostree_boot_SCRIPTS = src/boot/grub2/ostree-grub-generator
@ -2511,7 +2523,7 @@ ostree_remount_SOURCES = \
$(NULL)
ostree_remount_CPPFLAGS = $(AM_CPPFLAGS) -Isrc/switchroot \
$(am__append_59)
$(am__append_60)
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@ostree_system_generator_SOURCES = src/switchroot/ostree-mount-util.h \
@BUILDOPT_SYSTEMD_AND_LIBMOUNT_TRUE@ src/switchroot/ostree-system-generator.c
@ -2526,7 +2538,7 @@ ostree_remount_CPPFLAGS = $(AM_CPPFLAGS) -Isrc/switchroot \
@BUILDOPT_FUSE_TRUE@rofiles_fuse_LDADD = libglnx.la $(BUILDOPT_FUSE_LIBS) $(OT_INTERNAL_GIO_UNIX_LIBS) libostree-1.la
uninstalled_test_data = tests/ostree-symlink-stamp \
tests/ostree-prepare-root-symlink-stamp \
tests/ostree-remount-symlink-stamp $(am__append_67)
tests/ostree-remount-symlink-stamp $(am__append_68)
dist_uninstalled_test_scripts = tests/test-symbols.sh tests/coccinelle.sh
# This logic implements ENABLE_INSTALLED_TESTS_EXCLUSIVE; see below.
@ -2534,10 +2546,10 @@ dist_uninstalled_test_scripts = tests/test-symbols.sh tests/coccinelle.sh
# tests *only* run installed, to avoid having to run them twice in CI.
# This overrides the glib-tap.mk emphasis on doing both, if we'd
# used e.g. `dist_test_scripts`.
dist_test_scripts = $(NULL) $(am__append_76)
dist_test_scripts = $(NULL) $(am__append_77)
test_programs = tests/test-bloom tests/test-repo-finder-config \
tests/test-repo-finder-mount $(NULL) $(am__append_74) \
$(am__append_77)
tests/test-repo-finder-mount $(NULL) $(am__append_75) \
$(am__append_78)
_installed_or_uninstalled_test_scripts = tests/test-basic.sh \
tests/test-basic-user.sh tests/test-basic-user-only.sh \
tests/test-basic-root.sh tests/test-pull-subpath.sh \
@ -2585,8 +2597,8 @@ _installed_or_uninstalled_test_scripts = tests/test-basic.sh \
tests/test-remote-add-collections.sh \
tests/test-repo-finder-mount-integration.sh \
tests/test-summary-collections.sh \
tests/test-pull-collections.sh $(NULL) $(am__append_64) \
$(am__append_66) $(am__append_69) $(am__append_70)
tests/test-pull-collections.sh $(NULL) $(am__append_65) \
$(am__append_67) $(am__append_70) $(am__append_71)
experimental_test_scripts = \
$(NULL)
@ -2656,7 +2668,7 @@ libreaddir_rand_la_LIBADD = \
$(NULL)
libreaddir_rand_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version \
$(am__append_73)
$(am__append_74)
_installed_or_uninstalled_test_programs = tests/test-varint \
tests/test-ot-unix-utils tests/test-bsdiff \
tests/test-mutable-tree tests/test-keyfile-utils \
@ -2664,7 +2676,7 @@ _installed_or_uninstalled_test_programs = tests/test-varint \
tests/test-gpg-verify-result tests/test-checksum \
tests/test-lzma tests/test-rollsum tests/test-basic-c \
tests/test-sysroot-c tests/test-pull-c tests/test-repo \
tests/test-include-ostree-h $(am__append_75)
tests/test-include-ostree-h $(am__append_76)
common_tests_cflags = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx
common_tests_ldadd = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
libostreetest_la_SOURCES = tests/libostreetest.c tests/test-mock-gio.c tests/test-mock-gio.h
@ -2776,7 +2788,7 @@ tests_test_gpg_verify_result_LDADD = $(TESTS_LDADD) $(OT_INTERNAL_GPGME_LIBS)
@ENABLE_MAN_TRUE@ ostree-refs.1 ostree-remote.1 ostree-reset.1 \
@ENABLE_MAN_TRUE@ ostree-rev-parse.1 ostree-show.1 \
@ENABLE_MAN_TRUE@ ostree-summary.1 ostree-static-delta.1 \
@ENABLE_MAN_TRUE@ $(am__append_82) $(am__append_84)
@ENABLE_MAN_TRUE@ $(am__append_83) $(am__append_85)
@ENABLE_MAN_TRUE@man5_files = ostree.repo.5 ostree.repo-config.5
@ENABLE_MAN_TRUE@man1_MANS = $(addprefix man/,$(man1_files))
@ENABLE_MAN_TRUE@man5_MANS = $(addprefix man/,$(man5_files))
@ -8560,7 +8572,7 @@ src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile
$(AM_V_GEN) $(YACC) $< -o $@
@BUILDOPT_USE_STATIC_COMPILER_TRUE@ostree-prepare-root : $(ostree_prepare_root_SOURCES)
@BUILDOPT_USE_STATIC_COMPILER_TRUE@ $(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(AM_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES)
@BUILDOPT_USE_STATIC_COMPILER_TRUE@ $(STATIC_COMPILER) -o $@ -static $(top_srcdir)/src/switchroot/ostree-prepare-root.c $(ostree_prepare_root_CPPFLAGS) $(AM_CFLAGS) $(DEFAULT_INCLUDES)
tests/libreaddir-rand.so: Makefile
$(AM_V_GEN) ln -fns ../.libs/libreaddir-rand.so tests

View File

@ -232,6 +232,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@
GPGME_CONFIG = @GPGME_CONFIG@
GPGME_PTHREAD_CFLAGS = @GPGME_PTHREAD_CFLAGS@
GPGME_PTHREAD_LIBS = @GPGME_PTHREAD_LIBS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GREP = @GREP@
GRUB2_MKCONFIG = @GRUB2_MKCONFIG@
GTKDOC_CHECK = @GTKDOC_CHECK@
@ -288,6 +289,8 @@ OT_DEP_GIO_UNIX_CFLAGS = @OT_DEP_GIO_UNIX_CFLAGS@
OT_DEP_GIO_UNIX_LIBS = @OT_DEP_GIO_UNIX_LIBS@
OT_DEP_GPGME_CFLAGS = @OT_DEP_GPGME_CFLAGS@
OT_DEP_GPGME_LIBS = @OT_DEP_GPGME_LIBS@
OT_DEP_GPG_ERROR_CFLAGS = @OT_DEP_GPG_ERROR_CFLAGS@
OT_DEP_GPG_ERROR_LIBS = @OT_DEP_GPG_ERROR_LIBS@
OT_DEP_LIBARCHIVE_CFLAGS = @OT_DEP_LIBARCHIVE_CFLAGS@
OT_DEP_LIBARCHIVE_LIBS = @OT_DEP_LIBARCHIVE_LIBS@
OT_DEP_LIBMOUNT_CFLAGS = @OT_DEP_LIBMOUNT_CFLAGS@

View File

@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">OSTree API references</p></th></tr></table></div>
<div><p class="releaseinfo">for OSTree 2018.6</p></div>
<div><p class="releaseinfo">for OSTree 2018.7</p></div>
</div>
<hr>
</div>

View File

@ -49,6 +49,22 @@
</tr>
<tr>
<td class="function_type">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="returnvalue">OstreeMutableTree</span></a> *
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-new-from-checksum" title="ostree_mutable_tree_new_from_checksum ()">ostree_mutable_tree_new_from_checksum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-check-error" title="ostree_mutable_tree_check_error ()">ostree_mutable_tree_check_error</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
@ -133,6 +149,14 @@
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-files" title="ostree_mutable_tree_get_files ()">ostree_mutable_tree_get_files</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-fill-empty-from-dirtree" title="ostree_mutable_tree_fill_empty_from_dirtree ()">ostree_mutable_tree_fill_empty_from_dirtree</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
@ -171,6 +195,79 @@ ostree_mutable_tree_new (<em class="parameter"><code><span class="type">void</sp
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-new-from-checksum"></a><h3>ostree_mutable_tree_new_from_checksum ()</h3>
<pre class="programlisting"><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="returnvalue">OstreeMutableTree</span></a> *
ostree_mutable_tree_new_from_checksum (<em class="parameter"><code><a class="link" href="ostree-OstreeRepo.html#OstreeRepo" title="OstreeRepo"><span class="type">OstreeRepo</span></a> *repo</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *contents_checksum</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *metadata_checksum</code></em>);</pre>
<p>Creates a new OstreeMutableTree with the contents taken from the given repo
and checksums. The data will be loaded from the repo lazily as needed.</p>
<div class="refsect3">
<a name="ostree-mutable-tree-new-from-checksum.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>repo</p></td>
<td class="parameter_description"><p>The repo which contains the objects refered by the checksums.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>contents_checksum</p></td>
<td class="parameter_description"><p>dirtree checksum</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>metadata_checksum</p></td>
<td class="parameter_description"><p>dirmeta checksum</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="ostree-mutable-tree-new-from-checksum.returns"></a><h4>Returns</h4>
<p>A new tree. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-check-error"></a><h3>ostree_mutable_tree_check_error ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_check_error (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>In some cases, a tree may be in a "lazy" state that loads
data in the background; if an error occurred during a non-throwing
API call, it will have been cached. This function checks for a
cached error. The tree remains in error state.</p>
<div class="refsect3">
<a name="ostree-mutable-tree-check-error.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>Tree</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="ostree-mutable-tree-check-error.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> on success</p>
</div>
<p class="since">Since: 2018.7</p>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-set-metadata-checksum"></a><h3>ostree_mutable_tree_set_metadata_checksum ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_mutable_tree_set_metadata_checksum
@ -216,6 +313,41 @@ ostree_mutable_tree_ensure_dir (<em class="parameter"><code><a class="link" href
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> **out_subdir</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Returns the subdirectory of self with filename <em class="parameter"><code>name</code></em>
, creating an empty one
it if it doesn't exist.</p>
<div class="refsect3">
<a name="ostree-mutable-tree-ensure-dir.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>Tree</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>Name of subdirectory of self to retrieve/creates</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_subdir</p></td>
<td class="parameter_description"><p>the subdirectory. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/out"><span class="acronym">out</span></a>][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
@ -353,6 +485,37 @@ ostree_mutable_tree_get_files (<em class="parameter"><code><a class="link" href=
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8 utf8]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-fill-empty-from-dirtree"></a><h3>ostree_mutable_tree_fill_empty_from_dirtree ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_fill_empty_from_dirtree
(<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-OstreeRepo.html#OstreeRepo" title="OstreeRepo"><span class="type">OstreeRepo</span></a> *repo</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *contents_checksum</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *metadata_checksum</code></em>);</pre>
<p>Merges <em class="parameter"><code>self</code></em>
with the tree given by <em class="parameter"><code>contents_checksum</code></em>
and
<em class="parameter"><code>metadata_checksum</code></em>
, but only if it's possible without writing new objects to
the <em class="parameter"><code>repo</code></em>
. We can do this if either <em class="parameter"><code>self</code></em>
is empty, the tree given by
<em class="parameter"><code>contents_checksum</code></em>
is empty or if both trees already have the same
<em class="parameter"><code>contents_checksum</code></em>
.</p>
<div class="refsect3">
<a name="ostree-mutable-tree-fill-empty-from-dirtree.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>TRUE</code></em>
if merge was successful, <em class="parameter"><code>FALSE</code></em>
if it was not possible.</p>
<p>This function enables optimisations when composing trees. The provided
checksums are not loaded or checked when this function is called. Instead
the contents will be loaded only when needed.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="ostree-In-memory-modifiable-filesystem-tree.other_details"></a><h2>Types and Values</h2>

View File

@ -1392,7 +1392,8 @@ metadata bit will be set causing libostree to avoid automatic GC of the
deployment. However, this is really an "advisory" note; it's still possible
for e.g. older versions of libostree unaware of pinning to GC the deployment.</p>
<p>This function does nothing and returns successfully if the deployment
is already in the desired pinning state.</p>
is already in the desired pinning state. It is an error to try to pin
the staged deployment (as it's not in the bootloader entries).</p>
<div class="refsect3">
<a name="ostree-sysroot-deployment-set-pinned.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">

View File

@ -239,6 +239,8 @@
<keyword type="enum" name="enum OstreeRepoPruneFlags" link="ostree-OstreeRepo.html#OstreeRepoPruneFlags"/>
<keyword type="enum" name="enum OstreeRepoPullFlags" link="ostree-OstreeRepo.html#OstreeRepoPullFlags"/>
<keyword type="function" name="ostree_mutable_tree_new ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-new"/>
<keyword type="function" name="ostree_mutable_tree_new_from_checksum ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-new-from-checksum"/>
<keyword type="function" name="ostree_mutable_tree_check_error ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-check-error" since="2018.7"/>
<keyword type="function" name="ostree_mutable_tree_set_metadata_checksum ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-set-metadata-checksum"/>
<keyword type="function" name="ostree_mutable_tree_get_metadata_checksum ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-metadata-checksum"/>
<keyword type="function" name="ostree_mutable_tree_set_contents_checksum ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-set-contents-checksum"/>
@ -250,6 +252,7 @@
<keyword type="function" name="ostree_mutable_tree_walk ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-walk"/>
<keyword type="function" name="ostree_mutable_tree_get_subdirs ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-subdirs"/>
<keyword type="function" name="ostree_mutable_tree_get_files ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-files"/>
<keyword type="function" name="ostree_mutable_tree_fill_empty_from_dirtree ()" link="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-fill-empty-from-dirtree"/>
<keyword type="typedef" name="OstreeMutableTree" link="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree"/>
<keyword type="function" name="ostree_sysroot_new ()" link="ostree-Root-partition-mount-point.html#ostree-sysroot-new"/>
<keyword type="function" name="ostree_sysroot_new_default ()" link="ostree-Root-partition-mount-point.html#ostree-sysroot-new-default"/>

View File

@ -543,6 +543,10 @@ ostree_collection_ref_new, function in ostree-ref
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-check-error" title="ostree_mutable_tree_check_error ()">ostree_mutable_tree_check_error</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-ensure-dir" title="ostree_mutable_tree_ensure_dir ()">ostree_mutable_tree_ensure_dir</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>
@ -551,6 +555,10 @@ ostree_collection_ref_new, function in ostree-ref
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-fill-empty-from-dirtree" title="ostree_mutable_tree_fill_empty_from_dirtree ()">ostree_mutable_tree_fill_empty_from_dirtree</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-contents-checksum" title="ostree_mutable_tree_get_contents_checksum ()">ostree_mutable_tree_get_contents_checksum</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>
@ -575,6 +583,10 @@ ostree_collection_ref_new, function in ostree-ref
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-new-from-checksum" title="ostree_mutable_tree_new_from_checksum ()">ostree_mutable_tree_new_from_checksum</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-replace-file" title="ostree_mutable_tree_replace_file ()">ostree_mutable_tree_replace_file</a>, function in <a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html" title="In-memory modifiable filesystem tree">In-memory modifiable filesystem tree</a>
</dt>
<dd></dd>

View File

@ -250,6 +250,8 @@ OstreeLzmaDecompressorClass
<FILE>ostree-mutable-tree</FILE>
OstreeMutableTree
ostree_mutable_tree_new
ostree_mutable_tree_new_from_checksum
ostree_mutable_tree_check_error
ostree_mutable_tree_set_metadata_checksum
ostree_mutable_tree_get_metadata_checksum
ostree_mutable_tree_set_contents_checksum
@ -261,6 +263,7 @@ ostree_mutable_tree_ensure_parent_dirs
ostree_mutable_tree_walk
ostree_mutable_tree_get_subdirs
ostree_mutable_tree_get_files
ostree_mutable_tree_fill_empty_from_dirtree
<SUBSECTION Standard>
OSTREE_MUTABLE_TREE
OSTREE_IS_MUTABLE_TREE

View File

@ -1 +1 @@
2018.6
2018.7

View File

@ -908,6 +908,7 @@ _ostree_pull() {
--depth
--http-header
--localcache-repo -L
--network-retries
--repo
--subpath
--update-frequency

View File

@ -7,6 +7,7 @@ AC_CHECK_DECLS([
[], [], [[
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sched.h>

197
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libostree 2018.6.
# Generated by GNU Autoconf 2.69 for libostree 2018.7.
#
# Report bugs to <walters@verbum.org>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libostree'
PACKAGE_TARNAME='libostree'
PACKAGE_VERSION='2018.6'
PACKAGE_STRING='libostree 2018.6'
PACKAGE_VERSION='2018.7'
PACKAGE_STRING='libostree 2018.7'
PACKAGE_BUGREPORT='walters@verbum.org'
PACKAGE_URL=''
@ -721,6 +721,9 @@ GTKDOC_MKPDF
GTKDOC_REBASE
GTKDOC_CHECK_PATH
GTKDOC_CHECK
GPG_ERROR_CONFIG
OT_DEP_GPG_ERROR_LIBS
OT_DEP_GPG_ERROR_CFLAGS
GPGME_PTHREAD_LIBS
GPGME_PTHREAD_CFLAGS
GPGME_CONFIG
@ -986,6 +989,8 @@ OT_DEP_SOUP_CFLAGS
OT_DEP_SOUP_LIBS
OT_DEP_GPGME_CFLAGS
OT_DEP_GPGME_LIBS
OT_DEP_GPG_ERROR_CFLAGS
OT_DEP_GPG_ERROR_LIBS
GTKDOC_DEPS_CFLAGS
GTKDOC_DEPS_LIBS
OT_DEP_LIBARCHIVE_CFLAGS
@ -1542,7 +1547,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libostree 2018.6 to adapt to many kinds of systems.
\`configure' configures libostree 2018.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1612,7 +1617,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libostree 2018.6:";;
short | recursive ) echo "Configuration of libostree 2018.7:";;
esac
cat <<\_ACEOF
@ -1756,6 +1761,10 @@ Some influential environment variables:
C compiler flags for OT_DEP_GPGME, overriding pkg-config
OT_DEP_GPGME_LIBS
linker flags for OT_DEP_GPGME, overriding pkg-config
OT_DEP_GPG_ERROR_CFLAGS
C compiler flags for OT_DEP_GPG_ERROR, overriding pkg-config
OT_DEP_GPG_ERROR_LIBS
linker flags for OT_DEP_GPG_ERROR, overriding pkg-config
GTKDOC_DEPS_CFLAGS
C compiler flags for GTKDOC_DEPS, overriding pkg-config
GTKDOC_DEPS_LIBS
@ -1855,7 +1864,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libostree configure 2018.6
libostree configure 2018.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2327,7 +2336,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libostree $as_me 2018.6, which was
It was created by libostree $as_me 2018.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3195,7 +3204,7 @@ fi
# Define the identity of the package.
PACKAGE='libostree'
VERSION='2018.6'
VERSION='2018.7'
# Some tools Automake needs.
@ -5929,9 +5938,9 @@ test -n "$YACC" || YACC="yacc"
YEAR_VERSION=2018
RELEASE_VERSION=6
RELEASE_VERSION=7
PACKAGE_VERSION=2018.6
PACKAGE_VERSION=2018.7
if echo "$CFLAGS" | grep -q -E -e '-Werror($| )'; then :
@ -13778,6 +13787,7 @@ fi
ac_fn_c_check_decl "$LINENO" "renameat2" "ac_cv_have_decl_renameat2" "
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sched.h>
@ -13798,6 +13808,7 @@ _ACEOF
ac_fn_c_check_decl "$LINENO" "memfd_create" "ac_cv_have_decl_memfd_create" "
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sched.h>
@ -13818,6 +13829,7 @@ _ACEOF
ac_fn_c_check_decl "$LINENO" "copy_file_range" "ac_cv_have_decl_copy_file_range" "
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sched.h>
@ -15689,6 +15701,167 @@ if test x$have_gpgme = xno ; then :
fi
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OT_DEP_GPG_ERROR" >&5
$as_echo_n "checking for OT_DEP_GPG_ERROR... " >&6; }
if test -n "$OT_DEP_GPG_ERROR_CFLAGS"; then
pkg_cv_OT_DEP_GPG_ERROR_CFLAGS="$OT_DEP_GPG_ERROR_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gpg-error\""; } >&5
($PKG_CONFIG --exists --print-errors "gpg-error") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OT_DEP_GPG_ERROR_CFLAGS=`$PKG_CONFIG --cflags "gpg-error" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$OT_DEP_GPG_ERROR_LIBS"; then
pkg_cv_OT_DEP_GPG_ERROR_LIBS="$OT_DEP_GPG_ERROR_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gpg-error\""; } >&5
($PKG_CONFIG --exists --print-errors "gpg-error") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OT_DEP_GPG_ERROR_LIBS=`$PKG_CONFIG --libs "gpg-error" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
OT_DEP_GPG_ERROR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gpg-error" 2>&1`
else
OT_DEP_GPG_ERROR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gpg-error" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$OT_DEP_GPG_ERROR_PKG_ERRORS" >&5
# Extract the first word of "gpg-error-config", so it can be a program name with args.
set dummy gpg-error-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GPG_ERROR_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GPG_ERROR_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_GPG_ERROR_CONFIG="$GPG_ERROR_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GPG_ERROR_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_GPG_ERROR_CONFIG" && ac_cv_path_GPG_ERROR_CONFIG="as_fn_error $? "Missing gpg-error-config" "$LINENO" 5"
;;
esac
fi
GPG_ERROR_CONFIG=$ac_cv_path_GPG_ERROR_CONFIG
if test -n "$GPG_ERROR_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG_ERROR_CONFIG" >&5
$as_echo "$GPG_ERROR_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
OT_DEP_GPG_ERROR_CFLAGS="$( $GPG_ERROR_CONFIG --cflags )"
OT_DEP_GPG_ERROR_LIBS="$( $GPG_ERROR_CONFIG --libs )"
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
# Extract the first word of "gpg-error-config", so it can be a program name with args.
set dummy gpg-error-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GPG_ERROR_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GPG_ERROR_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_GPG_ERROR_CONFIG="$GPG_ERROR_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GPG_ERROR_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_GPG_ERROR_CONFIG" && ac_cv_path_GPG_ERROR_CONFIG="as_fn_error $? "Missing gpg-error-config" "$LINENO" 5"
;;
esac
fi
GPG_ERROR_CONFIG=$ac_cv_path_GPG_ERROR_CONFIG
if test -n "$GPG_ERROR_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG_ERROR_CONFIG" >&5
$as_echo "$GPG_ERROR_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
OT_DEP_GPG_ERROR_CFLAGS="$( $GPG_ERROR_CONFIG --cflags )"
OT_DEP_GPG_ERROR_LIBS="$( $GPG_ERROR_CONFIG --libs )"
else
OT_DEP_GPG_ERROR_CFLAGS=$pkg_cv_OT_DEP_GPG_ERROR_CFLAGS
OT_DEP_GPG_ERROR_LIBS=$pkg_cv_OT_DEP_GPG_ERROR_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
OT_DEP_GPGME_CFLAGS="${OT_DEP_GPGME_CFLAGS} ${OT_DEP_GPG_ERROR_CFLAGS}"
OT_DEP_GPGME_LIBS="${OT_DEP_GPGME_LIBS} ${OT_DEP_GPG_ERROR_LIBS}"
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
# What's in RHEL7.2.
FUSE_DEPENDENCY="fuse >= 2.9.2"
@ -18450,7 +18623,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libostree $as_me 2018.6, which was
This file was extended by libostree $as_me 2018.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -18516,7 +18689,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libostree config.status 2018.6
libostree config.status 2018.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -4,7 +4,7 @@ dnl update libostree-released.sym from libostree-devel.sym, and update the check
dnl in test-symbols.sh, and also set is_release_build=yes below. Then make
dnl another post-release commit to bump the version, and set is_release_build=no.
m4_define([year_version], [2018])
m4_define([release_version], [6])
m4_define([release_version], [7])
m4_define([package_version], [year_version.release_version])
AC_INIT([libostree], [package_version], [walters@verbum.org])
is_release_build=yes
@ -220,6 +220,15 @@ AS_IF([ test x$have_gpgme = xno ], [
AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
])
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
PKG_CHECK_MODULES(OT_DEP_GPG_ERROR, [gpg-error], [], [
dnl This apparently doesn't ship a pkg-config file either, and we need
dnl to link to it directly.
AC_PATH_PROG(GPG_ERROR_CONFIG, [gpg-error-config], [AC_MSG_ERROR([Missing gpg-error-config])])
OT_DEP_GPG_ERROR_CFLAGS="$( $GPG_ERROR_CONFIG --cflags )"
OT_DEP_GPG_ERROR_LIBS="$( $GPG_ERROR_CONFIG --libs )"
])
OT_DEP_GPGME_CFLAGS="${OT_DEP_GPGME_CFLAGS} ${OT_DEP_GPG_ERROR_CFLAGS}"
OT_DEP_GPGME_LIBS="${OT_DEP_GPGME_LIBS} ${OT_DEP_GPG_ERROR_LIBS}"
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
# What's in RHEL7.2.

View File

@ -7,6 +7,7 @@ AC_CHECK_DECLS([
[], [], [[
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mount.h>
#include <fcntl.h>
#include <sched.h>

View File

@ -129,6 +129,14 @@ Boston, MA 02111-1307, USA.
Traverse DEPTH parents (-1=infinite) (default: 0).
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--network-retries</option>=N</term>
<listitem><para>
Specifies how many times each download should be retried upon error (default: 5)
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -121,15 +121,18 @@ Boston, MA 02111-1307, USA.
<term><varname>min-free-space-percent</varname></term>
<listitem><para>Integer percentage value (0-99) that specifies a minimum
percentage of total space (in blocks) in the underlying filesystem to
keep free. The default value is 3.</para></listitem>
keep free. The default value is 3.</para>
<para>In case this option is co-existing with min-free-space-size (see below),
it would be ignored and min-free-space-size check would be enforced instead.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>min-free-space-size</varname></term>
<listitem><para>Value (in MB, GB or TB) that specifies a minimum space (in blocks)
in the underlying filesystem to keep free. Also, note that min-free-space-percent
<listitem><para>Value (in MB, GB or TB) that specifies a minimum space in the
underlying filesystem to keep free. Also, note that min-free-space-percent
and min-free-space-size are mutually exclusive. Examples of acceptable values:
500MB, 1GB etc.
500MB, 1GB etc. The default value is 0MB, which disables this check.
</para></listitem>
</varlistentry>
@ -161,6 +164,15 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>collection-id</varname></term>
<listitem><para>A reverse DNS domain name under your control, which enables peer
to peer distribution of refs in this repository. See the
<literal>--collection-id</literal> section in
<citerefentry><refentrytitle>ostree-init</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -1,8 +0,0 @@
# This is used after `cargo vendor` is run from `make dist`
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'

14
rust/Cargo.lock generated
View File

@ -1,14 +0,0 @@
[[package]]
name = "bupsplit"
version = "0.0.1"
dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
version = "0.2.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"

View File

@ -1,16 +0,0 @@
[package]
name = "bupsplit"
version = "0.0.1"
authors = ["Colin Walters <walters@verbum.org>"]
[dependencies]
libc = "0.2"
[lib]
name = "bupsplit_rs"
path = "src/bupsplit.rs"
crate-type = ["staticlib"]
[profile.release]
panic = "abort"
lto = true

View File

@ -1,8 +0,0 @@
# This is used after `cargo vendor` is run from `make dist`
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'

View File

@ -1,129 +0,0 @@
/*
* Copyright 2017 Colin Walters <walters@verbum.org>
* Based on original bupsplit.c:
* Copyright 2011 Avery Pennarun. All rights reserved.
*
* (This license applies to bupsplit.c and bupsplit.h only.)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY AVERY PENNARUN ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
extern crate libc;
use std::slice;
// According to librsync/rollsum.h:
// "We should make this something other than zero to improve the
// checksum algorithm: tridge suggests a prime number."
// apenwarr: I unscientifically tried 0 and 7919, and they both ended up
// slightly worse than the librsync value of 31 for my arbitrary test data.
const ROLLSUM_CHAR_OFFSET: u32 = 31;
// Previously in the header file
const BUP_BLOBBITS: u32 = 13;
const BUP_BLOBSIZE: u32 = (1<<BUP_BLOBBITS);
const BUP_WINDOWBITS: u32 = 7;
const BUP_WINDOWSIZE: u32 = (1<<(BUP_WINDOWBITS-1));
struct Rollsum {
s1: u32,
s2: u32,
window: [u8; BUP_WINDOWSIZE as usize],
wofs: i32,
}
impl Rollsum {
pub fn new() -> Rollsum {
Rollsum { s1: BUP_WINDOWSIZE * ROLLSUM_CHAR_OFFSET,
s2: BUP_WINDOWSIZE * (BUP_WINDOWSIZE-1) * ROLLSUM_CHAR_OFFSET,
window: [0; 64],
wofs: 0
}
}
// These formulas are based on rollsum.h in the librsync project.
pub fn add(&mut self, drop: u8, add: u8) -> () {
let drop_expanded = u32::from(drop);
let add_expanded = u32::from(add);
self.s1 = self.s1.wrapping_add(add_expanded.wrapping_sub(drop_expanded));
self.s2 = self.s2.wrapping_add(self.s1.wrapping_sub(BUP_WINDOWSIZE * (drop_expanded + ROLLSUM_CHAR_OFFSET)));
}
pub fn roll(&mut self, ch: u8) -> () {
let wofs = self.wofs as usize;
let dval = self.window[wofs];
self.add(dval, ch);
self.window[wofs] = ch;
self.wofs = (self.wofs + 1) % (BUP_WINDOWSIZE as i32);
}
pub fn digest(&self) -> u32 {
(self.s1 << 16) | (self.s2 & 0xFFFF)
}
}
#[no_mangle]
pub extern fn bupsplit_sum(buf: *const u8, ofs: libc::size_t, len: libc::size_t) -> u32 {
let sbuf = unsafe {
assert!(!buf.is_null());
slice::from_raw_parts(buf.offset(ofs as isize), (len - ofs) as usize)
};
let mut r = Rollsum::new();
for x in sbuf {
r.roll(*x);
}
r.digest()
}
#[no_mangle]
pub extern fn bupsplit_find_ofs(buf: *const u8, len: libc::size_t,
bits: *mut libc::c_int) -> libc::c_int
{
if buf.is_null() {
return 0;
}
let sbuf = unsafe { slice::from_raw_parts(buf, len as usize) };
let mut r = Rollsum::new();
for x in sbuf {
r.roll(*x);
if (r.s2 & (BUP_BLOBSIZE-1)) == ((u32::max_value()) & (BUP_BLOBSIZE-1)) {
if !bits.is_null() {
let mut sum = r.digest() >> BUP_BLOBBITS;
let mut rbits : libc::c_int = BUP_BLOBBITS as i32;
while sum & 1 != 0 {
sum >>= 1;
rbits += 1;
}
unsafe {
*bits = rbits;
}
}
return len as i32
}
}
0
}

File diff suppressed because one or more lines are too long

View File

@ -1,116 +0,0 @@
language: rust
rust: stable
sudo: required
dist: trusty
services:
- docker
install:
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
script:
- cargo build $OPT
- cargo build $OPT --no-default-features
- cargo generate-lockfile --manifest-path libc-test/Cargo.toml
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then
sh ci/run-docker.sh $TARGET;
else
export CARGO_TARGET_DIR=`pwd`/target;
sh ci/run.sh $TARGET;
fi
- rustc ci/style.rs && ./style src
env:
global:
secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="
matrix:
allow_failures:
# FIXME(#987) move back to include once 404 is fixed
- env: TARGET=s390x-unknown-linux-gnu
include:
# 1.13.0 compat
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
rust: 1.13.0
script: rm -f Cargo.lock && cargo build
install:
# build documentation
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
rust: nightly
script: sh ci/dox.sh
# stable compat
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
- env: TARGET=i686-unknown-linux-gnu
- os: osx
env: TARGET=x86_64-apple-darwin NO_ADD=1
osx_image: xcode8.3
- os: osx
env: TARGET=i686-apple-darwin
osx_image: xcode8.3
- env: TARGET=arm-linux-androideabi
- env: TARGET=aarch64-linux-android
# FIXME(#826) should reenable
#- env: TARGET=i686-linux-android
- env: TARGET=x86_64-linux-android
- env: TARGET=x86_64-unknown-linux-musl
- env: TARGET=i686-unknown-linux-musl
- env: TARGET=arm-unknown-linux-gnueabihf
- env: TARGET=arm-unknown-linux-musleabihf
- env: TARGET=aarch64-unknown-linux-gnu
- env: TARGET=aarch64-unknown-linux-musl
# FIXME(#856)
rust: 1.22.1
- os: osx
osx_image: xcode8.2
env: TARGET=i386-apple-ios
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
before_install:
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
- os: osx
osx_image: xcode8.2
env: TARGET=x86_64-apple-ios
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
before_install:
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
- env: TARGET=x86_64-rumprun-netbsd
- env: TARGET=powerpc-unknown-linux-gnu
- env: TARGET=powerpc64-unknown-linux-gnu
- env: TARGET=powerpc64le-unknown-linux-gnu
- env: TARGET=mips-unknown-linux-musl
- env: TARGET=mipsel-unknown-linux-musl
- env: TARGET=mips64-unknown-linux-gnuabi64
- env: TARGET=mips64el-unknown-linux-gnuabi64
- env: TARGET=mips-unknown-linux-gnu
- env: TARGET=s390x-unknown-linux-gnu
- env: TARGET=sparc64-unknown-linux-gnu
- env: TARGET=asmjs-unknown-emscripten
- env: TARGET=wasm32-unknown-emscripten
# beta
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
rust: beta
- os: osx
env: TARGET=x86_64-apple-darwin NO_ADD=1
osx_image: xcode8.3
rust: beta
# nightly
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
rust: nightly
- os: osx
env: TARGET=x86_64-apple-darwin NO_ADD=1
osx_image: xcode8.3
rust: nightly
# not available on stable
# without --release the build fails
# see https://github.com/rust-lang/rust/issues/45417
- env: TARGET=x86_64-unknown-linux-gnux32 OPT="--release"
rust: nightly
# QEMU based targets that compile in an emulator
- env: TARGET=x86_64-unknown-freebsd
notifications:
email:
on_success: never
webhooks: https://buildbot.rust-lang.org/homu/travis

View File

@ -1,32 +0,0 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g. crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
[package]
name = "libc"
version = "0.2.42"
authors = ["The Rust Project Developers"]
description = "A library for types and bindings to native C functions often found in libc or\nother common platform libraries.\n"
homepage = "https://github.com/rust-lang/libc"
documentation = "http://doc.rust-lang.org/libc"
readme = "README.md"
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-lang/libc"
[features]
default = ["use_std"]
use_std = []
[badges.appveyor]
project_name = "rust-lang-libs/libc"
repository = "rust-lang/libc"
[badges.travis-ci]
repository = "rust-lang/libc"

View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,25 +0,0 @@
Copyright (c) 2014 The Rust Project Developers
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -1,162 +0,0 @@
libc
====
A Rust library with native bindings to the types and functions commonly found on
various systems, including libc.
[![Build Status](https://travis-ci.org/rust-lang/libc.svg?branch=master)](https://travis-ci.org/rust-lang/libc)
[![Build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/libc)
[Documentation](#platforms-and-documentation)
## Usage
First, add the following to your `Cargo.toml`:
```toml
[dependencies]
libc = "0.2"
```
Next, add this to your crate root:
```rust
extern crate libc;
```
Currently libc by default links to the standard library, but if you would
instead like to use libc in a `#![no_std]` situation or crate you can request
this via:
```toml
[dependencies]
libc = { version = "0.2", default-features = false }
```
## What is libc?
The primary purpose of this crate is to provide all of the definitions necessary
to easily interoperate with C code (or "C-like" code) on each of the platforms
that Rust supports. This includes type definitions (e.g. `c_int`), constants
(e.g. `EINVAL`) as well as function headers (e.g. `malloc`).
This crate does not strive to have any form of compatibility across platforms,
but rather it is simply a straight binding to the system libraries on the
platform in question.
## Public API
This crate exports all underlying platform types, functions, and constants under
the crate root, so all items are accessible as `libc::foo`. The types and values
of all the exported APIs match the platform that libc is compiled for.
More detailed information about the design of this library can be found in its
[associated RFC][rfc].
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1291-promote-libc.md
## Adding an API
Want to use an API which currently isn't bound in `libc`? It's quite easy to add
one!
The internal structure of this crate is designed to minimize the number of
`#[cfg]` attributes in order to easily be able to add new items which apply
to all platforms in the future. As a result, the crate is organized
hierarchically based on platform. Each module has a number of `#[cfg]`'d
children, but only one is ever actually compiled. Each module then reexports all
the contents of its children.
This means that for each platform that libc supports, the path from a
leaf module to the root will contain all bindings for the platform in question.
Consequently, this indicates where an API should be added! Adding an API at a
particular level in the hierarchy means that it is supported on all the child
platforms of that level. For example, when adding a Unix API it should be added
to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to
`src/unix/notbsd/linux/mod.rs`.
If you're not 100% sure at what level of the hierarchy an API should be added
at, fear not! This crate has CI support which tests any binding against all
platforms supported, so you'll see failures if an API is added at the wrong
level or has different signatures across platforms.
With that in mind, the steps for adding a new API are:
1. Determine where in the module hierarchy your API should be added.
2. Add the API.
3. Send a PR to this repo.
4. Wait for CI to pass, fixing errors.
5. Wait for a merge!
### Test before you commit
We have two automated tests running on [Travis](https://travis-ci.org/rust-lang/libc):
1. [`libc-test`](https://github.com/alexcrichton/ctest)
- `cd libc-test && cargo test`
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
2. Style checker
- `rustc ci/style.rs && ./style src`
### Releasing your change to crates.io
Now that you've done the amazing job of landing your new API or your new
platform in this crate, the next step is to get that sweet, sweet usage from
crates.io! The only next step is to bump the version of libc and then publish
it. If you'd like to get a release out ASAP you can follow these steps:
1. Update the version number in `Cargo.toml`, you'll just be bumping the patch
version number.
2. Run `cargo update` to regenerate the lockfile to encode your version bump in
the lock file. You may pull in some other updated dependencies, that's ok.
3. Send a PR to this repository. It should [look like this][example], but it'd
also be nice to fill out the description with a small rationale for the
release (any rationale is ok though!)
4. Once merged the release will be tagged and published by one of the libc crate
maintainers.
[example]: https://github.com/rust-lang/libc/pull/583
## Platforms and Documentation
The following platforms are currently tested and have documentation available:
Tested:
* [`i686-pc-windows-msvc`](https://rust-lang.github.io/libc/i686-pc-windows-msvc/libc/)
* [`x86_64-pc-windows-msvc`](https://rust-lang.github.io/libc/x86_64-pc-windows-msvc/libc/)
(Windows)
* [`i686-pc-windows-gnu`](https://rust-lang.github.io/libc/i686-pc-windows-gnu/libc/)
* [`x86_64-pc-windows-gnu`](https://rust-lang.github.io/libc/x86_64-pc-windows-gnu/libc/)
* [`i686-apple-darwin`](https://rust-lang.github.io/libc/i686-apple-darwin/libc/)
* [`x86_64-apple-darwin`](https://rust-lang.github.io/libc/x86_64-apple-darwin/libc/)
(OSX)
* `i386-apple-ios`
* `x86_64-apple-ios`
* [`i686-unknown-linux-gnu`](https://rust-lang.github.io/libc/i686-unknown-linux-gnu/libc/)
* [`x86_64-unknown-linux-gnu`](https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu/libc/)
(Linux)
* [`x86_64-unknown-linux-musl`](https://rust-lang.github.io/libc/x86_64-unknown-linux-musl/libc/)
(Linux MUSL)
* [`aarch64-unknown-linux-gnu`](https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu/libc/)
(Linux)
* `aarch64-unknown-linux-musl`
(Linux MUSL)
* [`sparc64-unknown-linux-gnu`](https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu/libc/)
(Linux)
* [`mips-unknown-linux-gnu`](https://rust-lang.github.io/libc/mips-unknown-linux-gnu/libc/)
* [`arm-unknown-linux-gnueabihf`](https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf/libc/)
* [`arm-linux-androideabi`](https://rust-lang.github.io/libc/arm-linux-androideabi/libc/)
(Android)
* [`x86_64-unknown-freebsd`](https://rust-lang.github.io/libc/x86_64-unknown-freebsd/libc/)
* [`x86_64-unknown-openbsd`](https://rust-lang.github.io/libc/x86_64-unknown-openbsd/libc/)
* [`x86_64-rumprun-netbsd`](https://rust-lang.github.io/libc/x86_64-unknown-netbsd/libc/)
The following may be supported, but are not guaranteed to always work:
* `i686-unknown-freebsd`
* [`x86_64-unknown-bitrig`](https://rust-lang.github.io/libc/x86_64-unknown-bitrig/libc/)
* [`x86_64-unknown-dragonfly`](https://rust-lang.github.io/libc/x86_64-unknown-dragonfly/libc/)
* `i686-unknown-haiku`
* `x86_64-unknown-haiku`
* [`x86_64-unknown-netbsd`](https://rust-lang.github.io/libc/x86_64-unknown-netbsd/libc/)
* [`x86_64-sun-solaris`](https://rust-lang.github.io/libc/x86_64-sun-solaris/libc/)

View File

@ -1,28 +0,0 @@
environment:
# When this was added there were revocation check failures when using the
# libcurl backend as libcurl checks by default, but rustup doesn't provide the
# switch to turn this off. Switch to Hyper which looks to not check for
# revocation by default like libcurl does.
RUSTUP_USE_HYPER: 1
CARGO_HTTP_CHECK_REVOKE: false
matrix:
- TARGET: x86_64-pc-windows-gnu
MSYS2_BITS: 64
- TARGET: i686-pc-windows-gnu
MSYS2_BITS: 32
- TARGET: x86_64-pc-windows-msvc
- TARGET: i686-pc-windows-msvc
install:
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host %TARGET%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
- rustc -V
- cargo -V
build: false
test_script:
- cargo test --target %TARGET%
- cargo test --no-default-features --target %TARGET%
- cargo test --manifest-path libc-test/Cargo.toml --target %TARGET%

View File

@ -1,243 +0,0 @@
The goal of the libc crate is to have CI running everywhere to have the
strongest guarantees about the definitions that this library contains, and as a
result the CI is pretty complicated and also pretty large! Hopefully this can
serve as a guide through the sea of scripts in this directory and elsewhere in
this project.
# Files
First up, let's talk about the files in this directory:
* `run-travis.sh` - a shell script run by all Travis builders, this is
responsible for setting up the rest of the environment such as installing new
packages, downloading Rust target libraries, etc.
* `run.sh` - the actual script which runs tests for a particular architecture.
Called from the `run-travis.sh` script this will run all tests for the target
specified.
* `cargo-config` - Cargo configuration of linkers to use copied into place by
the `run-travis.sh` script before builds are run.
* `dox.sh` - script called from `run-travis.sh` on only the linux 64-bit nightly
Travis bots to build documentation for this crate.
* `landing-page-*.html` - used by `dox.sh` to generate a landing page for all
architectures' documentation.
* `run-qemu.sh` - see discussion about QEMU below
* `mips`, `rumprun` - instructions to build the docker image for each respective
CI target
# CI Systems
Currently this repository leverages a combination of Travis CI and AppVeyor for
running tests. The triples tested are:
* AppVeyor
* `{i686,x86_64}-pc-windows-{msvc,gnu}`
* Travis
* `{i686,x86_64,mips,aarch64}-unknown-linux-gnu`
* `{x86_64,aarch64}-unknown-linux-musl`
* `arm-unknown-linux-gnueabihf`
* `arm-linux-androideabi`
* `{i686,x86_64}-apple-{darwin,ios}`
* `x86_64-rumprun-netbsd`
* `x86_64-unknown-freebsd`
* `x86_64-unknown-openbsd`
The Windows triples are all pretty standard, they just set up their environment
then run tests, no need for downloading any extra target libs (we just download
the right installer). The Intel Linux/OSX builds are similar in that we just
download the right target libs and run tests. Note that the Intel Linux/OSX
builds are run on stable/beta/nightly, but are the only ones that do so.
The remaining architectures look like:
* Android runs in a [docker image][android-docker] with an emulator, the NDK,
and the SDK already set up. The entire build happens within the docker image.
* The MIPS, ARM, and AArch64 builds all use the QEMU userspace emulator to run
the generated binary to actually verify the tests pass.
* The MUSL build just has to download a MUSL compiler and target libraries and
then otherwise runs tests normally.
* iOS builds need an extra linker flag currently, but beyond that they're built
as standard as everything else.
* The rumprun target builds an entire kernel from the test suite and then runs
it inside QEMU using the serial console to test whether it succeeded or
failed.
* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system
and compile/run tests. More information on that below.
[android-docker]: https://github.com/rust-lang/rust-buildbot/blob/master/slaves/android/Dockerfile
## QEMU
Lots of the architectures tested here use QEMU in the tests, so it's worth going
over all the crazy capabilities QEMU has and the various flavors in which we use
it!
First up, QEMU has userspace emulation where it doesn't boot a full kernel, it
just runs a binary from another architecture (using the `qemu-<arch>` wrappers).
We provide it the runtime path for the dynamically loaded system libraries,
however. This strategy is used for all Linux architectures that aren't intel.
Note that one downside of this QEMU system is that threads are barely
implemented, so we're careful to not spawn many threads.
For the rumprun target the only output is a kernel image, so we just use that
plus the `rumpbake` command to create a full kernel image which is then run from
within QEMU.
Finally, the fun part, the BSDs. Quite a few hoops are jumped through to get CI
working for these platforms, but the gist of it looks like:
* Cross compiling from Linux to any of the BSDs seems to be quite non-standard.
We may be able to get it working but it might be difficult at that point to
ensure that the libc definitions align with what you'd get on the BSD itself.
As a result, we try to do compiles within the BSD distro.
* On Travis we can't run a VM-in-a-VM, so we resort to userspace emulation
(QEMU).
* Unfortunately on Travis we also can't use KVM, so the emulation is super slow.
With all that in mind, the way BSD is tested looks like:
1. Download a pre-prepared image for the OS being tested.
2. Generate the tests for the OS being tested. This involves running the `ctest`
library over libc to generate a Rust file and a C file which will then be
compiled into the final test.
3. Generate a disk image which will later be mounted by the OS being tested.
This image is mostly just the libc directory, but some modifications are made
to compile the generated files from step 2.
4. The kernel is booted in QEMU, and it is configured to detect the libc-test
image being available, run the test script, and then shut down afterwards.
5. Look for whether the tests passed in the serial console output of the kernel.
There's some pretty specific instructions for setting up each image (detailed
below), but the main gist of this is that we must avoid a vanilla `cargo run`
inside of the `libc-test` directory (which is what it's intended for) because
that would compile `syntex_syntax`, a large library, with userspace emulation.
This invariably times out on Travis, so we can't do that.
Once all those hoops are jumped through, however, we can be happy that we're
testing almost everything!
Below are some details of how to set up the initial OS images which are
downloaded. Each image must be enabled have input/output over the serial
console, log in automatically at the serial console, detect if a second drive in
QEMU is available, and if so mount it, run a script (it'll specifically be
`run-qemu.sh` in this folder which is copied into the generated image talked
about above), and then shut down.
### QEMU Setup - FreeBSD
1. [Download the latest stable amd64-bootonly release ISO](https://www.freebsd.org/where.html).
E.g. FreeBSD-11.1-RELEASE-amd64-bootonly.iso
2. Create the disk image: `qemu-img create -f qcow2 FreeBSD-11.1-RELEASE-amd64.qcow2 2G`
3. Boot the machine: `qemu-system-x86_64 -cdrom FreeBSD-11.1-RELEASE-amd64-bootonly.iso -drive if=virtio,file=FreeBSD-11.1-RELEASE-amd64.qcow2 -net nic,model=virtio -net user`
4. Run the installer, and install FreeBSD:
1. Install
1. Continue with default keymap
1. Set Hostname: freebsd-ci
1. Distribution Select:
1. Uncheck lib32
1. Uncheck ports
1. Network Configuration: vtnet0
1. Configure IPv4? Yes
1. DHCP? Yes
1. Configure IPv6? No
1. Resolver Configuration: Ok
1. Mirror Selection: Main Site
1. Partitioning: Auto (UFS)
1. Partition: Entire Disk
1. Partition Scheme: MBR
1. App Partition: Ok
1. Partition Editor: Finish
1. Confirmation: Commit
1. Wait for sets to install
1. Set the root password to nothing (press enter twice)
1. Set time zone to UTC
1. Set Date: Skip
1. Set Time: Skip
1. System Configuration:
1. Disable sshd
1. Disable dumpdev
1. System Hardening
1. Disable Sendmail service
1. Add User Accounts: No
1. Final Configuration: Exit
1. Manual Configuration: Yes
1. `echo 'console="comconsole"' >> /boot/loader.conf`
1. `echo 'autoboot_delay="0"' >> /boot/loader.conf`
1. `echo 'ext2fs_load="YES"' >> /boot/loader.conf`
1. Look at `/etc/ttys`, see what getty argument is for `ttyu0` (E.g. `3wire`)
1. Edit `/etc/gettytab` (with `vi` for example), look for `ttyu0` argument,
prepend `:al=root` to the line beneath to have the machine auto-login as
root. E.g.
3wire:\
:np:nc:sp#0:
becomes:
3wire:\
:al=root:np:nc:sp#0:
1. Edit `/root/.login` and put this in it:
[ -e /dev/vtbd1 ] || exit 0
mount -t ext2fs /dev/vtbd1 /mnt
sh /mnt/run.sh /mnt
poweroff
1. Exit the post install shell: `exit`
1. Back in in the installer choose Reboot
1. If all went well the machine should reboot and show a login prompt.
If you switch to the serial console by choosing View > serial0 in
the qemu menu, you should be logged in as root.
1. Shutdown the machine: `shutdown -p now`
Helpful links
* https://en.wikibooks.org/wiki/QEMU/Images
* https://blog.nekoconeko.nl/blog/2015/06/04/creating-an-openstack-freebsd-image.html
* https://www.freebsd.org/doc/handbook/serialconsole-setup.html
### QEMU setup - OpenBSD
1. Download CD installer
2. `qemu-img create -f qcow2 foo.qcow2 2G`
3. `qemu -cdrom foo.iso -drive if=virtio,file=foo.qcow2 -net nic,model=virtio -net user`
4. run installer
5. `echo 'set tty com0' >> /etc/boot.conf`
6. `echo 'boot' >> /etc/boot.conf`
7. Modify /etc/ttys, change the `tty00` at the end from 'unknown off' to
'vt220 on secure'
8. Modify same line in /etc/ttys to have `"/root/foo.sh"` as the shell
9. Add this script to `/root/foo.sh`
```
#!/bin/sh
exec 1>/dev/tty00
exec 2>&1
if mount -t ext2fs /dev/sd1c /mnt; then
sh /mnt/run.sh /mnt
shutdown -ph now
fi
# limited shell...
exec /bin/sh < /dev/tty00
```
10. `chmod +x /root/foo.sh`
Helpful links:
* https://en.wikibooks.org/wiki/QEMU/Images
* http://www.openbsd.org/faq/faq7.html#SerCon
# Questions?
Hopefully that's at least somewhat of an introduction to everything going on
here, and feel free to ping @alexcrichton with questions!

View File

@ -1,37 +0,0 @@
#!/bin/sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
curl -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
unzip -q android-ndk-r15b-linux-x86_64.zip
case "$1" in
aarch64)
arch=arm64
;;
i686)
arch=x86
;;
*)
arch=$1
;;
esac;
android-ndk-r15b/build/tools/make_standalone_toolchain.py \
--unified-headers \
--install-dir /android/ndk-$1 \
--arch $arch \
--api 24
rm -rf ./android-ndk-r15b-linux-x86_64.zip ./android-ndk-r15b

View File

@ -1,60 +0,0 @@
#!/bin/sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
# Prep the SDK and emulator
#
# Note that the update process requires that we accept a bunch of licenses, and
# we can't just pipe `yes` into it for some reason, so we take the same strategy
# located in https://github.com/appunite/docker by just wrapping it in a script
# which apparently magically accepts the licenses.
mkdir sdk
curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O
unzip -d sdk sdk-tools-linux-3859397.zip
case "$1" in
arm | armv7)
abi=armeabi-v7a
;;
aarch64)
abi=arm64-v8a
;;
i686)
abi=x86
;;
x86_64)
abi=x86_64
;;
*)
echo "invalid arch: $1"
exit 1
;;
esac;
# --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
echo "yes" | \
./sdk/tools/bin/sdkmanager --no_https \
"emulator" \
"platform-tools" \
"platforms;android-24" \
"system-images;android-24;default;$abi"
echo "no" |
./sdk/tools/bin/avdmanager create avd \
--name $1 \
--package "system-images;android-24;default;$abi"

View File

@ -1,52 +0,0 @@
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
URL=https://dl.google.com/android/repository/sys-img/android
main() {
local arch=$1
local name=$2
local dest=/system
local td=$(mktemp -d)
apt-get install --no-install-recommends e2tools
pushd $td
curl -O $URL/$name
unzip -q $name
local system=$(find . -name system.img)
mkdir -p $dest/{bin,lib,lib64}
# Extract android linker and libraries to /system
# This allows android executables to be run directly (or with qemu)
if [ $arch = "x86_64" -o $arch = "arm64" ]; then
e2cp -p $system:/bin/linker64 $dest/bin/
e2cp -p $system:/lib64/libdl.so $dest/lib64/
e2cp -p $system:/lib64/libc.so $dest/lib64/
e2cp -p $system:/lib64/libm.so $dest/lib64/
else
e2cp -p $system:/bin/linker $dest/bin/
e2cp -p $system:/lib/libdl.so $dest/lib/
e2cp -p $system:/lib/libc.so $dest/lib/
e2cp -p $system:/lib/libm.so $dest/lib/
fi
# clean up
apt-get purge --auto-remove -y e2tools
popd
rm -rf $td
}
main "${@}"

View File

@ -1,45 +0,0 @@
FROM ubuntu:16.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python \
unzip \
expect \
openjdk-9-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
libc6-dev
WORKDIR /android/
COPY android* /android/
ENV ANDROID_ARCH=aarch64
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]

View File

@ -1,7 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \
PATH=$PATH:/rust/bin

View File

@ -1,27 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-aarch64-linux-gnu qemu-user
RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | \
tar xzf - && \
cd musl-1.1.16 && \
CC=aarch64-linux-gnu-gcc \
./configure --prefix=/musl-aarch64 --enable-wrapper=yes && \
make install -j4 && \
cd .. && \
rm -rf musl-1.1.16 && \
# Install linux kernel headers sanitized for use with musl
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
tar xzf - && \
cd kernel-headers-3.12.6-5 && \
make ARCH=arm64 prefix=/musl-aarch64 install -j4 && \
cd .. && \
rm -rf kernel-headers-3.12.6-5
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
CC_aarch64_unknown_linux_musl=musl-gcc \
RUSTFLAGS='-Clink-args=-lgcc' \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-aarch64 -L /musl-aarch64"

View File

@ -1,45 +0,0 @@
FROM ubuntu:16.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python \
unzip \
expect \
openjdk-9-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
libc6-dev
WORKDIR /android/
COPY android* /android/
ENV ANDROID_ARCH=arm
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]

View File

@ -1,7 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \
PATH=$PATH:/rust/bin

View File

@ -1,25 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-arm-linux-gnueabihf qemu-user
RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | tar xzf -
WORKDIR /musl-1.1.16
RUN CC=arm-linux-gnueabihf-gcc \
CFLAGS="-march=armv6 -marm" \
./configure --prefix=/musl-arm --enable-wrapper=yes
RUN make install -j4
# Install linux kernel headers sanitized for use with musl
RUN \
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
tar xzf - && \
cd kernel-headers-3.12.6-5 && \
make ARCH=arm prefix=/musl-arm install -j4 && \
cd .. && \
rm -rf kernel-headers-3.12.6-5
ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
CC_arm_unknown_linux_musleabihf=musl-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm"

View File

@ -1,20 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
libc6-dev \
python \
xz-utils
COPY emscripten.sh /
RUN bash /emscripten.sh
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node
COPY emscripten-entry.sh /
ENTRYPOINT ["/emscripten-entry.sh"]

View File

@ -1,45 +0,0 @@
FROM ubuntu:16.04
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python \
unzip \
expect \
openjdk-9-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
libc6-dev
WORKDIR /android/
COPY android* /android/
ENV ANDROID_ARCH=i686
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]

View File

@ -1,5 +0,0 @@
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
ENV PATH=$PATH:/rust/bin

View File

@ -1,30 +0,0 @@
FROM ubuntu:17.10
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib make libc6-dev git curl ca-certificates libc6:i386
# Below we're cross-compiling musl for i686 using the system compiler on an
# x86_64 system. This is an awkward thing to be doing and so we have to jump
# through a couple hoops to get musl to be happy. In particular:
#
# * We specifically pass -m32 in CFLAGS and override CC when running ./configure,
# since otherwise the script will fail to find a compiler.
# * We manually unset CROSS_COMPILE when running make; otherwise the makefile
# will call the non-existent binary 'i686-ar'.
RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
tar xzf - && \
cd musl-1.1.15 && \
CC=gcc CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
make CROSS_COMPILE= install -j4 && \
cd .. && \
rm -rf musl-1.1.15 && \
# Install linux kernel headers sanitized for use with musl
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
tar xzf - && \
cd kernel-headers-3.12.6-5 && \
make ARCH=i386 prefix=/musl-i686 install -j4 && \
cd .. && \
rm -rf kernel-headers-3.12.6-5
ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
CC_i686_unknown_linux_musl=musl-gcc

View File

@ -1,10 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-mips-linux-gnu libc6-dev-mips-cross \
qemu-system-mips
ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="qemu-mips -L /usr/mips-linux-gnu" \
PATH=$PATH:/rust/bin

View File

@ -1,17 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
bzip2
RUN mkdir /toolchain
# Note that this originally came from:
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
tar xjf - -C /toolchain --strip-components=1
ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/bin \
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-gcc \
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mips -L /toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15"

View File

@ -1,11 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \
qemu-system-mips64
ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -L /usr/mips64-linux-gnuabi64" \
CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,11 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \
qemu-system-mips64el
ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \
CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,17 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
bzip2
RUN mkdir /toolchain
# Note that this originally came from:
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
tar xjf - -C /toolchain --strip-components=2
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-gcc \
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mipsel -L /toolchain"

View File

@ -1,10 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \
qemu-system-ppc
ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -L /usr/powerpc-linux-gnu" \
PATH=$PATH:/rust/bin

View File

@ -1,11 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
qemu-system-ppc
ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -L /usr/powerpc64-linux-gnu" \
CC=powerpc64-linux-gnu-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,11 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
qemu-system-ppc
ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" \
CC=powerpc64le-linux-gnu-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,18 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
gcc libc6-dev \
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
qemu-system-s390x \
cpio
COPY linux-s390x.sh /
RUN bash /linux-s390x.sh
COPY test-runner-linux /
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,18 +0,0 @@
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
gcc libc6-dev \
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
p7zip-full cpio
COPY linux-sparc64.sh /
RUN bash /linux-sparc64.sh
COPY test-runner-linux /
ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \
CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
PATH=$PATH:/rust/bin

View File

@ -1,21 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
libc6-dev \
python \
xz-utils
COPY emscripten.sh /
RUN bash /emscripten.sh
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node-wrapper.sh
COPY emscripten-entry.sh /
COPY docker/wasm32-unknown-emscripten/node-wrapper.sh /usr/local/bin/node-wrapper.sh
ENTRYPOINT ["/emscripten-entry.sh"]

View File

@ -1,15 +0,0 @@
#!/bin/sh
set -e
me=$1
shift
dir=$(dirname $me)
file=$(basename $me)
if echo $file | grep -q wasm; then
exit 0 # FIXME(rust-lang/cargo#4750)
fi
cd $dir
exec node $file "$@"

View File

@ -1,26 +0,0 @@
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
libc-dev \
python \
unzip
WORKDIR /android/
ENV ANDROID_ARCH=x86_64
COPY android-install-ndk.sh /android/
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
# We do not run x86_64-linux-android tests on an android emulator.
# See ci/android-sysimage.sh for informations about how tests are run.
COPY android-sysimage.sh /android/
RUN bash /android/android-sysimage.sh x86_64 x86_64-24_r07.zip
ENV PATH=$PATH:/rust/bin:/android/ndk-$ANDROID_ARCH/bin \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc \
CC_x86_64_linux_android=x86_64-linux-android-gcc \
CXX_x86_64_linux_android=x86_64-linux-android-g++ \
HOME=/tmp

View File

@ -1,10 +0,0 @@
FROM mato/rumprun-toolchain-hw-x86_64
USER root
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
qemu
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_X86_64_RUMPRUN_NETBSD_RUNNER=/tmp/runtest
ADD docker/x86_64-rumprun-netbsd/runtest.rs /tmp/
ENTRYPOINT ["sh", "-c", "rustc /tmp/runtest.rs -o /tmp/runtest && exec \"$@\"", "--"]

View File

@ -1,54 +0,0 @@
use std::env;
use std::process::{Command, Stdio};
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
use std::io::{BufRead, BufReader, Read};
fn main() {
assert_eq!(env::args().len(), 2);
let status = Command::new("rumprun-bake")
.arg("hw_virtio")
.arg("/tmp/libc-test.img")
.arg(env::args().nth(1).unwrap())
.status()
.expect("failed to run rumprun-bake");
assert!(status.success());
let mut child = Command::new("qemu-system-x86_64")
.arg("-nographic")
.arg("-vga").arg("none")
.arg("-m").arg("64")
.arg("-kernel").arg("/tmp/libc-test.img")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.expect("failed to spawn qemu");
let mut stdout = child.stdout.take().unwrap();
let mut stderr = child.stderr.take().unwrap();
let (tx, rx) = mpsc::channel();
let tx2 = tx.clone();
let t1 = thread::spawn(move || find_ok(&mut stdout, tx));
let t2 = thread::spawn(move || find_ok(&mut stderr, tx2));
let res = rx.recv_timeout(Duration::new(5, 0));
child.kill().unwrap();
t1.join().unwrap();
t2.join().unwrap();
if res.is_err() {
panic!("didn't find success");
}
}
fn find_ok(input: &mut Read, tx: mpsc::Sender<()>) {
for line in BufReader::new(input).lines() {
let line = line.unwrap();
println!("{}", line);
if line.starts_with("PASSED ") && line.contains(" tests") {
tx.send(()).unwrap();
}
}
}

View File

@ -1,13 +0,0 @@
FROM wezm/port-prebuilt-freebsd11@sha256:43553e2265ec702ec72a63a765df333f50b1858b896e69385749e96d8624e9b0
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
qemu genext2fs xz-utils
RUN apt-get install -y curl ca-certificates gcc
ENTRYPOINT ["sh"]
ENV PATH=$PATH:/rust/bin \
QEMU=2018-03-15/FreeBSD-11.1-RELEASE-amd64.qcow2.xz \
CAN_CROSS=1 \
CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd11-gcc

View File

@ -1,5 +0,0 @@
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates
ENV PATH=$PATH:/rust/bin

View File

@ -1,5 +0,0 @@
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
ENV PATH=$PATH:/rust/bin

View File

@ -1,20 +0,0 @@
FROM ubuntu:17.10
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates
RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
tar xzf - && \
cd musl-1.1.15 && \
./configure --prefix=/musl-x86_64 && \
make install -j4 && \
cd .. && \
rm -rf musl-1.1.15 && \
# Install linux kernel headers sanitized for use with musl
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
tar xzf - && \
cd kernel-headers-3.12.6-5 && \
make ARCH=x86_64 prefix=/musl-x86_64 install -j4 && \
cd .. && \
rm -rf kernel-headers-3.12.6-5
ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin

View File

@ -1,33 +0,0 @@
#!/bin/sh
# Builds documentation for all target triples that we have a registered URL for
# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
# which has a bunch of `html_root_url` directives we pick up.
set -e
TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
rm -rf target/doc
mkdir -p target/doc
cp ci/landing-page-head.html target/doc/index.html
for target in $TARGETS; do
echo documenting $target
rustdoc -o target/doc/$target --target $target src/lib.rs --cfg cross_platform_docs \
--crate-name libc
echo "<li><a href="/libc/$target/libc/index.html">$target</a></li>" \
>> target/doc/index.html
done
cat ci/landing-page-footer.html >> target/doc/index.html
# If we're on travis, not a PR, and on the right branch, publish!
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
pip install ghp_import --install-option="--prefix=$HOME/.local"
$HOME/.local/bin/ghp-import -n target/doc
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
fi

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
source /emsdk-portable/emsdk_env.sh &> /dev/null
# emsdk-portable provides a node binary, but we need version 8 to run wasm
export PATH="/node-v8.0.0-linux-x64/bin:$PATH"
exec "$@"

View File

@ -1,54 +0,0 @@
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
hide_output() {
set +x
on_err="
echo ERROR: An error was encountered with the build.
cat /tmp/build.log
exit 1
"
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
$@ &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm -f /tmp/build.log
set -x
}
cd /
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
tar -xz
cd /emsdk-portable
./emsdk update
hide_output ./emsdk install sdk-1.37.20-64bit
./emsdk activate sdk-1.37.20-64bit
# Compile and cache libc
source ./emsdk_env.sh
echo "main(){}" > a.c
HOME=/emsdk-portable/ emcc a.c
HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c
rm -f a.*
# Make emsdk usable by any user
cp /root/.emscripten /emsdk-portable
chmod a+rxw -R /emsdk-portable
# node 8 is required to run wasm
cd /
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
tar -xJ

View File

@ -1,171 +0,0 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This is a script to deploy and execute a binary on an iOS simulator.
// The primary use of this is to be able to run unit tests on the simulator and
// retrieve the results.
//
// To do this through Cargo instead, use Dinghy
// (https://github.com/snipsco/dinghy): cargo dinghy install, then cargo dinghy
// test.
use std::env;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
use std::process;
use std::process::Command;
macro_rules! t {
($e:expr) => (match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with: {}", stringify!($e), e),
})
}
// Step one: Wrap as an app
fn package_as_simulator_app(crate_name: &str, test_binary_path: &Path) {
println!("Packaging simulator app");
drop(fs::remove_dir_all("ios_simulator_app"));
t!(fs::create_dir("ios_simulator_app"));
t!(fs::copy(test_binary_path,
Path::new("ios_simulator_app").join(crate_name)));
let mut f = t!(File::create("ios_simulator_app/Info.plist"));
t!(f.write_all(format!(r#"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC
"-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>{}</string>
<key>CFBundleIdentifier</key>
<string>com.rust.unittests</string>
</dict>
</plist>
"#, crate_name).as_bytes()));
}
// Step two: Start the iOS simulator
fn start_simulator() {
println!("Looking for iOS simulator");
let output = t!(Command::new("xcrun").arg("simctl").arg("list").output());
assert!(output.status.success());
let mut simulator_exists = false;
let mut simulator_booted = false;
let mut found_rust_sim = false;
let stdout = t!(String::from_utf8(output.stdout));
for line in stdout.lines() {
if line.contains("rust_ios") {
if found_rust_sim {
panic!("Duplicate rust_ios simulators found. Please \
double-check xcrun simctl list.");
}
simulator_exists = true;
simulator_booted = line.contains("(Booted)");
found_rust_sim = true;
}
}
if simulator_exists == false {
println!("Creating iOS simulator");
Command::new("xcrun")
.arg("simctl")
.arg("create")
.arg("rust_ios")
.arg("com.apple.CoreSimulator.SimDeviceType.iPhone-SE")
.arg("com.apple.CoreSimulator.SimRuntime.iOS-10-2")
.check_status();
} else if simulator_booted == true {
println!("Shutting down already-booted simulator");
Command::new("xcrun")
.arg("simctl")
.arg("shutdown")
.arg("rust_ios")
.check_status();
}
println!("Starting iOS simulator");
// We can't uninstall the app (if present) as that will hang if the
// simulator isn't completely booted; just erase the simulator instead.
Command::new("xcrun").arg("simctl").arg("erase").arg("rust_ios").check_status();
Command::new("xcrun").arg("simctl").arg("boot").arg("rust_ios").check_status();
}
// Step three: Install the app
fn install_app_to_simulator() {
println!("Installing app to simulator");
Command::new("xcrun")
.arg("simctl")
.arg("install")
.arg("booted")
.arg("ios_simulator_app/")
.check_status();
}
// Step four: Run the app
fn run_app_on_simulator() {
println!("Running app");
let output = t!(Command::new("xcrun")
.arg("simctl")
.arg("launch")
.arg("--console")
.arg("booted")
.arg("com.rust.unittests")
.output());
println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout));
println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr));
let stdout = String::from_utf8_lossy(&output.stdout);
let passed = stdout.lines()
.find(|l| l.contains("PASSED"))
.map(|l| l.contains("tests"))
.unwrap_or(false);
println!("Shutting down simulator");
Command::new("xcrun")
.arg("simctl")
.arg("shutdown")
.arg("rust_ios")
.check_status();
if !passed {
panic!("tests didn't pass");
}
}
trait CheckStatus {
fn check_status(&mut self);
}
impl CheckStatus for Command {
fn check_status(&mut self) {
println!("\trunning: {:?}", self);
assert!(t!(self.status()).success());
}
}
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
println!("Usage: {} <executable>", args[0]);
process::exit(-1);
}
let test_binary_path = Path::new(&args[1]);
let crate_name = test_binary_path.file_name().unwrap();
package_as_simulator_app(crate_name.to_str().unwrap(), test_binary_path);
start_simulator();
install_app_to_simulator();
run_app_on_simulator();
}

View File

@ -1,3 +0,0 @@
</ul>
</body>
</html>

View File

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<ul>

View File

@ -1,18 +0,0 @@
set -ex
mkdir -m 777 /qemu
cd /qemu
curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
mv kernel.debian kernel
mv initrd.debian initrd.gz
mkdir init
cd init
gunzip -c ../initrd.gz | cpio -id
rm ../initrd.gz
cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
chmod a+w .

View File

@ -1,17 +0,0 @@
set -ex
mkdir -m 777 /qemu
cd /qemu
curl -LO https://cdimage.debian.org/cdimage/ports/9.0/sparc64/iso-cd/debian-9.0-sparc64-NETINST-1.iso
7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
mv sparc64 kernel
rm debian-9.0-sparc64-NETINST-1.iso
mkdir init
cd init
gunzip -c ../initrd.gz | cpio -id
rm ../initrd.gz
cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/
chmod a+w .

View File

@ -1,36 +0,0 @@
# Small script to run tests for a target (or all targets) inside all the
# respective docker images.
set -ex
run() {
echo $1
# use -f so we can use ci/ as build context
docker build -t libc -f ci/docker/$1/Dockerfile ci/
mkdir -p target
if [ -w /dev/kvm ]; then
kvm="--volume /dev/kvm:/dev/kvm"
fi
docker run \
--user `id -u`:`id -g` \
--rm \
--init \
--volume $HOME/.cargo:/cargo \
$kvm \
--env CARGO_HOME=/cargo \
--volume `rustc --print sysroot`:/rust:ro \
--volume `pwd`:/checkout:ro \
--volume `pwd`/target:/checkout/target \
--env CARGO_TARGET_DIR=/checkout/target \
--workdir /checkout \
libc \
ci/run.sh $1
}
if [ -z "$1" ]; then
for d in `ls ci/docker/`; do
run $d
done
else
run $1
fi

View File

@ -1,32 +0,0 @@
# Initial script which is run inside of all qemu images. The first argument to
# this script (as arranged by the qemu image itself) is the path to where the
# libc crate is mounted.
#
# For qemu images we currently need to install Rust manually as this wasn't done
# by the initial run-travis.sh script
#
# FIXME: feels like run-travis.sh should be responsible for downloading the
# compiler.
set -ex
ROOT=$1
cp -r $ROOT/libc /tmp/libc
cd /tmp/libc
TARGET=$(cat $ROOT/TARGET)
export CARGO_TARGET_DIR=/tmp
case $TARGET in
*-openbsd)
pkg_add cargo gcc%4.9 rust
export CC=egcc
;;
*)
echo "Unknown target: $TARGET"
exit 1
;;
esac
exec sh ci/run.sh $TARGET

View File

@ -1,90 +0,0 @@
#!/bin/sh
# Builds and runs tests for a particular target passed as an argument to this
# script.
set -ex
TARGET=$1
# If we're going to run tests inside of a qemu image, then we don't need any of
# the scripts below. Instead, download the image, prepare a filesystem which has
# the current state of this repository, and then run the image.
#
# It's assume that all images, when run with two disks, will run the `run.sh`
# script from the second which we place inside.
if [ "$QEMU" != "" ]; then
tmpdir=/tmp/qemu-img-creation
mkdir -p $tmpdir
if [ -z "${QEMU#*.gz}" ]; then
# image is .gz : download and uncompress it
qemufile=$(echo ${QEMU%.gz} | sed 's/\//__/g')
if [ ! -f $tmpdir/$qemufile ]; then
curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU | \
gunzip -d > $tmpdir/$qemufile
fi
elif [ -z "${QEMU#*.xz}" ]; then
# image is .xz : download and uncompress it
qemufile=$(echo ${QEMU%.xz} | sed 's/\//__/g')
if [ ! -f $tmpdir/$qemufile ]; then
curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU | \
unxz > $tmpdir/$qemufile
fi
else
# plain qcow2 image: just download it
qemufile=$(echo ${QEMU} | sed 's/\//__/g')
if [ ! -f $tmpdir/$qemufile ]; then
curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU \
> $tmpdir/$qemufile
fi
fi
# Create a mount a fresh new filesystem image that we'll later pass to QEMU.
# This will have a `run.sh` script will which use the artifacts inside to run
# on the host.
rm -f $tmpdir/libc-test.img
mkdir $tmpdir/mount
# Do the standard rigamarole of cross-compiling an executable and then the
# script to run just executes the binary.
cargo build \
--manifest-path libc-test/Cargo.toml \
--target $TARGET \
--test main
rm $CARGO_TARGET_DIR/$TARGET/debug/main-*.d
cp $CARGO_TARGET_DIR/$TARGET/debug/main-* $tmpdir/mount/libc-test
echo 'exec $1/libc-test' > $tmpdir/mount/run.sh
du -sh $tmpdir/mount
genext2fs \
--root $tmpdir/mount \
--size-in-blocks 100000 \
$tmpdir/libc-test.img
# Pass -snapshot to prevent tampering with the disk images, this helps when
# running this script in development. The two drives are then passed next,
# first is the OS and second is the one we just made. Next the network is
# configured to work (I'm not entirely sure how), and then finally we turn off
# graphics and redirect the serial console output to out.log.
qemu-system-x86_64 \
-m 1024 \
-snapshot \
-drive if=virtio,file=$tmpdir/$qemufile \
-drive if=virtio,file=$tmpdir/libc-test.img \
-net nic,model=virtio \
-net user \
-nographic \
-vga none 2>&1 | tee $CARGO_TARGET_DIR/out.log
exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
fi
# FIXME: x86_64-unknown-linux-gnux32 fail to compile wihout --release
# See https://github.com/rust-lang/rust/issues/45417
opt=
if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
opt="--release"
fi
cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET
exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET

View File

@ -1,41 +0,0 @@
use std::env;
use std::process::Command;
use std::path::{Path, PathBuf};
fn main() {
assert_eq!(env::args_os().len(), 2);
let test = PathBuf::from(env::args_os().nth(1).unwrap());
let dst = Path::new("/data/local/tmp").join(test.file_name().unwrap());
let status = Command::new("adb")
.arg("wait-for-device")
.status()
.expect("failed to run rumprun-bake");
assert!(status.success());
let status = Command::new("adb")
.arg("push")
.arg(&test)
.arg(&dst)
.status()
.expect("failed to run rumprun-bake");
assert!(status.success());
let output = Command::new("adb")
.arg("shell")
.arg(&dst)
.output()
.expect("failed to run rumprun-bake");
assert!(status.success());
println!("status: {}\nstdout ---\n{}\nstderr ---\n{}",
output.status,
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr));
let stdout = String::from_utf8_lossy(&output.stdout);
let mut lines = stdout.lines().filter(|l| l.starts_with("PASSED "));
if !lines.any(|l| l.contains(" tests")) {
panic!("failed to find successful test run");
}
}

View File

@ -1,206 +0,0 @@
//! Simple script to verify the coding style of this library
//!
//! ## How to run
//!
//! The first argument to this script is the directory to run on, so running
//! this script should be as simple as:
//!
//! ```notrust
//! rustc ci/style.rs
//! ./style src
//! ```
//!
//! ## Guidelines
//!
//! The current style is:
//!
//! * No trailing whitespace
//! * No tabs
//! * 80-character lines
//! * `extern` instead of `extern "C"`
//! * Specific module layout:
//! 1. use directives
//! 2. typedefs
//! 3. structs
//! 4. constants
//! 5. f! { ... } functions
//! 6. extern functions
//! 7. modules + pub use
//!
//! Things not verified:
//!
//! * alignment
//! * 4-space tabs
//! * leading colons on paths
use std::env;
use std::fs;
use std::io::prelude::*;
use std::path::Path;
macro_rules! t {
($e:expr) => (match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with {}", stringify!($e), e),
})
}
fn main() {
let arg = env::args().skip(1).next().unwrap_or(".".to_string());
let mut errors = Errors { errs: false };
walk(Path::new(&arg), &mut errors);
if errors.errs {
panic!("found some lint errors");
} else {
println!("good style!");
}
}
fn walk(path: &Path, err: &mut Errors) {
for entry in t!(path.read_dir()).map(|e| t!(e)) {
let path = entry.path();
if t!(entry.file_type()).is_dir() {
walk(&path, err);
continue
}
let name = entry.file_name().into_string().unwrap();
match &name[..] {
n if !n.ends_with(".rs") => continue,
"dox.rs" |
"lib.rs" |
"macros.rs" => continue,
_ => {}
}
let mut contents = String::new();
t!(t!(fs::File::open(&path)).read_to_string(&mut contents));
check_style(&contents, &path, err);
}
}
struct Errors {
errs: bool,
}
#[derive(Clone, Copy, PartialEq)]
enum State {
Start,
Imports,
Typedefs,
Structs,
Constants,
FunctionDefinitions,
Functions,
Modules,
}
fn check_style(file: &str, path: &Path, err: &mut Errors) {
let mut state = State::Start;
let mut s_macros = 0;
let mut f_macros = 0;
let mut prev_blank = false;
for (i, line) in file.lines().enumerate() {
if line == "" {
if prev_blank {
err.error(path, i, "double blank line");
}
prev_blank = true;
} else {
prev_blank = false;
}
if line != line.trim_right() {
err.error(path, i, "trailing whitespace");
}
if line.contains("\t") {
err.error(path, i, "tab character");
}
if line.len() > 80 {
err.error(path, i, "line longer than 80 chars");
}
if line.contains("extern \"C\"") {
err.error(path, i, "use `extern` instead of `extern \"C\"");
}
if line.contains("#[cfg(") && !line.contains(" if ")
&& !line.contains("target_endian")
{
if state != State::Structs {
err.error(path, i, "use cfg_if! and submodules \
instead of #[cfg]");
}
}
let line = line.trim_left();
let is_pub = line.starts_with("pub ");
let line = if is_pub {&line[4..]} else {line};
let line_state = if line.starts_with("use ") {
if is_pub {
State::Modules
} else {
State::Imports
}
} else if line.starts_with("const ") {
State::Constants
} else if line.starts_with("type ") {
State::Typedefs
} else if line.starts_with("s! {") {
s_macros += 1;
State::Structs
} else if line.starts_with("f! {") {
f_macros += 1;
State::FunctionDefinitions
} else if line.starts_with("extern ") {
State::Functions
} else if line.starts_with("mod ") {
State::Modules
} else {
continue
};
if state as usize > line_state as usize {
err.error(path, i, &format!("{} found after {} when \
it belongs before",
line_state.desc(), state.desc()));
}
if f_macros == 2 {
f_macros += 1;
err.error(path, i, "multiple f! macros in one module");
}
if s_macros == 2 {
s_macros += 1;
err.error(path, i, "multiple s! macros in one module");
}
state = line_state;
}
}
impl State {
fn desc(&self) -> &str {
match *self {
State::Start => "start",
State::Imports => "import",
State::Typedefs => "typedef",
State::Structs => "struct",
State::Constants => "constant",
State::FunctionDefinitions => "function definition",
State::Functions => "extern function",
State::Modules => "module",
}
}
}
impl Errors {
fn error(&mut self, path: &Path, line: usize, msg: &str) {
self.errs = true;
println!("{}:{} - {}", path.display(), line + 1, msg);
}
}

View File

@ -1,23 +0,0 @@
#!/bin/sh
set -e
arch=$1
prog=$2
cd /qemu/init
cp -f $2 prog
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd ..
timeout 30s qemu-system-$arch \
-m 1024 \
-nographic \
-kernel kernel \
-initrd initrd.gz \
-append init=/prog > output || true
# remove kernel messages
tr -d '\r' < output | egrep -v '^\['
grep PASSED output > /dev/null

View File

@ -1,4 +0,0 @@
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = u32;

View File

@ -1,4 +0,0 @@
pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = u32;

View File

@ -1,166 +0,0 @@
pub type in_addr_t = u32;
pub type in_port_t = u16;
pub type pthread_key_t = usize;
pub type pthread_t = usize;
pub type sa_family_t = u8;
pub type socklen_t = usize;
pub type time_t = i64;
s! {
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::socklen_t,
pub ai_addr: *mut ::sockaddr,
pub ai_canonname: *mut ::c_char,
pub ai_next: *mut addrinfo,
}
pub struct in_addr {
pub s_addr: in_addr_t,
}
pub struct in6_addr {
pub s6_addr: [u8; 16],
}
pub struct pthread_attr_t {
__detachstate: ::c_int,
__stacksize: usize,
}
pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 0],
}
pub struct sockaddr_in {
pub sin_family: ::sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
}
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: ::in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: u32,
}
pub struct sockaddr_storage {
pub ss_family: ::sa_family_t,
__ss_data: [u8; 32],
}
}
pub const _SC_NPROCESSORS_ONLN: ::c_int = 52;
pub const _SC_PAGESIZE: ::c_int = 54;
pub const AF_INET: ::c_int = 1;
pub const AF_INET6: ::c_int = 2;
pub const EACCES: ::c_int = 2;
pub const EADDRINUSE: ::c_int = 3;
pub const EADDRNOTAVAIL: ::c_int = 4;
pub const EAGAIN: ::c_int = 6;
pub const ECONNABORTED: ::c_int = 13;
pub const ECONNREFUSED: ::c_int = 14;
pub const ECONNRESET: ::c_int = 15;
pub const EEXIST: ::c_int = 20;
pub const EINTR: ::c_int = 27;
pub const EINVAL: ::c_int = 28;
pub const ENOENT: ::c_int = 44;
pub const ENOTCONN: ::c_int = 53;
pub const EPERM: ::c_int = 63;
pub const EPIPE: ::c_int = 64;
pub const ETIMEDOUT: ::c_int = 73;
pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const EAI_SYSTEM: ::c_int = 9;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const PTHREAD_STACK_MIN: ::size_t = 1024;
pub const SOCK_DGRAM: ::c_int = 128;
pub const SOCK_STREAM: ::c_int = 130;
extern {
pub fn arc4random_buf(buf: *const ::c_void, len: ::size_t);
pub fn freeaddrinfo(res: *mut addrinfo);
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
pub fn getaddrinfo(
node: *const c_char,
service: *const c_char,
hints: *const addrinfo,
res: *mut *mut addrinfo,
) -> ::c_int;
pub fn getsockopt(
sockfd: ::c_int,
level: ::c_int,
optname: ::c_int,
optval: *mut ::c_void,
optlen: *mut ::socklen_t,
) -> ::c_int;
pub fn posix_memalign(
memptr: *mut *mut ::c_void,
align: ::size_t,
size: ::size_t,
) -> ::c_int;
pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_setstacksize(
attr: *mut ::pthread_attr_t,
stack_size: ::size_t,
) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
pub fn pthread_join(
native: ::pthread_t,
value: *mut *mut ::c_void,
) -> ::c_int;
pub fn pthread_key_create(
key: *mut pthread_key_t,
dtor: Option<unsafe extern fn(*mut ::c_void)>,
) -> ::c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
pub fn pthread_setspecific(
key: pthread_key_t,
value: *const ::c_void,
) -> ::c_int;
pub fn send(
socket: ::c_int,
buf: *const ::c_void,
len: ::size_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn sysconf(name: ::c_int) -> ::c_long;
}
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(any(target_arch = "arm"))] {
mod arm;
pub use self::arm::*;
} else if #[cfg(any(target_arch = "x86"))] {
mod x86;
pub use self::x86::*;
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
} else {
// Unknown target_arch
}
}

View File

@ -1,4 +0,0 @@
pub type c_char = i8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = i32;

View File

@ -1,4 +0,0 @@
pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i32;

View File

@ -1,209 +0,0 @@
pub use self::imp::*;
#[cfg(not(cross_platform_docs))]
mod imp {
pub use core::option::Option;
pub use core::clone::Clone;
pub use core::marker::Copy;
pub use core::mem;
}
#[cfg(cross_platform_docs)]
mod imp {
pub enum Option<T> {
Some(T),
None,
}
impl<T: Copy> Copy for Option<T> {}
impl<T: Clone> Clone for Option<T> {
fn clone(&self) -> Option<T> { loop {} }
}
impl<T> Copy for *mut T {}
impl<T> Clone for *mut T {
fn clone(&self) -> *mut T { loop {} }
}
impl<T> Copy for *const T {}
impl<T> Clone for *const T {
fn clone(&self) -> *const T { loop {} }
}
pub trait Clone {
fn clone(&self) -> Self;
}
#[lang = "copy"]
pub trait Copy {}
#[lang = "freeze"]
pub trait Freeze {}
#[lang = "sync"]
pub trait Sync {}
impl<T> Sync for T {}
#[lang = "sized"]
pub trait Sized {}
macro_rules! each_int {
($mac:ident) => (
$mac!(u8);
$mac!(u16);
$mac!(u32);
$mac!(u64);
$mac!(usize);
each_signed_int!($mac);
)
}
macro_rules! each_signed_int {
($mac:ident) => (
$mac!(i8);
$mac!(i16);
$mac!(i32);
$mac!(i64);
$mac!(isize);
)
}
#[lang = "div"]
pub trait Div<RHS=Self> {
type Output;
fn div(self, rhs: RHS) -> Self::Output;
}
#[lang = "shl"]
pub trait Shl<RHS=Self> {
type Output;
fn shl(self, rhs: RHS) -> Self::Output;
}
#[lang = "mul"]
pub trait Mul<RHS=Self> {
type Output;
fn mul(self, rhs: RHS) -> Self::Output;
}
#[lang = "sub"]
pub trait Sub<RHS=Self> {
type Output;
fn sub(self, rhs: RHS) -> Self::Output;
}
#[lang = "bitand"]
pub trait BitAnd<RHS=Self> {
type Output;
fn bitand(self, rhs: RHS) -> Self::Output;
}
#[lang = "bitand_assign"]
pub trait BitAndAssign<RHS = Self> {
fn bitand_assign(&mut self, rhs: RHS);
}
#[lang = "bitor"]
pub trait BitOr<RHS=Self> {
type Output;
fn bitor(self, rhs: RHS) -> Self::Output;
}
#[lang = "bitor_assign"]
pub trait BitOrAssign<RHS = Self> {
fn bitor_assign(&mut self, rhs: RHS);
}
#[lang = "bitxor"]
pub trait BitXor<RHS=Self> {
type Output;
fn bitxor(self, rhs: RHS) -> Self::Output;
}
#[lang = "bitxor_assign"]
pub trait BitXorAssign<RHS = Self> {
fn bitxor_assign(&mut self, rhs: RHS);
}
#[lang = "neg"]
pub trait Neg {
type Output;
fn neg(self) -> Self::Output;
}
#[lang = "not"]
pub trait Not {
type Output;
fn not(self) -> Self::Output;
}
#[lang = "add"]
pub trait Add<RHS = Self> {
type Output;
fn add(self, r: RHS) -> Self::Output;
}
macro_rules! impl_traits {
($($i:ident)*) => ($(
impl Div<$i> for $i {
type Output = $i;
fn div(self, rhs: $i) -> $i { self / rhs }
}
impl Shl<$i> for $i {
type Output = $i;
fn shl(self, rhs: $i) -> $i { self << rhs }
}
impl Mul for $i {
type Output = $i;
fn mul(self, rhs: $i) -> $i { self * rhs }
}
impl Sub for $i {
type Output = $i;
fn sub(self, rhs: $i) -> $i { self - rhs }
}
impl BitAnd for $i {
type Output = $i;
fn bitand(self, rhs: $i) -> $i { self & rhs }
}
impl BitAndAssign for $i {
fn bitand_assign(&mut self, rhs: $i) { *self &= rhs; }
}
impl BitOr for $i {
type Output = $i;
fn bitor(self, rhs: $i) -> $i { self | rhs }
}
impl BitOrAssign for $i {
fn bitor_assign(&mut self, rhs: $i) { *self |= rhs; }
}
impl BitXor for $i {
type Output = $i;
fn bitxor(self, rhs: $i) -> $i { self ^ rhs }
}
impl BitXorAssign for $i {
fn bitxor_assign(&mut self, rhs: $i) { *self ^= rhs; }
}
impl Neg for $i {
type Output = $i;
fn neg(self) -> $i { -self }
}
impl Not for $i {
type Output = $i;
fn not(self) -> $i { !self }
}
impl Add<$i> for $i {
type Output = $i;
fn add(self, other: $i) -> $i { self + other }
}
impl Copy for $i {}
impl Clone for $i {
fn clone(&self) -> $i { loop {} }
}
)*)
}
each_int!(impl_traits);
pub mod mem {
pub fn size_of_val<T>(_: &T) -> usize { 4 }
pub const fn size_of<T>() -> usize { 4 }
}
}

View File

@ -1,336 +0,0 @@
pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
pub type wchar_t = u32;
pub type nlink_t = u32;
pub type blksize_t = ::c_int;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad0: ::c_ulong,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
__pad1: ::c_int,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_uint; 2],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad0: ::c_ulong,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
__pad1: ::c_int,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_uint; 2],
}
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong,
}
}
pub const MINSIGSTKSZ: ::size_t = 6144;
pub const SIGSTKSZ: ::size_t = 12288;
#[doc(hidden)]
pub const PF_MAX: ::c_int = 43;
#[doc(hidden)]
pub const AF_MAX: ::c_int = PF_MAX;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
pub const SYS_io_cancel: ::c_long = 3;
pub const SYS_io_getevents: ::c_long = 4;
pub const SYS_setxattr: ::c_long = 5;
pub const SYS_lsetxattr: ::c_long = 6;
pub const SYS_fsetxattr: ::c_long = 7;
pub const SYS_getxattr: ::c_long = 8;
pub const SYS_lgetxattr: ::c_long = 9;
pub const SYS_fgetxattr: ::c_long = 10;
pub const SYS_listxattr: ::c_long = 11;
pub const SYS_llistxattr: ::c_long = 12;
pub const SYS_flistxattr: ::c_long = 13;
pub const SYS_removexattr: ::c_long = 14;
pub const SYS_lremovexattr: ::c_long = 15;
pub const SYS_fremovexattr: ::c_long = 16;
pub const SYS_getcwd: ::c_long = 17;
pub const SYS_lookup_dcookie: ::c_long = 18;
pub const SYS_eventfd2: ::c_long = 19;
pub const SYS_epoll_create1: ::c_long = 20;
pub const SYS_epoll_ctl: ::c_long = 21;
pub const SYS_epoll_pwait: ::c_long = 22;
pub const SYS_dup: ::c_long = 23;
pub const SYS_dup3: ::c_long = 24;
pub const SYS_inotify_init1: ::c_long = 26;
pub const SYS_inotify_add_watch: ::c_long = 27;
pub const SYS_inotify_rm_watch: ::c_long = 28;
pub const SYS_ioctl: ::c_long = 29;
pub const SYS_ioprio_set: ::c_long = 30;
pub const SYS_ioprio_get: ::c_long = 31;
pub const SYS_flock: ::c_long = 32;
pub const SYS_mknodat: ::c_long = 33;
pub const SYS_mkdirat: ::c_long = 34;
pub const SYS_unlinkat: ::c_long = 35;
pub const SYS_symlinkat: ::c_long = 36;
pub const SYS_linkat: ::c_long = 37;
pub const SYS_renameat: ::c_long = 38;
pub const SYS_umount2: ::c_long = 39;
pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
pub const SYS_nfsservctl: ::c_long = 42;
pub const SYS_fallocate: ::c_long = 47;
pub const SYS_faccessat: ::c_long = 48;
pub const SYS_chdir: ::c_long = 49;
pub const SYS_fchdir: ::c_long = 50;
pub const SYS_chroot: ::c_long = 51;
pub const SYS_fchmod: ::c_long = 52;
pub const SYS_fchmodat: ::c_long = 53;
pub const SYS_fchownat: ::c_long = 54;
pub const SYS_fchown: ::c_long = 55;
pub const SYS_openat: ::c_long = 56;
pub const SYS_close: ::c_long = 57;
pub const SYS_vhangup: ::c_long = 58;
pub const SYS_pipe2: ::c_long = 59;
pub const SYS_quotactl: ::c_long = 60;
pub const SYS_getdents64: ::c_long = 61;
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_readv: ::c_long = 65;
pub const SYS_writev: ::c_long = 66;
pub const SYS_pread64: ::c_long = 67;
pub const SYS_pwrite64: ::c_long = 68;
pub const SYS_preadv: ::c_long = 69;
pub const SYS_pwritev: ::c_long = 70;
pub const SYS_pselect6: ::c_long = 72;
pub const SYS_ppoll: ::c_long = 73;
pub const SYS_signalfd4: ::c_long = 74;
pub const SYS_vmsplice: ::c_long = 75;
pub const SYS_splice: ::c_long = 76;
pub const SYS_tee: ::c_long = 77;
pub const SYS_readlinkat: ::c_long = 78;
pub const SYS_sync: ::c_long = 81;
pub const SYS_fsync: ::c_long = 82;
pub const SYS_fdatasync: ::c_long = 83;
pub const SYS_sync_file_range: ::c_long = 84;
pub const SYS_timerfd_create: ::c_long = 85;
pub const SYS_timerfd_settime: ::c_long = 86;
pub const SYS_timerfd_gettime: ::c_long = 87;
pub const SYS_utimensat: ::c_long = 88;
pub const SYS_acct: ::c_long = 89;
pub const SYS_capget: ::c_long = 90;
pub const SYS_capset: ::c_long = 91;
pub const SYS_personality: ::c_long = 92;
pub const SYS_exit: ::c_long = 93;
pub const SYS_exit_group: ::c_long = 94;
pub const SYS_waitid: ::c_long = 95;
pub const SYS_set_tid_address: ::c_long = 96;
pub const SYS_unshare: ::c_long = 97;
pub const SYS_futex: ::c_long = 98;
pub const SYS_set_robust_list: ::c_long = 99;
pub const SYS_get_robust_list: ::c_long = 100;
pub const SYS_nanosleep: ::c_long = 101;
pub const SYS_getitimer: ::c_long = 102;
pub const SYS_setitimer: ::c_long = 103;
pub const SYS_kexec_load: ::c_long = 104;
pub const SYS_init_module: ::c_long = 105;
pub const SYS_delete_module: ::c_long = 106;
pub const SYS_timer_create: ::c_long = 107;
pub const SYS_timer_gettime: ::c_long = 108;
pub const SYS_timer_getoverrun: ::c_long = 109;
pub const SYS_timer_settime: ::c_long = 110;
pub const SYS_timer_delete: ::c_long = 111;
pub const SYS_clock_settime: ::c_long = 112;
pub const SYS_clock_gettime: ::c_long = 113;
pub const SYS_clock_getres: ::c_long = 114;
pub const SYS_clock_nanosleep: ::c_long = 115;
pub const SYS_syslog: ::c_long = 116;
pub const SYS_ptrace: ::c_long = 117;
pub const SYS_sched_setparam: ::c_long = 118;
pub const SYS_sched_setscheduler: ::c_long = 119;
pub const SYS_sched_getscheduler: ::c_long = 120;
pub const SYS_sched_getparam: ::c_long = 121;
pub const SYS_sched_setaffinity: ::c_long = 122;
pub const SYS_sched_getaffinity: ::c_long = 123;
pub const SYS_sched_yield: ::c_long = 124;
pub const SYS_sched_get_priority_max: ::c_long = 125;
pub const SYS_sched_get_priority_min: ::c_long = 126;
pub const SYS_sched_rr_get_interval: ::c_long = 127;
pub const SYS_restart_syscall: ::c_long = 128;
pub const SYS_kill: ::c_long = 129;
pub const SYS_tkill: ::c_long = 130;
pub const SYS_tgkill: ::c_long = 131;
pub const SYS_sigaltstack: ::c_long = 132;
pub const SYS_rt_sigsuspend: ::c_long = 133;
pub const SYS_rt_sigaction: ::c_long = 134;
pub const SYS_rt_sigprocmask: ::c_long = 135;
pub const SYS_rt_sigpending: ::c_long = 136;
pub const SYS_rt_sigtimedwait: ::c_long = 137;
pub const SYS_rt_sigqueueinfo: ::c_long = 138;
pub const SYS_rt_sigreturn: ::c_long = 139;
pub const SYS_setpriority: ::c_long = 140;
pub const SYS_getpriority: ::c_long = 141;
pub const SYS_reboot: ::c_long = 142;
pub const SYS_setregid: ::c_long = 143;
pub const SYS_setgid: ::c_long = 144;
pub const SYS_setreuid: ::c_long = 145;
pub const SYS_setuid: ::c_long = 146;
pub const SYS_setresuid: ::c_long = 147;
pub const SYS_getresuid: ::c_long = 148;
pub const SYS_setresgid: ::c_long = 149;
pub const SYS_getresgid: ::c_long = 150;
pub const SYS_setfsuid: ::c_long = 151;
pub const SYS_setfsgid: ::c_long = 152;
pub const SYS_times: ::c_long = 153;
pub const SYS_setpgid: ::c_long = 154;
pub const SYS_getpgid: ::c_long = 155;
pub const SYS_getsid: ::c_long = 156;
pub const SYS_setsid: ::c_long = 157;
pub const SYS_getgroups: ::c_long = 158;
pub const SYS_setgroups: ::c_long = 159;
pub const SYS_uname: ::c_long = 160;
pub const SYS_sethostname: ::c_long = 161;
pub const SYS_setdomainname: ::c_long = 162;
pub const SYS_getrlimit: ::c_long = 163;
pub const SYS_setrlimit: ::c_long = 164;
pub const SYS_getrusage: ::c_long = 165;
pub const SYS_umask: ::c_long = 166;
pub const SYS_prctl: ::c_long = 167;
pub const SYS_getcpu: ::c_long = 168;
pub const SYS_gettimeofday: ::c_long = 169;
pub const SYS_settimeofday: ::c_long = 170;
pub const SYS_adjtimex: ::c_long = 171;
pub const SYS_getpid: ::c_long = 172;
pub const SYS_getppid: ::c_long = 173;
pub const SYS_getuid: ::c_long = 174;
pub const SYS_geteuid: ::c_long = 175;
pub const SYS_getgid: ::c_long = 176;
pub const SYS_getegid: ::c_long = 177;
pub const SYS_gettid: ::c_long = 178;
pub const SYS_sysinfo: ::c_long = 179;
pub const SYS_mq_open: ::c_long = 180;
pub const SYS_mq_unlink: ::c_long = 181;
pub const SYS_mq_timedsend: ::c_long = 182;
pub const SYS_mq_timedreceive: ::c_long = 183;
pub const SYS_mq_notify: ::c_long = 184;
pub const SYS_mq_getsetattr: ::c_long = 185;
pub const SYS_msgget: ::c_long = 186;
pub const SYS_msgctl: ::c_long = 187;
pub const SYS_msgrcv: ::c_long = 188;
pub const SYS_msgsnd: ::c_long = 189;
pub const SYS_semget: ::c_long = 190;
pub const SYS_semctl: ::c_long = 191;
pub const SYS_semtimedop: ::c_long = 192;
pub const SYS_semop: ::c_long = 193;
pub const SYS_shmget: ::c_long = 194;
pub const SYS_shmctl: ::c_long = 195;
pub const SYS_shmat: ::c_long = 196;
pub const SYS_shmdt: ::c_long = 197;
pub const SYS_socket: ::c_long = 198;
pub const SYS_socketpair: ::c_long = 199;
pub const SYS_bind: ::c_long = 200;
pub const SYS_listen: ::c_long = 201;
pub const SYS_accept: ::c_long = 202;
pub const SYS_connect: ::c_long = 203;
pub const SYS_getsockname: ::c_long = 204;
pub const SYS_getpeername: ::c_long = 205;
pub const SYS_sendto: ::c_long = 206;
pub const SYS_recvfrom: ::c_long = 207;
pub const SYS_setsockopt: ::c_long = 208;
pub const SYS_getsockopt: ::c_long = 209;
pub const SYS_shutdown: ::c_long = 210;
pub const SYS_sendmsg: ::c_long = 211;
pub const SYS_recvmsg: ::c_long = 212;
pub const SYS_readahead: ::c_long = 213;
pub const SYS_brk: ::c_long = 214;
pub const SYS_munmap: ::c_long = 215;
pub const SYS_mremap: ::c_long = 216;
pub const SYS_add_key: ::c_long = 217;
pub const SYS_request_key: ::c_long = 218;
pub const SYS_keyctl: ::c_long = 219;
pub const SYS_clone: ::c_long = 220;
pub const SYS_execve: ::c_long = 221;
pub const SYS_swapon: ::c_long = 224;
pub const SYS_swapoff: ::c_long = 225;
pub const SYS_mprotect: ::c_long = 226;
pub const SYS_msync: ::c_long = 227;
pub const SYS_mlock: ::c_long = 228;
pub const SYS_munlock: ::c_long = 229;
pub const SYS_mlockall: ::c_long = 230;
pub const SYS_munlockall: ::c_long = 231;
pub const SYS_mincore: ::c_long = 232;
pub const SYS_madvise: ::c_long = 233;
pub const SYS_remap_file_pages: ::c_long = 234;
pub const SYS_mbind: ::c_long = 235;
pub const SYS_get_mempolicy: ::c_long = 236;
pub const SYS_set_mempolicy: ::c_long = 237;
pub const SYS_migrate_pages: ::c_long = 238;
pub const SYS_move_pages: ::c_long = 239;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
pub const SYS_accept4: ::c_long = 242;
pub const SYS_recvmmsg: ::c_long = 243;
pub const SYS_wait4: ::c_long = 260;
pub const SYS_prlimit64: ::c_long = 261;
pub const SYS_fanotify_init: ::c_long = 262;
pub const SYS_fanotify_mark: ::c_long = 263;
pub const SYS_name_to_handle_at: ::c_long = 264;
pub const SYS_open_by_handle_at: ::c_long = 265;
pub const SYS_clock_adjtime: ::c_long = 266;
pub const SYS_syncfs: ::c_long = 267;
pub const SYS_setns: ::c_long = 268;
pub const SYS_sendmmsg: ::c_long = 269;
pub const SYS_process_vm_readv: ::c_long = 270;
pub const SYS_process_vm_writev: ::c_long = 271;
pub const SYS_kcmp: ::c_long = 272;
pub const SYS_finit_module: ::c_long = 273;
pub const SYS_sched_setattr: ::c_long = 274;
pub const SYS_sched_getattr: ::c_long = 275;
pub const SYS_renameat2: ::c_long = 276;
pub const SYS_seccomp: ::c_long = 277;
pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
pub const SYS_bpf: ::c_long = 280;
pub const SYS_execveat: ::c_long = 281;
pub const SYS_userfaultfd: ::c_long = 282;
pub const SYS_membarrier: ::c_long = 283;
pub const SYS_mlock2: ::c_long = 284;
pub const SYS_copy_file_range: ::c_long = 285;
pub const SYS_preadv2: ::c_long = 286;
pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
pub type c_char = u8;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino64_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__reserved: [::c_long; 3],
}
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_int,
__unused1: ::c_long,
__unused2: ::c_long
}
}
pub const SYS_pivot_root: ::c_long = 203;
pub const SYS_gettid: ::c_long = 207;
pub const SYS_perf_event_open: ::c_long = 319;
pub const SYS_memfd_create: ::c_long = 360;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
#[doc(hidden)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;
// Syscall table
pub const SYS_renameat2: ::c_long = 357;

View File

@ -1,447 +0,0 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino64_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__reserved: [::c_long; 3],
}
pub struct mcontext_t {
__private: [u64; 32],
}
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
}
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_int,
__unused1: ::c_long,
__unused2: ::c_long
}
}
// Syscall table
pub const SYS_read: ::c_long = 0;
pub const SYS_write: ::c_long = 1;
pub const SYS_open: ::c_long = 2;
pub const SYS_close: ::c_long = 3;
pub const SYS_stat: ::c_long = 4;
pub const SYS_fstat: ::c_long = 5;
pub const SYS_lstat: ::c_long = 6;
pub const SYS_poll: ::c_long = 7;
pub const SYS_lseek: ::c_long = 8;
pub const SYS_mmap: ::c_long = 9;
pub const SYS_mprotect: ::c_long = 10;
pub const SYS_munmap: ::c_long = 11;
pub const SYS_brk: ::c_long = 12;
pub const SYS_rt_sigaction: ::c_long = 13;
pub const SYS_rt_sigprocmask: ::c_long = 14;
pub const SYS_rt_sigreturn: ::c_long = 15;
pub const SYS_ioctl: ::c_long = 16;
pub const SYS_pread64: ::c_long = 17;
pub const SYS_pwrite64: ::c_long = 18;
pub const SYS_readv: ::c_long = 19;
pub const SYS_writev: ::c_long = 20;
pub const SYS_access: ::c_long = 21;
pub const SYS_pipe: ::c_long = 22;
pub const SYS_select: ::c_long = 23;
pub const SYS_sched_yield: ::c_long = 24;
pub const SYS_mremap: ::c_long = 25;
pub const SYS_msync: ::c_long = 26;
pub const SYS_mincore: ::c_long = 27;
pub const SYS_madvise: ::c_long = 28;
pub const SYS_shmget: ::c_long = 29;
pub const SYS_shmat: ::c_long = 30;
pub const SYS_shmctl: ::c_long = 31;
pub const SYS_dup: ::c_long = 32;
pub const SYS_dup2: ::c_long = 33;
pub const SYS_pause: ::c_long = 34;
pub const SYS_nanosleep: ::c_long = 35;
pub const SYS_getitimer: ::c_long = 36;
pub const SYS_alarm: ::c_long = 37;
pub const SYS_setitimer: ::c_long = 38;
pub const SYS_getpid: ::c_long = 39;
pub const SYS_sendfile: ::c_long = 40;
pub const SYS_socket: ::c_long = 41;
pub const SYS_connect: ::c_long = 42;
pub const SYS_accept: ::c_long = 43;
pub const SYS_sendto: ::c_long = 44;
pub const SYS_recvfrom: ::c_long = 45;
pub const SYS_sendmsg: ::c_long = 46;
pub const SYS_recvmsg: ::c_long = 47;
pub const SYS_shutdown: ::c_long = 48;
pub const SYS_bind: ::c_long = 49;
pub const SYS_listen: ::c_long = 50;
pub const SYS_getsockname: ::c_long = 51;
pub const SYS_getpeername: ::c_long = 52;
pub const SYS_socketpair: ::c_long = 53;
pub const SYS_setsockopt: ::c_long = 54;
pub const SYS_getsockopt: ::c_long = 55;
pub const SYS_clone: ::c_long = 56;
pub const SYS_fork: ::c_long = 57;
pub const SYS_vfork: ::c_long = 58;
pub const SYS_execve: ::c_long = 59;
pub const SYS_exit: ::c_long = 60;
pub const SYS_wait4: ::c_long = 61;
pub const SYS_kill: ::c_long = 62;
pub const SYS_uname: ::c_long = 63;
pub const SYS_semget: ::c_long = 64;
pub const SYS_semop: ::c_long = 65;
pub const SYS_semctl: ::c_long = 66;
pub const SYS_shmdt: ::c_long = 67;
pub const SYS_msgget: ::c_long = 68;
pub const SYS_msgsnd: ::c_long = 69;
pub const SYS_msgrcv: ::c_long = 70;
pub const SYS_msgctl: ::c_long = 71;
pub const SYS_fcntl: ::c_long = 72;
pub const SYS_flock: ::c_long = 73;
pub const SYS_fsync: ::c_long = 74;
pub const SYS_fdatasync: ::c_long = 75;
pub const SYS_truncate: ::c_long = 76;
pub const SYS_ftruncate: ::c_long = 77;
pub const SYS_getdents: ::c_long = 78;
pub const SYS_getcwd: ::c_long = 79;
pub const SYS_chdir: ::c_long = 80;
pub const SYS_fchdir: ::c_long = 81;
pub const SYS_rename: ::c_long = 82;
pub const SYS_mkdir: ::c_long = 83;
pub const SYS_rmdir: ::c_long = 84;
pub const SYS_creat: ::c_long = 85;
pub const SYS_link: ::c_long = 86;
pub const SYS_unlink: ::c_long = 87;
pub const SYS_symlink: ::c_long = 88;
pub const SYS_readlink: ::c_long = 89;
pub const SYS_chmod: ::c_long = 90;
pub const SYS_fchmod: ::c_long = 91;
pub const SYS_chown: ::c_long = 92;
pub const SYS_fchown: ::c_long = 93;
pub const SYS_lchown: ::c_long = 94;
pub const SYS_umask: ::c_long = 95;
pub const SYS_gettimeofday: ::c_long = 96;
pub const SYS_getrlimit: ::c_long = 97;
pub const SYS_getrusage: ::c_long = 98;
pub const SYS_sysinfo: ::c_long = 99;
pub const SYS_times: ::c_long = 100;
pub const SYS_ptrace: ::c_long = 101;
pub const SYS_getuid: ::c_long = 102;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_getgid: ::c_long = 104;
pub const SYS_setuid: ::c_long = 105;
pub const SYS_setgid: ::c_long = 106;
pub const SYS_geteuid: ::c_long = 107;
pub const SYS_getegid: ::c_long = 108;
pub const SYS_setpgid: ::c_long = 109;
pub const SYS_getppid: ::c_long = 110;
pub const SYS_getpgrp: ::c_long = 111;
pub const SYS_setsid: ::c_long = 112;
pub const SYS_setreuid: ::c_long = 113;
pub const SYS_setregid: ::c_long = 114;
pub const SYS_getgroups: ::c_long = 115;
pub const SYS_setgroups: ::c_long = 116;
pub const SYS_setresuid: ::c_long = 117;
pub const SYS_getresuid: ::c_long = 118;
pub const SYS_setresgid: ::c_long = 119;
pub const SYS_getresgid: ::c_long = 120;
pub const SYS_getpgid: ::c_long = 121;
pub const SYS_setfsuid: ::c_long = 122;
pub const SYS_setfsgid: ::c_long = 123;
pub const SYS_getsid: ::c_long = 124;
pub const SYS_capget: ::c_long = 125;
pub const SYS_capset: ::c_long = 126;
pub const SYS_rt_sigpending: ::c_long = 127;
pub const SYS_rt_sigtimedwait: ::c_long = 128;
pub const SYS_rt_sigqueueinfo: ::c_long = 129;
pub const SYS_rt_sigsuspend: ::c_long = 130;
pub const SYS_sigaltstack: ::c_long = 131;
pub const SYS_utime: ::c_long = 132;
pub const SYS_mknod: ::c_long = 133;
pub const SYS_uselib: ::c_long = 134;
pub const SYS_personality: ::c_long = 135;
pub const SYS_ustat: ::c_long = 136;
pub const SYS_statfs: ::c_long = 137;
pub const SYS_fstatfs: ::c_long = 138;
pub const SYS_sysfs: ::c_long = 139;
pub const SYS_getpriority: ::c_long = 140;
pub const SYS_setpriority: ::c_long = 141;
pub const SYS_sched_setparam: ::c_long = 142;
pub const SYS_sched_getparam: ::c_long = 143;
pub const SYS_sched_setscheduler: ::c_long = 144;
pub const SYS_sched_getscheduler: ::c_long = 145;
pub const SYS_sched_get_priority_max: ::c_long = 146;
pub const SYS_sched_get_priority_min: ::c_long = 147;
pub const SYS_sched_rr_get_interval: ::c_long = 148;
pub const SYS_mlock: ::c_long = 149;
pub const SYS_munlock: ::c_long = 150;
pub const SYS_mlockall: ::c_long = 151;
pub const SYS_munlockall: ::c_long = 152;
pub const SYS_vhangup: ::c_long = 153;
pub const SYS_modify_ldt: ::c_long = 154;
pub const SYS_pivot_root: ::c_long = 155;
pub const SYS__sysctl: ::c_long = 156;
pub const SYS_prctl: ::c_long = 157;
pub const SYS_arch_prctl: ::c_long = 158;
pub const SYS_adjtimex: ::c_long = 159;
pub const SYS_setrlimit: ::c_long = 160;
pub const SYS_chroot: ::c_long = 161;
pub const SYS_sync: ::c_long = 162;
pub const SYS_acct: ::c_long = 163;
pub const SYS_settimeofday: ::c_long = 164;
pub const SYS_mount: ::c_long = 165;
pub const SYS_umount2: ::c_long = 166;
pub const SYS_swapon: ::c_long = 167;
pub const SYS_swapoff: ::c_long = 168;
pub const SYS_reboot: ::c_long = 169;
pub const SYS_sethostname: ::c_long = 170;
pub const SYS_setdomainname: ::c_long = 171;
pub const SYS_iopl: ::c_long = 172;
pub const SYS_ioperm: ::c_long = 173;
pub const SYS_create_module: ::c_long = 174;
pub const SYS_init_module: ::c_long = 175;
pub const SYS_delete_module: ::c_long = 176;
pub const SYS_get_kernel_syms: ::c_long = 177;
pub const SYS_query_module: ::c_long = 178;
pub const SYS_quotactl: ::c_long = 179;
pub const SYS_nfsservctl: ::c_long = 180;
pub const SYS_getpmsg: ::c_long = 181;
pub const SYS_putpmsg: ::c_long = 182;
pub const SYS_afs_syscall: ::c_long = 183;
pub const SYS_tuxcall: ::c_long = 184;
pub const SYS_security: ::c_long = 185;
pub const SYS_gettid: ::c_long = 186;
pub const SYS_readahead: ::c_long = 187;
pub const SYS_setxattr: ::c_long = 188;
pub const SYS_lsetxattr: ::c_long = 189;
pub const SYS_fsetxattr: ::c_long = 190;
pub const SYS_getxattr: ::c_long = 191;
pub const SYS_lgetxattr: ::c_long = 192;
pub const SYS_fgetxattr: ::c_long = 193;
pub const SYS_listxattr: ::c_long = 194;
pub const SYS_llistxattr: ::c_long = 195;
pub const SYS_flistxattr: ::c_long = 196;
pub const SYS_removexattr: ::c_long = 197;
pub const SYS_lremovexattr: ::c_long = 198;
pub const SYS_fremovexattr: ::c_long = 199;
pub const SYS_tkill: ::c_long = 200;
pub const SYS_time: ::c_long = 201;
pub const SYS_futex: ::c_long = 202;
pub const SYS_sched_setaffinity: ::c_long = 203;
pub const SYS_sched_getaffinity: ::c_long = 204;
pub const SYS_set_thread_area: ::c_long = 205;
pub const SYS_io_setup: ::c_long = 206;
pub const SYS_io_destroy: ::c_long = 207;
pub const SYS_io_getevents: ::c_long = 208;
pub const SYS_io_submit: ::c_long = 209;
pub const SYS_io_cancel: ::c_long = 210;
pub const SYS_get_thread_area: ::c_long = 211;
pub const SYS_lookup_dcookie: ::c_long = 212;
pub const SYS_epoll_create: ::c_long = 213;
pub const SYS_epoll_ctl_old: ::c_long = 214;
pub const SYS_epoll_wait_old: ::c_long = 215;
pub const SYS_remap_file_pages: ::c_long = 216;
pub const SYS_getdents64: ::c_long = 217;
pub const SYS_set_tid_address: ::c_long = 218;
pub const SYS_restart_syscall: ::c_long = 219;
pub const SYS_semtimedop: ::c_long = 220;
pub const SYS_fadvise64: ::c_long = 221;
pub const SYS_timer_create: ::c_long = 222;
pub const SYS_timer_settime: ::c_long = 223;
pub const SYS_timer_gettime: ::c_long = 224;
pub const SYS_timer_getoverrun: ::c_long = 225;
pub const SYS_timer_delete: ::c_long = 226;
pub const SYS_clock_settime: ::c_long = 227;
pub const SYS_clock_gettime: ::c_long = 228;
pub const SYS_clock_getres: ::c_long = 229;
pub const SYS_clock_nanosleep: ::c_long = 230;
pub const SYS_exit_group: ::c_long = 231;
pub const SYS_epoll_wait: ::c_long = 232;
pub const SYS_epoll_ctl: ::c_long = 233;
pub const SYS_tgkill: ::c_long = 234;
pub const SYS_utimes: ::c_long = 235;
pub const SYS_vserver: ::c_long = 236;
pub const SYS_mbind: ::c_long = 237;
pub const SYS_set_mempolicy: ::c_long = 238;
pub const SYS_get_mempolicy: ::c_long = 239;
pub const SYS_mq_open: ::c_long = 240;
pub const SYS_mq_unlink: ::c_long = 241;
pub const SYS_mq_timedsend: ::c_long = 242;
pub const SYS_mq_timedreceive: ::c_long = 243;
pub const SYS_mq_notify: ::c_long = 244;
pub const SYS_mq_getsetattr: ::c_long = 245;
pub const SYS_kexec_load: ::c_long = 246;
pub const SYS_waitid: ::c_long = 247;
pub const SYS_add_key: ::c_long = 248;
pub const SYS_request_key: ::c_long = 249;
pub const SYS_keyctl: ::c_long = 250;
pub const SYS_ioprio_set: ::c_long = 251;
pub const SYS_ioprio_get: ::c_long = 252;
pub const SYS_inotify_init: ::c_long = 253;
pub const SYS_inotify_add_watch: ::c_long = 254;
pub const SYS_inotify_rm_watch: ::c_long = 255;
pub const SYS_migrate_pages: ::c_long = 256;
pub const SYS_openat: ::c_long = 257;
pub const SYS_mkdirat: ::c_long = 258;
pub const SYS_mknodat: ::c_long = 259;
pub const SYS_fchownat: ::c_long = 260;
pub const SYS_futimesat: ::c_long = 261;
pub const SYS_newfstatat: ::c_long = 262;
pub const SYS_unlinkat: ::c_long = 263;
pub const SYS_renameat: ::c_long = 264;
pub const SYS_linkat: ::c_long = 265;
pub const SYS_symlinkat: ::c_long = 266;
pub const SYS_readlinkat: ::c_long = 267;
pub const SYS_fchmodat: ::c_long = 268;
pub const SYS_faccessat: ::c_long = 269;
pub const SYS_pselect6: ::c_long = 270;
pub const SYS_ppoll: ::c_long = 271;
pub const SYS_unshare: ::c_long = 272;
pub const SYS_set_robust_list: ::c_long = 273;
pub const SYS_get_robust_list: ::c_long = 274;
pub const SYS_splice: ::c_long = 275;
pub const SYS_tee: ::c_long = 276;
pub const SYS_sync_file_range: ::c_long = 277;
pub const SYS_vmsplice: ::c_long = 278;
pub const SYS_move_pages: ::c_long = 279;
pub const SYS_utimensat: ::c_long = 280;
pub const SYS_epoll_pwait: ::c_long = 281;
pub const SYS_signalfd: ::c_long = 282;
pub const SYS_timerfd_create: ::c_long = 283;
pub const SYS_eventfd: ::c_long = 284;
pub const SYS_fallocate: ::c_long = 285;
pub const SYS_timerfd_settime: ::c_long = 286;
pub const SYS_timerfd_gettime: ::c_long = 287;
pub const SYS_accept4: ::c_long = 288;
pub const SYS_signalfd4: ::c_long = 289;
pub const SYS_eventfd2: ::c_long = 290;
pub const SYS_epoll_create1: ::c_long = 291;
pub const SYS_dup3: ::c_long = 292;
pub const SYS_pipe2: ::c_long = 293;
pub const SYS_inotify_init1: ::c_long = 294;
pub const SYS_preadv: ::c_long = 295;
pub const SYS_pwritev: ::c_long = 296;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
pub const SYS_perf_event_open: ::c_long = 298;
pub const SYS_recvmmsg: ::c_long = 299;
pub const SYS_fanotify_init: ::c_long = 300;
pub const SYS_fanotify_mark: ::c_long = 301;
pub const SYS_prlimit64: ::c_long = 302;
pub const SYS_name_to_handle_at: ::c_long = 303;
pub const SYS_open_by_handle_at: ::c_long = 304;
pub const SYS_clock_adjtime: ::c_long = 305;
pub const SYS_syncfs: ::c_long = 306;
pub const SYS_sendmmsg: ::c_long = 307;
pub const SYS_setns: ::c_long = 308;
pub const SYS_getcpu: ::c_long = 309;
pub const SYS_process_vm_readv: ::c_long = 310;
pub const SYS_process_vm_writev: ::c_long = 311;
pub const SYS_kcmp: ::c_long = 312;
pub const SYS_finit_module: ::c_long = 313;
pub const SYS_sched_setattr: ::c_long = 314;
pub const SYS_sched_getattr: ::c_long = 315;
pub const SYS_renameat2: ::c_long = 316;
pub const SYS_seccomp: ::c_long = 317;
pub const SYS_getrandom: ::c_long = 318;
pub const SYS_memfd_create: ::c_long = 319;
pub const SYS_kexec_file_load: ::c_long = 320;
pub const SYS_bpf: ::c_long = 321;
pub const SYS_execveat: ::c_long = 322;
pub const SYS_userfaultfd: ::c_long = 323;
pub const SYS_membarrier: ::c_long = 324;
pub const SYS_mlock2: ::c_long = 325;
pub const SYS_copy_file_range: ::c_long = 326;
pub const SYS_preadv2: ::c_long = 327;
pub const SYS_pwritev2: ::c_long = 328;
// FIXME syscalls 329-331 have been added in musl 1.16
// See discussion https://github.com/rust-lang/libc/pull/699
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
pub const R14: ::c_int = 1;
pub const R13: ::c_int = 2;
pub const R12: ::c_int = 3;
pub const RBP: ::c_int = 4;
pub const RBX: ::c_int = 5;
pub const R11: ::c_int = 6;
pub const R10: ::c_int = 7;
pub const R9: ::c_int = 8;
pub const R8: ::c_int = 9;
pub const RAX: ::c_int = 10;
pub const RCX: ::c_int = 11;
pub const RDX: ::c_int = 12;
pub const RSI: ::c_int = 13;
pub const RDI: ::c_int = 14;
pub const ORIG_RAX: ::c_int = 15;
pub const RIP: ::c_int = 16;
pub const CS: ::c_int = 17;
pub const EFLAGS: ::c_int = 18;
pub const RSP: ::c_int = 19;
pub const SS: ::c_int = 20;
pub const FS_BASE: ::c_int = 21;
pub const GS_BASE: ::c_int = 22;
pub const DS: ::c_int = 23;
pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
#[doc(hidden)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;

View File

@ -1,307 +0,0 @@
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Crate docs
#![allow(bad_style, overflowing_literals, improper_ctypes)]
#![crate_type = "rlib"]
#![crate_name = "libc"]
#![cfg_attr(cross_platform_docs, feature(no_core, lang_items, const_fn))]
#![cfg_attr(cross_platform_docs, no_core)]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico")]
#![cfg_attr(all(target_os = "linux", target_arch = "x86_64"), doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "x86"), doc(
html_root_url = "https://rust-lang.github.io/libc/i686-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "arm"), doc(
html_root_url = "https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "mips"), doc(
html_root_url = "https://rust-lang.github.io/libc/mips-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "aarch64"), doc(
html_root_url = "https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_env = "musl"), doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-musl"
))]
#![cfg_attr(all(target_os = "macos", target_arch = "x86_64"), doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-apple-darwin"
))]
#![cfg_attr(all(target_os = "macos", target_arch = "x86"), doc(
html_root_url = "https://rust-lang.github.io/libc/i686-apple-darwin"
))]
#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "gnu"), doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-gnu"
))]
#![cfg_attr(all(windows, target_arch = "x86", target_env = "gnu"), doc(
html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-gnu"
))]
#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "msvc"), doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-msvc"
))]
#![cfg_attr(all(windows, target_arch = "x86", target_env = "msvc"), doc(
html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-msvc"
))]
#![cfg_attr(target_os = "android", doc(
html_root_url = "https://rust-lang.github.io/libc/arm-linux-androideabi"
))]
#![cfg_attr(target_os = "freebsd", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-freebsd"
))]
#![cfg_attr(target_os = "openbsd", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-openbsd"
))]
#![cfg_attr(target_os = "bitrig", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-bitrig"
))]
#![cfg_attr(target_os = "netbsd", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-netbsd"
))]
#![cfg_attr(target_os = "dragonfly", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-dragonfly"
))]
#![cfg_attr(target_os = "solaris", doc(
html_root_url = "https://rust-lang.github.io/libc/x86_64-sun-solaris"
))]
#![cfg_attr(all(target_os = "emscripten", target_arch = "asmjs"), doc(
html_root_url = "https://rust-lang.github.io/libc/asmjs-unknown-emscripten"
))]
#![cfg_attr(all(target_os = "emscripten", target_arch = "wasm32"), doc(
html_root_url = "https://rust-lang.github.io/libc/wasm32-unknown-emscripten"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "sparc64"), doc(
html_root_url = "https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu"
))]
// Attributes needed when building as part of the standard library
#![cfg_attr(feature = "stdbuild", feature(no_std, staged_api, custom_attribute, cfg_target_vendor))]
#![cfg_attr(feature = "stdbuild", feature(link_cfg, repr_packed))]
#![cfg_attr(feature = "stdbuild", no_std)]
#![cfg_attr(feature = "stdbuild", staged_api)]
#![cfg_attr(feature = "stdbuild", allow(warnings))]
#![cfg_attr(feature = "stdbuild", unstable(feature = "libc",
reason = "use `libc` from crates.io",
issue = "27783"))]
#![cfg_attr(not(feature = "use_std"), no_std)]
#[cfg(all(not(cross_platform_docs), feature = "use_std"))]
extern crate std as core;
#[macro_use] mod macros;
mod dox;
cfg_if! {
if #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] {
// empty ...
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
// more optimization opportunities around it recognizing things like
// malloc/free.
#[repr(u8)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
pub type int8_t = i8;
pub type int16_t = i16;
pub type int32_t = i32;
pub type int64_t = i64;
pub type uint8_t = u8;
pub type uint16_t = u16;
pub type uint32_t = u32;
pub type uint64_t = u64;
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub enum FILE {}
pub enum fpos_t {} // TODO: fill this out with a struct
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
extern {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn isgraph(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn ispunct(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn isupper(c: c_int) -> c_int;
pub fn isxdigit(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "fopen$UNIX2003")]
pub fn fopen(filename: *const c_char,
mode: *const c_char) -> *mut FILE;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "freopen$UNIX2003")]
pub fn freopen(filename: *const c_char, mode: *const c_char,
file: *mut FILE) -> *mut FILE;
pub fn fflush(file: *mut FILE) -> c_int;
pub fn fclose(file: *mut FILE) -> c_int;
pub fn remove(filename: *const c_char) -> c_int;
pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
pub fn tmpfile() -> *mut FILE;
pub fn setvbuf(stream: *mut FILE,
buffer: *mut c_char,
mode: c_int,
size: size_t) -> c_int;
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
pub fn getchar() -> c_int;
pub fn putchar(c: c_int) -> c_int;
pub fn fgetc(stream: *mut FILE) -> c_int;
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "fputs$UNIX2003")]
pub fn fputs(s: *const c_char, stream: *mut FILE)-> c_int;
pub fn puts(s: *const c_char) -> c_int;
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
pub fn fread(ptr: *mut c_void,
size: size_t,
nobj: size_t,
stream: *mut FILE)
-> size_t;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "fwrite$UNIX2003")]
pub fn fwrite(ptr: *const c_void,
size: size_t,
nobj: size_t,
stream: *mut FILE)
-> size_t;
pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
pub fn ftell(stream: *mut FILE) -> c_long;
pub fn rewind(stream: *mut FILE);
#[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atoi(s: *const c_char) -> c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "strtod$UNIX2003")]
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtol(s: *const c_char,
endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
base: c_int) -> c_ulong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
pub fn free(p: *mut c_void);
pub fn abort() -> !;
pub fn exit(status: c_int) -> !;
pub fn _exit(status: c_int) -> !;
pub fn atexit(cb: extern fn()) -> c_int;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "system$UNIX2003")]
pub fn system(s: *const c_char) -> c_int;
pub fn getenv(s: *const c_char) -> *mut c_char;
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t)
-> *mut c_char;
pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
pub fn strdup(cs: *const c_char) -> *mut c_char;
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
link_name = "strerror$UNIX2003")]
pub fn strerror(n: c_int) -> *mut c_char;
pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
pub fn wcslen(buf: *const wchar_t) -> size_t;
pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
}
// These are all inline functions on android, so they end up just being entirely
// missing on that platform.
#[cfg(not(target_os = "android"))]
extern {
pub fn abs(i: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);
}
}
}
cfg_if! {
if #[cfg(windows)] {
mod windows;
pub use windows::*;
} else if #[cfg(target_os = "redox")] {
mod redox;
pub use redox::*;
} else if #[cfg(target_os = "cloudabi")] {
mod cloudabi;
pub use cloudabi::*;
} else if #[cfg(target_os = "fuchsia")] {
mod fuchsia;
pub use fuchsia::*;
} else if #[cfg(unix)] {
mod unix;
pub use unix::*;
} else {
// Unknown target_family
}
}

View File

@ -1,71 +0,0 @@
/// A macro for defining #[cfg] if-else statements.
///
/// This is similar to the `if/elif` C preprocessor macro by allowing definition
/// of a cascade of `#[cfg]` cases, emitting the implementation which matches
/// first.
///
/// This allows you to conveniently provide a long list #[cfg]'d blocks of code
/// without having to rewrite each clause multiple times.
macro_rules! cfg_if {
($(
if #[cfg($($meta:meta),*)] { $($it:item)* }
) else * else {
$($it2:item)*
}) => {
__cfg_if_items! {
() ;
$( ( ($($meta),*) ($($it)*) ), )*
( () ($($it2)*) ),
}
}
}
macro_rules! __cfg_if_items {
(($($not:meta,)*) ; ) => {};
(($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => {
__cfg_if_apply! { cfg(all(not(any($($not),*)), $($m,)*)), $($it)* }
__cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* }
}
}
macro_rules! __cfg_if_apply {
($m:meta, $($it:item)*) => {
$(#[$m] $it)*
}
}
macro_rules! s {
($($(#[$attr:meta])* pub struct $i:ident { $($field:tt)* })*) => ($(
__item! {
#[repr(C)]
$(#[$attr])*
pub struct $i { $($field)* }
}
impl ::dox::Copy for $i {}
impl ::dox::Clone for $i {
fn clone(&self) -> $i { *self }
}
)*)
}
macro_rules! f {
($(pub fn $i:ident($($arg:ident: $argty:ty),*) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
#[cfg(not(cross_platform_docs))]
pub unsafe extern fn $i($($arg: $argty),*) -> $ret {
$($body);*
}
#[cfg(cross_platform_docs)]
#[allow(dead_code)]
pub unsafe extern fn $i($($arg: $argty),*) -> $ret {
loop {}
}
)*)
}
macro_rules! __item {
($i:item) => ($i)
}

View File

@ -1,137 +0,0 @@
pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i16;
pub type off_t = c_long;
pub type mode_t = u16;
pub type time_t = i64;
pub type pid_t = usize;
pub type gid_t = usize;
pub type uid_t = usize;
pub type suseconds_t = i64;
s! {
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
}
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const S_ISUID: ::c_int = 0x800;
pub const S_ISGID: ::c_int = 0x400;
pub const S_ISVTX: ::c_int = 0x200;
pub const S_IFIFO: mode_t = 0x1000;
pub const S_IFCHR: mode_t = 0x2000;
pub const S_IFBLK: mode_t = 0x6000;
pub const S_IFDIR: mode_t = 0x4000;
pub const S_IFREG: mode_t = 0x8000;
pub const S_IFLNK: mode_t = 0xA000;
pub const S_IFSOCK: mode_t = 0xC000;
pub const S_IFMT: mode_t = 0xF000;
pub const S_IEXEC: mode_t = 0x40;
pub const S_IWRITE: mode_t = 0x80;
pub const S_IREAD: mode_t = 0x100;
pub const S_IRWXU: mode_t = 0x1C0;
pub const S_IXUSR: mode_t = 0x40;
pub const S_IWUSR: mode_t = 0x80;
pub const S_IRUSR: mode_t = 0x100;
pub const S_IRWXG: mode_t = 0x38;
pub const S_IXGRP: mode_t = 0x8;
pub const S_IWGRP: mode_t = 0x10;
pub const S_IRGRP: mode_t = 0x20;
pub const S_IRWXO: mode_t = 0x7;
pub const S_IXOTH: mode_t = 0x1;
pub const S_IWOTH: mode_t = 0x2;
pub const S_IROTH: mode_t = 0x4;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const O_RDONLY: ::c_int = 0x0001_0000;
pub const O_WRONLY: ::c_int = 0x0002_0000;
pub const O_RDWR: ::c_int = 0x0003_0000;
pub const O_NONBLOCK: ::c_int = 0x0004_0000;
pub const O_APPEND: ::c_int = 0x0008_0000;
pub const O_SHLOCK: ::c_int = 0x0010_0000;
pub const O_EXLOCK: ::c_int = 0x0020_0000;
pub const O_ASYNC: ::c_int = 0x0040_0000;
pub const O_FSYNC: ::c_int = 0x0080_0000;
pub const O_CLOEXEC: ::c_int = 0x0100_0000;
pub const O_CREAT: ::c_int = 0x0200_0000;
pub const O_TRUNC: ::c_int = 0x0400_0000;
pub const O_EXCL: ::c_int = 0x0800_0000;
pub const O_DIRECTORY: ::c_int = 0x1000_0000;
pub const O_STAT: ::c_int = 0x2000_0000;
pub const O_SYMLINK: ::c_int = 0x4000_0000;
pub const O_NOFOLLOW: ::c_int = 0x8000_0000;
pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGTRAP: ::c_int = 5;
pub const SIGABRT: ::c_int = 6;
pub const SIGBUS: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGUSR1: ::c_int = 10;
pub const SIGSEGV: ::c_int = 11;
pub const SIGUSR2: ::c_int = 12;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const SIGSTKFLT: ::c_int = 16;
pub const SIGCHLD: ::c_int = 17;
pub const SIGCONT: ::c_int = 18;
pub const SIGSTOP: ::c_int = 19;
pub const SIGTSTP: ::c_int = 20;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGURG: ::c_int = 23;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGIO: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIGSYS: ::c_int = 31;
extern {
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t)
-> ::ssize_t;
pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t)
-> ::ssize_t;
pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn close(fd: ::c_int) -> ::c_int;
}
#[link(name = "c")]
#[link(name = "m")]
extern {}
pub use self::net::*;
mod net;

View File

@ -1,122 +0,0 @@
pub type in_addr_t = u32;
pub type in_port_t = u16;
pub type socklen_t = u32;
pub type sa_family_t = u16;
s! {
pub struct in_addr {
pub s_addr: in_addr_t,
}
pub struct in6_addr {
pub s6_addr: [u8; 16],
__align: [u32; 0],
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct ipv6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: ::c_uint,
}
pub struct linger {
pub l_onoff: ::c_int,
pub l_linger: ::c_int,
}
pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 14],
}
pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [u8; 8],
}
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: u32,
}
pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_padding: [u8; 26],
}
}
pub const AF_INET: ::c_int = 2;
pub const AF_INET6: ::c_int = 23;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const IPPROTO_TCP: ::c_int = 6;
pub const IPPROTO_IP: ::c_int = 0;
pub const IPPROTO_IPV6: ::c_int = 41;
pub const TCP_KEEPIDLE: ::c_int = 4;
pub const TCP_NODELAY: ::c_int = 8193;
pub const IP_TTL: ::c_int = 8;
pub const IP_MULTICAST_LOOP: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_ADD_MEMBERSHIP: ::c_int = 11;
pub const IP_DROP_MEMBERSHIP: ::c_int = 12;
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
pub const IPV6_V6ONLY: ::c_int = 26;
pub const SOL_SOCKET: ::c_int = 65535;
pub const SO_REUSEADDR: ::c_int = 4;
pub const SO_BROADCAST: ::c_int = 6;
pub const SO_KEEPALIVE: ::c_int = 8;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_LINGER: ::c_int = 128;
pub const SO_SNDBUF: ::c_int = 4097;
pub const SO_RCVBUF: ::c_int = 4098;
pub const SO_ERROR: ::c_int = 4105;
extern {
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
pub fn connect(socket: ::c_int, address: *const sockaddr,
len: socklen_t) -> ::c_int;
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
pub fn getsockname(socket: ::c_int, address: *mut sockaddr,
address_len: *mut socklen_t) -> ::c_int;
pub fn getsockopt(sockfd: ::c_int,
level: ::c_int,
optname: ::c_int,
optval: *mut ::c_void,
optlen: *mut ::socklen_t) -> ::c_int;
pub fn setsockopt(socket: ::c_int, level: ::c_int, name: ::c_int,
value: *const ::c_void,
option_len: socklen_t) -> ::c_int;
pub fn getpeername(socket: ::c_int, address: *mut sockaddr,
address_len: *mut socklen_t) -> ::c_int;
pub fn sendto(socket: ::c_int, buf: *const ::c_void, len: ::size_t,
flags: ::c_int, addr: *const sockaddr,
addrlen: socklen_t) -> ::ssize_t;
pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t,
flags: ::c_int) -> ::ssize_t;
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
flags: ::c_int, addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t) -> ::ssize_t;
pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
flags: ::c_int) -> ::ssize_t;
}

View File

@ -1,60 +0,0 @@
//! 32-bit specific Apple (ios/darwin) definitions
pub type c_long = i32;
pub type c_ulong = u32;
pub type boolean_t = ::c_int;
s! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 36]
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: ::timeval,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval,
pub bh_caplen: ::uint32_t,
pub bh_datalen: ::uint32_t,
pub bh_hdrlen: ::c_ushort,
}
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
pub const __PTHREAD_COND_SIZE__: usize = 24;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 4;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 124;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458;

View File

@ -1,67 +0,0 @@
//! 64-bit specific Apple (ios/darwin) definitions
pub type c_long = i64;
pub type c_ulong = u64;
pub type boolean_t = ::c_uint;
s! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 56]
}
pub struct timeval32 {
pub tv_sec: i32,
pub tv_usec: i32,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: timeval32,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval32,
pub bh_caplen: ::uint32_t,
pub bh_datalen: ::uint32_t,
pub bh_hdrlen: ::c_ushort,
}
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
pub const __PTHREAD_COND_SIZE__: usize = 40;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 8;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
pub const FIONREAD: ::c_ulong = 0x4004667f;

File diff suppressed because it is too large Load Diff

View File

@ -1,763 +0,0 @@
pub type clock_t = u64;
pub type ino_t = u64;
pub type lwpid_t = i32;
pub type nlink_t = u32;
pub type blksize_t = i64;
pub type clockid_t = ::c_ulong;
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type uuid_t = ::uuid;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type sem_t = *mut sem;
pub enum sem {}
s! {
pub struct exit_status {
pub e_termination: u16,
pub e_exit: u16
}
pub struct utmpx {
pub ut_name: [::c_char; 32],
pub ut_id: [::c_char; 4],
pub ut_line: [::c_char; 32],
pub ut_host: [::c_char; 256],
pub ut_unused: [u8; 16],
pub ut_session: u16,
pub ut_type: u16,
pub ut_pid: ::pid_t,
ut_exit: exit_status,
ut_ss: ::sockaddr_storage,
pub ut_tv: ::timeval,
pub ut_unused2: [u8; 16],
}
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
pub aio_sigevent: sigevent,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
_aio_val: ::c_int,
_aio_err: ::c_int
}
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_namlen: u16,
pub d_type: u8,
__unused1: u8,
__unused2: u32,
pub d_name: [::c_char; 256],
}
pub struct uuid {
pub time_low: u32,
pub time_mid: u16,
pub time_hi_and_version: u16,
pub clock_seq_hi_and_reserved: u8,
pub clock_seq_low: u8,
pub node: [u8; 6],
}
pub struct mq_attr {
pub mq_flags: ::c_long,
pub mq_maxmsg: ::c_long,
pub mq_msgsize: ::c_long,
pub mq_curmsgs: ::c_long,
}
pub struct sigevent {
pub sigev_notify: ::c_int,
// The union is 8-byte in size, so it is aligned at a 8-byte offset.
#[cfg(target_pointer_width = "64")]
__unused1: ::c_int,
pub sigev_signo: ::c_int, //actually a union
// pad the union
#[cfg(target_pointer_width = "64")]
__unused2: ::c_int,
pub sigev_value: ::sigval,
__unused3: *mut ::c_void //actually a function pointer
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_owner: ::uid_t,
pub f_type: ::c_uint,
pub f_syncreads: u64,
pub f_syncwrites: u64,
pub f_asyncreads: u64,
pub f_asyncwrites: u64,
pub f_fsid_uuid: ::uuid_t,
pub f_uid_uuid: ::uuid_t,
}
pub struct stat {
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_dev: ::dev_t,
pub st_mode: ::mode_t,
pub st_padding1: ::uint16_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::int64_t,
pub st_blksize: ::uint32_t,
pub st_flags: ::uint32_t,
pub st_gen: ::uint32_t,
pub st_lspare: ::int32_t,
pub st_qspare1: ::int64_t,
pub st_qspare2: ::int64_t,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_mtu: ::c_ulong,
pub ifi_metric: ::c_ulong,
pub ifi_link_state: ::c_ulong,
pub ifi_baudrate: u64,
pub ifi_ipackets: ::c_ulong,
pub ifi_ierrors: ::c_ulong,
pub ifi_opackets: ::c_ulong,
pub ifi_oerrors: ::c_ulong,
pub ifi_collisions: ::c_ulong,
pub ifi_ibytes: ::c_ulong,
pub ifi_obytes: ::c_ulong,
pub ifi_imcasts: ::c_ulong,
pub ifi_omcasts: ::c_ulong,
pub ifi_iqdrops: ::c_ulong,
pub ifi_noproto: ::c_ulong,
pub ifi_hwassist: ::c_ulong,
pub ifi_oqdrops: ::c_ulong,
pub ifi_lastchange: ::timeval,
}
pub struct if_msghdr {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 12],
pub sdl_rcf: ::c_ushort,
pub sdl_route: [::c_ushort; 16],
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
pub const SIGSTKSZ: ::size_t = 40960;
pub const MADV_INVAL: ::c_int = 10;
pub const MADV_SETMAP: ::c_int = 11;
pub const O_CLOEXEC: ::c_int = 0x00020000;
pub const O_DIRECTORY: ::c_int = 0x08000000;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const ELAST: ::c_int = 99;
pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
pub const RLIM_NLIMITS: ::rlim_t = 12;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_VIRTUAL: ::clockid_t = 1;
pub const CLOCK_PROF: ::clockid_t = 2;
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_UPTIME: ::clockid_t = 5;
pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
pub const CLOCK_SECOND: ::clockid_t = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
pub const CTL_NET: ::c_int = 4;
pub const CTL_DEBUG: ::c_int = 5;
pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_P1003_1B: ::c_int = 9;
pub const CTL_LWKT: ::c_int = 10;
pub const CTL_MAXID: ::c_int = 11;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
pub const KERN_VERSION: ::c_int = 4;
pub const KERN_MAXVNODES: ::c_int = 5;
pub const KERN_MAXPROC: ::c_int = 6;
pub const KERN_MAXFILES: ::c_int = 7;
pub const KERN_ARGMAX: ::c_int = 8;
pub const KERN_SECURELVL: ::c_int = 9;
pub const KERN_HOSTNAME: ::c_int = 10;
pub const KERN_HOSTID: ::c_int = 11;
pub const KERN_CLOCKRATE: ::c_int = 12;
pub const KERN_VNODE: ::c_int = 13;
pub const KERN_PROC: ::c_int = 14;
pub const KERN_FILE: ::c_int = 15;
pub const KERN_PROF: ::c_int = 16;
pub const KERN_POSIX1: ::c_int = 17;
pub const KERN_NGROUPS: ::c_int = 18;
pub const KERN_JOB_CONTROL: ::c_int = 19;
pub const KERN_SAVED_IDS: ::c_int = 20;
pub const KERN_BOOTTIME: ::c_int = 21;
pub const KERN_NISDOMAINNAME: ::c_int = 22;
pub const KERN_UPDATEINTERVAL: ::c_int = 23;
pub const KERN_OSRELDATE: ::c_int = 24;
pub const KERN_NTP_PLL: ::c_int = 25;
pub const KERN_BOOTFILE: ::c_int = 26;
pub const KERN_MAXFILESPERPROC: ::c_int = 27;
pub const KERN_MAXPROCPERUID: ::c_int = 28;
pub const KERN_DUMPDEV: ::c_int = 29;
pub const KERN_IPC: ::c_int = 30;
pub const KERN_DUMMY: ::c_int = 31;
pub const KERN_PS_STRINGS: ::c_int = 32;
pub const KERN_USRSTACK: ::c_int = 33;
pub const KERN_LOGSIGEXIT: ::c_int = 34;
pub const KERN_IOV_MAX: ::c_int = 35;
pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36;
pub const KERN_MAXID: ::c_int = 37;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
pub const KERN_PROC_SESSION: ::c_int = 3;
pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_ARGS: ::c_int = 7;
pub const KERN_PROC_CWD: ::c_int = 8;
pub const KERN_PROC_PATHNAME: ::c_int = 9;
pub const KERN_PROC_FLAGMASK: ::c_int = 0x10;
pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10;
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
pub const KIPC_MAX_LINKHDR: ::c_int = 4;
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
pub const KIPC_MAX_HDR: ::c_int = 6;
pub const KIPC_MAX_DATALEN: ::c_int = 7;
pub const KIPC_MBSTAT: ::c_int = 8;
pub const KIPC_NMBCLUSTERS: ::c_int = 9;
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
pub const HW_BYTEORDER: ::c_int = 4;
pub const HW_PHYSMEM: ::c_int = 5;
pub const HW_USERMEM: ::c_int = 6;
pub const HW_PAGESIZE: ::c_int = 7;
pub const HW_DISKNAMES: ::c_int = 8;
pub const HW_DISKSTATS: ::c_int = 9;
pub const HW_FLOATINGPT: ::c_int = 10;
pub const HW_MACHINE_ARCH: ::c_int = 11;
pub const HW_MACHINE_PLATFORM: ::c_int = 12;
pub const HW_SENSORS: ::c_int = 13;
pub const HW_MAXID: ::c_int = 14;
pub const USER_CS_PATH: ::c_int = 1;
pub const USER_BC_BASE_MAX: ::c_int = 2;
pub const USER_BC_DIM_MAX: ::c_int = 3;
pub const USER_BC_SCALE_MAX: ::c_int = 4;
pub const USER_BC_STRING_MAX: ::c_int = 5;
pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
pub const USER_EXPR_NEST_MAX: ::c_int = 7;
pub const USER_LINE_MAX: ::c_int = 8;
pub const USER_RE_DUP_MAX: ::c_int = 9;
pub const USER_POSIX2_VERSION: ::c_int = 10;
pub const USER_POSIX2_C_BIND: ::c_int = 11;
pub const USER_POSIX2_C_DEV: ::c_int = 12;
pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
pub const USER_POSIX2_SW_DEV: ::c_int = 17;
pub const USER_POSIX2_UPE: ::c_int = 18;
pub const USER_STREAM_MAX: ::c_int = 19;
pub const USER_TZNAME_MAX: ::c_int = 20;
pub const USER_MAXID: ::c_int = 21;
pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
pub const CTL_P1003_1B_UNUSED1: ::c_int = 19;
pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
pub const CTL_P1003_1B_MAXID: ::c_int = 26;
pub const EVFILT_READ: ::int16_t = -1;
pub const EVFILT_WRITE: ::int16_t = -2;
pub const EVFILT_AIO: ::int16_t = -3;
pub const EVFILT_VNODE: ::int16_t = -4;
pub const EVFILT_PROC: ::int16_t = -5;
pub const EVFILT_SIGNAL: ::int16_t = -6;
pub const EVFILT_TIMER: ::int16_t = -7;
pub const EVFILT_EXCEPT: ::int16_t = -8;
pub const EVFILT_USER: ::int16_t = -9;
pub const EVFILT_FS: ::int16_t = -10;
pub const EV_ADD: ::uint16_t = 0x1;
pub const EV_DELETE: ::uint16_t = 0x2;
pub const EV_ENABLE: ::uint16_t = 0x4;
pub const EV_DISABLE: ::uint16_t = 0x8;
pub const EV_ONESHOT: ::uint16_t = 0x10;
pub const EV_CLEAR: ::uint16_t = 0x20;
pub const EV_RECEIPT: ::uint16_t = 0x40;
pub const EV_DISPATCH: ::uint16_t = 0x80;
pub const EV_NODATA: ::uint16_t = 0x1000;
pub const EV_FLAG1: ::uint16_t = 0x2000;
pub const EV_ERROR: ::uint16_t = 0x4000;
pub const EV_EOF: ::uint16_t = 0x8000;
pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
pub const NOTE_FFAND: ::uint32_t = 0x40000000;
pub const NOTE_FFOR: ::uint32_t = 0x80000000;
pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
pub const NOTE_OOB: ::uint32_t = 0x00000002;
pub const NOTE_DELETE: ::uint32_t = 0x00000001;
pub const NOTE_WRITE: ::uint32_t = 0x00000002;
pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
pub const NOTE_LINK: ::uint32_t = 0x00000010;
pub const NOTE_RENAME: ::uint32_t = 0x00000020;
pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
pub const NOTE_EXIT: ::uint32_t = 0x80000000;
pub const NOTE_FORK: ::uint32_t = 0x40000000;
pub const NOTE_EXEC: ::uint32_t = 0x20000000;
pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
pub const NOTE_TRACK: ::uint32_t = 0x00000001;
pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
pub const NOTE_CHILD: ::uint32_t = 0x00000004;
pub const SO_SNDSPACE: ::c_int = 0x100a;
pub const SO_CPUHINT: ::c_int = 0x1030;
// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101
pub const IFF_UP: ::c_int = 0x1; // interface is up
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
// was interface is in polling mode
pub const IFF_POLLING_COMPAT: ::c_int = 0x10000;
pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode
pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode
pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP
pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode
pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input
//
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// IP6 hop-by-hop options
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// gateway^2 (deprecated)
pub const IPPROTO_GGP: ::c_int = 3;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// Stream protocol II.
pub const IPPROTO_ST: ::c_int = 7;
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// private interior gateway
pub const IPPROTO_PIGP: ::c_int = 9;
/// BBN RCC Monitoring
pub const IPPROTO_RCCMON: ::c_int = 10;
/// network voice protocol
pub const IPPROTO_NVPII: ::c_int = 11;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
/// Argus
pub const IPPROTO_ARGUS: ::c_int = 13;
/// EMCON
pub const IPPROTO_EMCON: ::c_int = 14;
/// Cross Net Debugger
pub const IPPROTO_XNET: ::c_int = 15;
/// Chaos
pub const IPPROTO_CHAOS: ::c_int = 16;
// IPPROTO_UDP defined in src/unix/mod.rs
/// Multiplexing
pub const IPPROTO_MUX: ::c_int = 18;
/// DCN Measurement Subsystems
pub const IPPROTO_MEAS: ::c_int = 19;
/// Host Monitoring
pub const IPPROTO_HMP: ::c_int = 20;
/// Packet Radio Measurement
pub const IPPROTO_PRM: ::c_int = 21;
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// Trunk-1
pub const IPPROTO_TRUNK1: ::c_int = 23;
/// Trunk-2
pub const IPPROTO_TRUNK2: ::c_int = 24;
/// Leaf-1
pub const IPPROTO_LEAF1: ::c_int = 25;
/// Leaf-2
pub const IPPROTO_LEAF2: ::c_int = 26;
/// Reliable Data
pub const IPPROTO_RDP: ::c_int = 27;
/// Reliable Transaction
pub const IPPROTO_IRTP: ::c_int = 28;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// Bulk Data Transfer
pub const IPPROTO_BLT: ::c_int = 30;
/// Network Services
pub const IPPROTO_NSP: ::c_int = 31;
/// Merit Internodal
pub const IPPROTO_INP: ::c_int = 32;
/// Sequential Exchange
pub const IPPROTO_SEP: ::c_int = 33;
/// Third Party Connect
pub const IPPROTO_3PC: ::c_int = 34;
/// InterDomain Policy Routing
pub const IPPROTO_IDPR: ::c_int = 35;
/// XTP
pub const IPPROTO_XTP: ::c_int = 36;
/// Datagram Delivery
pub const IPPROTO_DDP: ::c_int = 37;
/// Control Message Transport
pub const IPPROTO_CMTP: ::c_int = 38;
/// TP++ Transport
pub const IPPROTO_TPXX: ::c_int = 39;
/// IL transport protocol
pub const IPPROTO_IL: ::c_int = 40;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// Source Demand Routing
pub const IPPROTO_SDRP: ::c_int = 42;
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// InterDomain Routing
pub const IPPROTO_IDRP: ::c_int = 45;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// Mobile Host Routing
pub const IPPROTO_MHRP: ::c_int = 48;
/// BHA
pub const IPPROTO_BHA: ::c_int = 49;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
/// Integ. Net Layer Security
pub const IPPROTO_INLSP: ::c_int = 52;
/// IP with encryption
pub const IPPROTO_SWIPE: ::c_int = 53;
/// Next Hop Resolution
pub const IPPROTO_NHRP: ::c_int = 54;
/// IP Mobility
pub const IPPROTO_MOBILE: ::c_int = 55;
/// Transport Layer Security
pub const IPPROTO_TLSP: ::c_int = 56;
/// SKIP
pub const IPPROTO_SKIP: ::c_int = 57;
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
/// any host internal protocol
pub const IPPROTO_AHIP: ::c_int = 61;
/// CFTP
pub const IPPROTO_CFTP: ::c_int = 62;
/// "hello" routing protocol
pub const IPPROTO_HELLO: ::c_int = 63;
/// SATNET/Backroom EXPAK
pub const IPPROTO_SATEXPAK: ::c_int = 64;
/// Kryptolan
pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
/// Remote Virtual Disk
pub const IPPROTO_RVD: ::c_int = 66;
/// Pluribus Packet Core
pub const IPPROTO_IPPC: ::c_int = 67;
/// Any distributed FS
pub const IPPROTO_ADFS: ::c_int = 68;
/// Satnet Monitoring
pub const IPPROTO_SATMON: ::c_int = 69;
/// VISA Protocol
pub const IPPROTO_VISA: ::c_int = 70;
/// Packet Core Utility
pub const IPPROTO_IPCV: ::c_int = 71;
/// Comp. Prot. Net. Executive
pub const IPPROTO_CPNX: ::c_int = 72;
/// Comp. Prot. HeartBeat
pub const IPPROTO_CPHB: ::c_int = 73;
/// Wang Span Network
pub const IPPROTO_WSN: ::c_int = 74;
/// Packet Video Protocol
pub const IPPROTO_PVP: ::c_int = 75;
/// BackRoom SATNET Monitoring
pub const IPPROTO_BRSATMON: ::c_int = 76;
/// Sun net disk proto (temp.)
pub const IPPROTO_ND: ::c_int = 77;
/// WIDEBAND Monitoring
pub const IPPROTO_WBMON: ::c_int = 78;
/// WIDEBAND EXPAK
pub const IPPROTO_WBEXPAK: ::c_int = 79;
/// ISO cnlp
pub const IPPROTO_EON: ::c_int = 80;
/// VMTP
pub const IPPROTO_VMTP: ::c_int = 81;
/// Secure VMTP
pub const IPPROTO_SVMTP: ::c_int = 82;
/// Banyon VINES
pub const IPPROTO_VINES: ::c_int = 83;
/// TTP
pub const IPPROTO_TTP: ::c_int = 84;
/// NSFNET-IGP
pub const IPPROTO_IGP: ::c_int = 85;
/// dissimilar gateway prot.
pub const IPPROTO_DGP: ::c_int = 86;
/// TCF
pub const IPPROTO_TCF: ::c_int = 87;
/// Cisco/GXS IGRP
pub const IPPROTO_IGRP: ::c_int = 88;
/// OSPFIGP
pub const IPPROTO_OSPFIGP: ::c_int = 89;
/// Strite RPC protocol
pub const IPPROTO_SRPC: ::c_int = 90;
/// Locus Address Resoloution
pub const IPPROTO_LARP: ::c_int = 91;
/// Multicast Transport
pub const IPPROTO_MTP: ::c_int = 92;
/// AX.25 Frames
pub const IPPROTO_AX25: ::c_int = 93;
/// IP encapsulated in IP
pub const IPPROTO_IPEIP: ::c_int = 94;
/// Mobile Int.ing control
pub const IPPROTO_MICP: ::c_int = 95;
/// Semaphore Comm. security
pub const IPPROTO_SCCSP: ::c_int = 96;
/// Ethernet IP encapsulation
pub const IPPROTO_ETHERIP: ::c_int = 97;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// any private encr. scheme
pub const IPPROTO_APES: ::c_int = 99;
/// GMTP
pub const IPPROTO_GMTP: ::c_int = 100;
/// payload compression (IPComp)
pub const IPPROTO_IPCOMP: ::c_int = 108;
/* 101-254: Partly Unassigned */
/// Protocol Independent Mcast
pub const IPPROTO_PIM: ::c_int = 103;
/// CARP
pub const IPPROTO_CARP: ::c_int = 112;
/// PGM
pub const IPPROTO_PGM: ::c_int = 113;
/// PFSYNC
pub const IPPROTO_PFSYNC: ::c_int = 240;
/* 255: Reserved */
/* BSD Private, local use, namespace incursion, no longer used */
/// divert pseudo-protocol
pub const IPPROTO_DIVERT: ::c_int = 254;
pub const IPPROTO_MAX: ::c_int = 256;
/// last return value of *_input(), meaning "all job for this pkt is done".
pub const IPPROTO_DONE: ::c_int = 257;
/// Used by RSS: the layer3 protocol is unknown
pub const IPPROTO_UNKNOWN: ::c_int = 258;
pub const AF_BLUETOOTH: ::c_int = 33;
pub const AF_MPLS: ::c_int = 34;
pub const AF_IEEE80211: ::c_int = 35;
pub const AF_MAX: ::c_int = 36;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const PF_MAX: ::c_int = AF_MAX;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
pub const NET_RT_IFLIST: ::c_int = 3;
pub const NET_RT_MAXID: ::c_int = 4;
pub const SOMAXOPT_SIZE: ::c_int = 65536;
#[doc(hidden)]
pub const NET_MAXID: ::c_int = AF_MAX;
pub const MSG_UNUSED09: ::c_int = 0x00000200;
pub const MSG_NOSIGNAL: ::c_int = 0x00000400;
pub const MSG_SYNC: ::c_int = 0x00000800;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000;
pub const MSG_FBLOCKING: ::c_int = 0x00010000;
pub const MSG_FNONBLOCKING: ::c_int = 0x00020000;
pub const MSG_FMASK: ::c_int = 0xFFFF0000;
pub const EMPTY: ::c_short = 0;
pub const RUN_LVL: ::c_short = 1;
pub const BOOT_TIME: ::c_short = 2;
pub const OLD_TIME: ::c_short = 3;
pub const NEW_TIME: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const USER_PROCESS: ::c_short = 7;
pub const DEAD_PROCESS: ::c_short = 8;
pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
pub const LC_MONETARY_MASK: ::c_int = (1 << 2);
pub const LC_NUMERIC_MASK: ::c_int = (1 << 3);
pub const LC_TIME_MASK: ::c_int = (1 << 4);
pub const LC_MESSAGES_MASK: ::c_int = (1 << 5);
pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
| LC_CTYPE_MASK
| LC_MESSAGES_MASK
| LC_MONETARY_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK;
pub const TIOCSIG: ::c_uint = 0x2000745f;
pub const BTUARTDISC: ::c_int = 0x7;
pub const TIOCDCDTIMESTAMP: ::c_uint = 0x40107458;
pub const TIOCISPTMASTER: ::c_uint = 0x20007455;
pub const TIOCMODG: ::c_uint = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
// Constants used by "at" family of system calls.
pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
pub const AT_REMOVEDIR: ::c_int = 2;
pub const AT_EACCESS: ::c_int = 4;
pub const AT_SYMLINK_FOLLOW: ::c_int = 8;
pub const VCHECKPT: usize = 19;
pub const _PC_2_SYMLINKS: ::c_int = 22;
pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23;
pub const _SC_V7_ILP32_OFF32: ::c_int = 122;
pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123;
pub const _SC_V7_LP64_OFF64: ::c_int = 124;
pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
pub const WCONTINUED: ::c_int = 4;
pub const WSTOPPED: ::c_int = 0o177;
// Values for struct rtprio (type_ field)
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
pub const RTP_PRIO_NORMAL: ::c_ushort = 1;
pub const RTP_PRIO_IDLE: ::c_ushort = 2;
pub const RTP_PRIO_THREAD: ::c_ushort = 3;
extern {
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
pub fn aio_waitcomplete(iocbp: *mut *mut aiocb,
timeout: *mut ::timespec) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn lwp_rtprio(function: ::c_int, pid: ::pid_t, lwpid: lwpid_t,
rtp: *mut super::rtprio) -> ::c_int;
}

View File

@ -1,32 +0,0 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
pub type suseconds_t = i64;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: ::uint32_t,
pub st_lspare: ::int32_t,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type time_t = i32;
pub type suseconds_t = i32;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: ::uint32_t,
pub st_lspare: ::int32_t,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
}

View File

@ -1,32 +0,0 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
pub type suseconds_t = i64;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: ::uint32_t,
pub st_lspare: ::int32_t,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More