uringmachine 0.15 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.gitmodules +4 -0
- data/CHANGELOG.md +12 -0
- data/TODO.md +12 -3
- data/examples/bm_send.rb +86 -0
- data/ext/um/um.c +28 -1
- data/ext/um/um.h +3 -0
- data/ext/um/um_class.c +17 -0
- data/ext/um/um_stream_class.c +0 -1
- data/ext/um/um_utils.c +38 -15
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +4 -3
- data/test/test_um.rb +76 -0
- data/vendor/libressl/.github/scripts/changelog.sh +74 -0
- data/vendor/libressl/.github/workflows/android.yml +35 -0
- data/vendor/libressl/.github/workflows/cifuzz.yml +33 -0
- data/vendor/libressl/.github/workflows/cmake-config.yml +98 -0
- data/vendor/libressl/.github/workflows/coverity.yml +69 -0
- data/vendor/libressl/.github/workflows/emscripten.yml +71 -0
- data/vendor/libressl/.github/workflows/fedora-rawhide.yml +39 -0
- data/vendor/libressl/.github/workflows/freebsd.yml +71 -0
- data/vendor/libressl/.github/workflows/linux.yml +71 -0
- data/vendor/libressl/.github/workflows/macos.yml +37 -0
- data/vendor/libressl/.github/workflows/release.yml +81 -0
- data/vendor/libressl/.github/workflows/rust-openssl.yml +47 -0
- data/vendor/libressl/.github/workflows/solaris.yml +37 -0
- data/vendor/libressl/.github/workflows/windows.yml +70 -0
- data/vendor/libressl/.gitignore +333 -0
- data/vendor/libressl/CMakeLists.txt +581 -0
- data/vendor/libressl/COPYING +133 -0
- data/vendor/libressl/ChangeLog +3280 -0
- data/vendor/libressl/FindLibreSSL.cmake +232 -0
- data/vendor/libressl/LibreSSLConfig.cmake.in +36 -0
- data/vendor/libressl/Makefile.am +60 -0
- data/vendor/libressl/Makefile.am.common +20 -0
- data/vendor/libressl/OPENBSD_BRANCH +1 -0
- data/vendor/libressl/README.md +238 -0
- data/vendor/libressl/README.mingw.md +43 -0
- data/vendor/libressl/apps/CMakeLists.txt +18 -0
- data/vendor/libressl/apps/Makefile.am +5 -0
- data/vendor/libressl/apps/nc/CMakeLists.txt +67 -0
- data/vendor/libressl/apps/nc/Makefile.am +64 -0
- data/vendor/libressl/apps/nc/compat/accept4.c +17 -0
- data/vendor/libressl/apps/nc/compat/readpassphrase.c +205 -0
- data/vendor/libressl/apps/nc/compat/socket.c +29 -0
- data/vendor/libressl/apps/nc/compat/sys/socket.h +30 -0
- data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +44 -0
- data/vendor/libressl/apps/ocspcheck/Makefile.am +45 -0
- data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
- data/vendor/libressl/apps/openssl/CMakeLists.txt +97 -0
- data/vendor/libressl/apps/openssl/Makefile.am +108 -0
- data/vendor/libressl/apps/openssl/apps_win.c +138 -0
- data/vendor/libressl/apps/openssl/certhash_win.c +13 -0
- data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +26 -0
- data/vendor/libressl/apps/openssl/compat/poll_win.c +329 -0
- data/vendor/libressl/appveyor.yml +53 -0
- data/vendor/libressl/autogen.sh +15 -0
- data/vendor/libressl/check-release.sh +86 -0
- data/vendor/libressl/cmake_export_symbol.cmake +71 -0
- data/vendor/libressl/cmake_uninstall.cmake.in +36 -0
- data/vendor/libressl/config +17 -0
- data/vendor/libressl/configure.ac +165 -0
- data/vendor/libressl/crypto/CMakeLists.txt +863 -0
- data/vendor/libressl/crypto/Makefile.am +962 -0
- data/vendor/libressl/crypto/Makefile.am.arc4random +46 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips64 +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +22 -0
- data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +23 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +60 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +62 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +26 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +36 -0
- data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/arch/mips/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +23 -0
- data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +24 -0
- data/vendor/libressl/crypto/compat/.gitignore +31 -0
- data/vendor/libressl/crypto/compat/arc4random.h +41 -0
- data/vendor/libressl/crypto/compat/b_win.c +55 -0
- data/vendor/libressl/crypto/compat/bsd-asprintf.c +96 -0
- data/vendor/libressl/crypto/compat/crypto_lock_win.c +56 -0
- data/vendor/libressl/crypto/compat/explicit_bzero_win.c +13 -0
- data/vendor/libressl/crypto/compat/freezero.c +32 -0
- data/vendor/libressl/crypto/compat/getdelim.c +78 -0
- data/vendor/libressl/crypto/compat/getline.c +40 -0
- data/vendor/libressl/crypto/compat/getopt_long.c +528 -0
- data/vendor/libressl/crypto/compat/getpagesize.c +18 -0
- data/vendor/libressl/crypto/compat/getprogname_linux.c +23 -0
- data/vendor/libressl/crypto/compat/getprogname_unimpl.c +7 -0
- data/vendor/libressl/crypto/compat/getprogname_windows.c +13 -0
- data/vendor/libressl/crypto/compat/posix_win.c +296 -0
- data/vendor/libressl/crypto/compat/syslog_r.c +19 -0
- data/vendor/libressl/crypto/compat/ui_openssl_win.c +334 -0
- data/vendor/libressl/dist.sh +22 -0
- data/vendor/libressl/gen-coverage-report.sh +58 -0
- data/vendor/libressl/gen-openbsd-tags.sh +20 -0
- data/vendor/libressl/include/CMakeLists.txt +61 -0
- data/vendor/libressl/include/Makefile.am +79 -0
- data/vendor/libressl/include/arch/loongarch64/opensslconf.h +150 -0
- data/vendor/libressl/include/arch/mips/opensslconf.h +150 -0
- data/vendor/libressl/include/compat/arpa/inet.h +15 -0
- data/vendor/libressl/include/compat/arpa/nameser.h +25 -0
- data/vendor/libressl/include/compat/cet.h +19 -0
- data/vendor/libressl/include/compat/dirent.h +17 -0
- data/vendor/libressl/include/compat/dirent_msvc.h +611 -0
- data/vendor/libressl/include/compat/endian.h +161 -0
- data/vendor/libressl/include/compat/err.h +95 -0
- data/vendor/libressl/include/compat/fcntl.h +32 -0
- data/vendor/libressl/include/compat/getopt.h +50 -0
- data/vendor/libressl/include/compat/limits.h +25 -0
- data/vendor/libressl/include/compat/netdb.h +10 -0
- data/vendor/libressl/include/compat/netinet/in.h +19 -0
- data/vendor/libressl/include/compat/netinet/ip.h +49 -0
- data/vendor/libressl/include/compat/netinet/tcp.h +10 -0
- data/vendor/libressl/include/compat/poll.h +63 -0
- data/vendor/libressl/include/compat/pthread.h +122 -0
- data/vendor/libressl/include/compat/readpassphrase.h +44 -0
- data/vendor/libressl/include/compat/resolv.h +24 -0
- data/vendor/libressl/include/compat/stdint.h +31 -0
- data/vendor/libressl/include/compat/stdio.h +65 -0
- data/vendor/libressl/include/compat/stdlib.h +57 -0
- data/vendor/libressl/include/compat/string.h +98 -0
- data/vendor/libressl/include/compat/sys/_null.h +18 -0
- data/vendor/libressl/include/compat/sys/ioctl.h +11 -0
- data/vendor/libressl/include/compat/sys/mman.h +19 -0
- data/vendor/libressl/include/compat/sys/param.h +15 -0
- data/vendor/libressl/include/compat/sys/queue.h +536 -0
- data/vendor/libressl/include/compat/sys/select.h +10 -0
- data/vendor/libressl/include/compat/sys/socket.h +18 -0
- data/vendor/libressl/include/compat/sys/stat.h +129 -0
- data/vendor/libressl/include/compat/sys/time.h +37 -0
- data/vendor/libressl/include/compat/sys/tree.h +1006 -0
- data/vendor/libressl/include/compat/sys/types.h +69 -0
- data/vendor/libressl/include/compat/sys/uio.h +17 -0
- data/vendor/libressl/include/compat/syslog.h +38 -0
- data/vendor/libressl/include/compat/time.h +59 -0
- data/vendor/libressl/include/compat/unistd.h +83 -0
- data/vendor/libressl/include/compat/win32netcompat.h +57 -0
- data/vendor/libressl/include/openssl/Makefile.am.tpl +45 -0
- data/vendor/libressl/libcrypto.pc.in +28 -0
- data/vendor/libressl/libressl.pub +2 -0
- data/vendor/libressl/libssl.pc.in +28 -0
- data/vendor/libressl/libtls.pc.in +28 -0
- data/vendor/libressl/m4/ax_add_fortify_source.m4 +80 -0
- data/vendor/libressl/m4/ax_check_compile_flag.m4 +53 -0
- data/vendor/libressl/m4/check-hardening-options.m4 +110 -0
- data/vendor/libressl/m4/check-libc.m4 +189 -0
- data/vendor/libressl/m4/check-os-options.m4 +181 -0
- data/vendor/libressl/m4/disable-compiler-warnings.m4 +44 -0
- data/vendor/libressl/man/CMakeLists.txt +26 -0
- data/vendor/libressl/man/links +2780 -0
- data/vendor/libressl/man/update_links.sh +25 -0
- data/vendor/libressl/openssl.pc.in +11 -0
- data/vendor/libressl/patches/bn_shift.patch +34 -0
- data/vendor/libressl/patches/crypto_arch.h.patch +34 -0
- data/vendor/libressl/patches/crypto_namespace.h.patch +22 -0
- data/vendor/libressl/patches/netcat.c.patch +178 -0
- data/vendor/libressl/patches/openssl.c.patch +12 -0
- data/vendor/libressl/patches/opensslfeatures.h.patch +49 -0
- data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/speed.c.patch +114 -0
- data/vendor/libressl/patches/ssl_namespace.h.patch +21 -0
- data/vendor/libressl/patches/tls.h.patch +16 -0
- data/vendor/libressl/patches/tls_config.c.patch +15 -0
- data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +28 -0
- data/vendor/libressl/patches/windows_headers.patch +80 -0
- data/vendor/libressl/scripts/config.guess +1774 -0
- data/vendor/libressl/scripts/config.sub +1907 -0
- data/vendor/libressl/scripts/i686-w64-mingw32.cmake +9 -0
- data/vendor/libressl/scripts/test +210 -0
- data/vendor/libressl/scripts/wrap-compiler-for-flag-check +31 -0
- data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +9 -0
- data/vendor/libressl/ssl/CMakeLists.txt +183 -0
- data/vendor/libressl/ssl/Makefile.am +187 -0
- data/vendor/libressl/tests/CMakeLists.txt +970 -0
- data/vendor/libressl/tests/Makefile.am +944 -0
- data/vendor/libressl/tests/aeadtest.sh +30 -0
- data/vendor/libressl/tests/arc4randomforktest.sh +21 -0
- data/vendor/libressl/tests/asn1time_small.test +10 -0
- data/vendor/libressl/tests/cmake/CMakeLists.txt +52 -0
- data/vendor/libressl/tests/cmake/crypto.c +7 -0
- data/vendor/libressl/tests/cmake/ssl.c +6 -0
- data/vendor/libressl/tests/cmake/tls.c +6 -0
- data/vendor/libressl/tests/compat/pipe2.c +186 -0
- data/vendor/libressl/tests/dtlstest.sh +28 -0
- data/vendor/libressl/tests/evptest.sh +22 -0
- data/vendor/libressl/tests/keypairtest.sh +27 -0
- data/vendor/libressl/tests/mlkem_tests.sh +39 -0
- data/vendor/libressl/tests/ocsptest.bat +25 -0
- data/vendor/libressl/tests/ocsptest.sh +23 -0
- data/vendor/libressl/tests/openssl.cnf +29 -0
- data/vendor/libressl/tests/optionstest.c +381 -0
- data/vendor/libressl/tests/pidwraptest.c +85 -0
- data/vendor/libressl/tests/pidwraptest.sh +26 -0
- data/vendor/libressl/tests/quictest.bat +27 -0
- data/vendor/libressl/tests/quictest.sh +30 -0
- data/vendor/libressl/tests/renegotiation_test.bat +27 -0
- data/vendor/libressl/tests/renegotiation_test.sh +30 -0
- data/vendor/libressl/tests/rfc5280time_small.test +10 -0
- data/vendor/libressl/tests/servertest.bat +27 -0
- data/vendor/libressl/tests/servertest.sh +30 -0
- data/vendor/libressl/tests/shutdowntest.bat +27 -0
- data/vendor/libressl/tests/shutdowntest.sh +30 -0
- data/vendor/libressl/tests/ssltest.bat +32 -0
- data/vendor/libressl/tests/ssltest.sh +48 -0
- data/vendor/libressl/tests/testdsa.bat +47 -0
- data/vendor/libressl/tests/testdsa.sh +57 -0
- data/vendor/libressl/tests/testenc.bat +85 -0
- data/vendor/libressl/tests/testenc.sh +93 -0
- data/vendor/libressl/tests/testrsa.bat +47 -0
- data/vendor/libressl/tests/testrsa.sh +57 -0
- data/vendor/libressl/tests/testssl.bat +171 -0
- data/vendor/libressl/tests/tlstest.bat +27 -0
- data/vendor/libressl/tests/tlstest.sh +28 -0
- data/vendor/libressl/tls/CMakeLists.txt +125 -0
- data/vendor/libressl/tls/Makefile.am +76 -0
- data/vendor/libressl/tls/compat/ftruncate.c +17 -0
- data/vendor/libressl/tls/compat/pread.c +29 -0
- data/vendor/libressl/tls/compat/pwrite.c +29 -0
- data/vendor/libressl/update.sh +460 -0
- data/vendor/liburing/.github/workflows/ci.yml +8 -0
- data/vendor/liburing/configure +23 -2
- data/vendor/liburing/examples/helpers.c +1 -1
- data/vendor/liburing/examples/helpers.h +1 -1
- data/vendor/liburing/examples/reg-wait.c +3 -3
- data/vendor/liburing/examples/zcrx.c +5 -5
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/src/include/liburing/io_uring.h +16 -0
- data/vendor/liburing/src/include/liburing.h +20 -4
- data/vendor/liburing/src/lib.h +2 -4
- data/vendor/liburing/src/liburing-ffi.map +7 -0
- data/vendor/liburing/src/liburing.map +7 -0
- data/vendor/liburing/src/register.c +5 -0
- data/vendor/liburing/src/sanitize.c +5 -4
- data/vendor/liburing/src/setup.c +43 -28
- data/vendor/liburing/test/Makefile +7 -0
- data/vendor/liburing/test/cmd-discard.c +2 -2
- data/vendor/liburing/test/evfd-short-read.c +84 -0
- data/vendor/liburing/test/fdinfo-sqpoll.c +117 -0
- data/vendor/liburing/test/fdinfo.c +1 -1
- data/vendor/liburing/test/fixed-buf-merge.c +2 -2
- data/vendor/liburing/test/futex-kill.c +135 -0
- data/vendor/liburing/test/helpers.c +1 -1
- data/vendor/liburing/test/helpers.h +1 -1
- data/vendor/liburing/test/init-mem.c +50 -12
- data/vendor/liburing/test/io_uring_passthrough.c +25 -6
- data/vendor/liburing/test/msg-ring.c +123 -9
- data/vendor/liburing/test/recv-bundle-short-ooo.c +16 -1
- data/vendor/liburing/test/recv-inc-ooo.c +411 -0
- data/vendor/liburing/test/recv-mshot-fair.c +513 -0
- data/vendor/liburing/test/reg-wait.c +14 -14
- data/vendor/liburing/test/send-zerocopy.c +4 -4
- data/vendor/liburing/test/timerfd-short-read.c +81 -0
- data/vendor/liburing/test/timestamp.c +382 -0
- data/vendor/liburing/test/zcrx.c +22 -22
- metadata +222 -2
@@ -0,0 +1,460 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright (c) 2014 Brent Cook
|
4
|
+
#
|
5
|
+
# Permission to use, copy, modify, and distribute this software for any
|
6
|
+
# purpose with or without fee is hereby granted, provided that the above
|
7
|
+
# copyright notice and this permission notice appear in all copies.
|
8
|
+
#
|
9
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
|
17
|
+
set -e
|
18
|
+
|
19
|
+
openbsd_branch=`cat OPENBSD_BRANCH`
|
20
|
+
|
21
|
+
# pull in latest upstream code
|
22
|
+
echo "pulling upstream openbsd source"
|
23
|
+
if [ ! -d openbsd ]; then
|
24
|
+
LIBRESSL_GIT_OPTIONS="${LIBRESSL_GIT_OPTIONS:- --depth=8}"
|
25
|
+
LIBRESSL_GIT="${LIBRESSL_GIT:- https://github.com/libressl}"
|
26
|
+
git clone $LIBRESSL_GIT_OPTIONS $LIBRESSL_GIT/openbsd
|
27
|
+
fi
|
28
|
+
|
29
|
+
# pull either the latest or if on a tag, the matching tag
|
30
|
+
set +e
|
31
|
+
tag=`git describe --exact-match --tags HEAD 2>/dev/null`
|
32
|
+
is_tag=$?
|
33
|
+
# adjust for 9 hour time delta between trees
|
34
|
+
release_ts=$((`git show -s --format=%ct $tag|tail -1` + 32400))
|
35
|
+
commit=`git -C openbsd rev-list -n 1 --before=$release_ts $openbsd_branch`
|
36
|
+
git -C openbsd fetch
|
37
|
+
if [ $is_tag -eq 0 ]; then
|
38
|
+
echo "This is tag $tag, trying OpenBSD tag libressl-$tag"
|
39
|
+
if ! git -C openbsd checkout "libressl-$tag"; then
|
40
|
+
echo "No matching OpenBSD tag found trying nearest commit $commit"
|
41
|
+
git -C openbsd checkout -q $commit
|
42
|
+
fi
|
43
|
+
else
|
44
|
+
echo "Not on a tag, grabbing latest (NOTE: this may be broken from time to time)"
|
45
|
+
git -C openbsd checkout $openbsd_branch
|
46
|
+
git -C openbsd pull
|
47
|
+
fi
|
48
|
+
set -e
|
49
|
+
|
50
|
+
# setup source paths
|
51
|
+
CWD=`pwd`
|
52
|
+
OPENBSD_SRC=$CWD/openbsd/src
|
53
|
+
libc_src=$OPENBSD_SRC/lib/libc
|
54
|
+
libc_regress=$OPENBSD_SRC/regress/lib/libc
|
55
|
+
libcrypto_src=$OPENBSD_SRC/lib/libcrypto
|
56
|
+
libcrypto_regress=$OPENBSD_SRC/regress/lib/libcrypto
|
57
|
+
libssl_src=$OPENBSD_SRC/lib/libssl
|
58
|
+
libssl_regress=$OPENBSD_SRC/regress/lib/libssl
|
59
|
+
libtls_src=$OPENBSD_SRC/lib/libtls
|
60
|
+
libtls_regress=$OPENBSD_SRC/regress/lib/libtls
|
61
|
+
bin_src=$OPENBSD_SRC/usr.bin
|
62
|
+
sbin_src=$OPENBSD_SRC/usr.sbin
|
63
|
+
|
64
|
+
# load library versions
|
65
|
+
. "$libcrypto_src/shlib_version"
|
66
|
+
libcrypto_version=$major:$minor:0
|
67
|
+
echo "libcrypto version $libcrypto_version"
|
68
|
+
echo $libcrypto_version > crypto/VERSION
|
69
|
+
|
70
|
+
. "$libssl_src/shlib_version"
|
71
|
+
libssl_version=$major:$minor:0
|
72
|
+
echo "libssl version $libssl_version"
|
73
|
+
echo $libssl_version > ssl/VERSION
|
74
|
+
|
75
|
+
. "$libtls_src/shlib_version"
|
76
|
+
libtls_version=$major:$minor:0
|
77
|
+
echo "libtls version $libtls_version"
|
78
|
+
echo $libtls_version > tls/VERSION
|
79
|
+
|
80
|
+
do_mv() {
|
81
|
+
if ! cmp -s "$1" "$2"
|
82
|
+
then
|
83
|
+
mv "$1" "$2"
|
84
|
+
else
|
85
|
+
rm -f "$1"
|
86
|
+
fi
|
87
|
+
}
|
88
|
+
MV='do_mv'
|
89
|
+
|
90
|
+
do_cp_libc() {
|
91
|
+
sed "/DEF_WEAK/d" < "$1" > "$2"/`basename "$1"`
|
92
|
+
}
|
93
|
+
CP_LIBC='do_cp_libc'
|
94
|
+
|
95
|
+
CP='cp -p'
|
96
|
+
GREP='grep'
|
97
|
+
if [ -x /opt/csw/bin/ggrep ]; then
|
98
|
+
GREP='/opt/csw/bin/ggrep'
|
99
|
+
fi
|
100
|
+
|
101
|
+
$CP $libcrypto_src/opensslfeatures.h include/openssl
|
102
|
+
$CP $libssl_src/pqueue.h include
|
103
|
+
|
104
|
+
$CP $libtls_src/tls.h include
|
105
|
+
|
106
|
+
for i in crypto/compat; do
|
107
|
+
for j in $libc_src/crypt/arc4random.c \
|
108
|
+
$libc_src/crypt/arc4random_uniform.c \
|
109
|
+
$libc_src/crypt/chacha_private.h \
|
110
|
+
$libc_src/stdlib/reallocarray.c \
|
111
|
+
$libc_src/stdlib/recallocarray.c \
|
112
|
+
$libc_src/stdlib/strtonum.c \
|
113
|
+
$libc_src/string/explicit_bzero.c \
|
114
|
+
$libc_src/string/strcasecmp.c \
|
115
|
+
$libc_src/string/strlcpy.c \
|
116
|
+
$libc_src/string/strlcat.c \
|
117
|
+
$libc_src/string/strndup.c \
|
118
|
+
$libc_src/string/strnlen.c \
|
119
|
+
$libc_src/string/strsep.c \
|
120
|
+
$libc_src/string/timingsafe_bcmp.c \
|
121
|
+
$libc_src/string/timingsafe_memcmp.c \
|
122
|
+
$libcrypto_src/arc4random/getentropy_*.c \
|
123
|
+
$libcrypto_src/arc4random/arc4random_*.h; do
|
124
|
+
$CP_LIBC $j $i
|
125
|
+
done
|
126
|
+
done
|
127
|
+
|
128
|
+
(cd $libcrypto_src/objects/;
|
129
|
+
perl objects.pl objects.txt obj_mac.num obj_mac.h;
|
130
|
+
perl obj_dat.pl obj_mac.h obj_dat.h )
|
131
|
+
mkdir -p include/openssl crypto/objects
|
132
|
+
$MV $libcrypto_src/objects/obj_mac.h ./include/openssl/obj_mac.h
|
133
|
+
$MV $libcrypto_src/objects/obj_dat.h ./crypto/objects/obj_dat.h
|
134
|
+
|
135
|
+
copy_hdrs() {
|
136
|
+
for file in $2; do
|
137
|
+
$CP $1/$file include/openssl
|
138
|
+
done
|
139
|
+
}
|
140
|
+
|
141
|
+
copy_hdrs $libcrypto_src "stack/stack.h lhash/lhash.h stack/safestack.h
|
142
|
+
ossl_typ.h err/err.h crypto.h comp/comp.h x509/x509.h buffer/buffer.h
|
143
|
+
objects/objects.h asn1/asn1.h asn1/posix_time.h bn/bn.h ec/ec.h ecdsa/ecdsa.h
|
144
|
+
ecdh/ecdh.h rsa/rsa.h sha/sha.h x509/x509_vfy.h pkcs7/pkcs7.h pem/pem.h
|
145
|
+
hkdf/hkdf.h hmac/hmac.h rand/rand.h md5/md5.h
|
146
|
+
x509/x509v3.h conf/conf.h ocsp/ocsp.h
|
147
|
+
aes/aes.h modes/modes.h asn1/asn1t.h bf/blowfish.h
|
148
|
+
bio/bio.h cast/cast.h cmac/cmac.h cms/cms.h des/des.h dh/dh.h
|
149
|
+
dsa/dsa.h engine/engine.h ui/ui.h pkcs12/pkcs12.h ts/ts.h
|
150
|
+
md4/md4.h ripemd/ripemd.h idea/idea.h
|
151
|
+
rc2/rc2.h rc4/rc4.h txt_db/txt_db.h
|
152
|
+
sm3/sm3.h sm4/sm4.h chacha/chacha.h evp/evp.h poly1305/poly1305.h
|
153
|
+
camellia/camellia.h curve25519/curve25519.h
|
154
|
+
ct/ct.h kdf/kdf.h"
|
155
|
+
|
156
|
+
copy_hdrs $libssl_src "srtp.h ssl.h ssl3.h tls1.h dtls1.h"
|
157
|
+
|
158
|
+
# override upstream opensslv.h if a local version exists
|
159
|
+
if [ -f patches/opensslv.h ]; then
|
160
|
+
$CP patches/opensslv.h include/openssl
|
161
|
+
else
|
162
|
+
$CP $libcrypto_src/opensslv.h include/openssl
|
163
|
+
fi
|
164
|
+
|
165
|
+
awk '/LIBRESSL_VERSION_TEXT/ {print $4}' < include/openssl/opensslv.h | cut -d\" -f1 | head -n1 > VERSION
|
166
|
+
echo "LibreSSL version `cat VERSION`"
|
167
|
+
|
168
|
+
# copy libcrypto source
|
169
|
+
echo copying libcrypto source
|
170
|
+
rm -f crypto/*.c crypto/*.h
|
171
|
+
touch crypto/empty.c
|
172
|
+
for i in `awk '/SOURCES|HEADERS/ { print $3 }' crypto/Makefile.am` ; do
|
173
|
+
dir=`dirname $i`
|
174
|
+
mkdir -p crypto/$dir
|
175
|
+
if [ $dir != "compat" ]; then
|
176
|
+
if [ -e $libcrypto_src/$i ]; then
|
177
|
+
$CP $libcrypto_src/$i crypto/$i
|
178
|
+
fi
|
179
|
+
fi
|
180
|
+
done
|
181
|
+
|
182
|
+
for i in $libcrypto_src/arch/*; do
|
183
|
+
arch=`basename $i`
|
184
|
+
mkdir -p include/arch/$arch
|
185
|
+
$CP $libcrypto_src/arch/$arch/opensslconf.h include/arch/$arch/
|
186
|
+
mkdir -p crypto/arch/$arch
|
187
|
+
$CP $libcrypto_src/arch/$arch/crypto_arch.h crypto/arch/$arch/
|
188
|
+
crypto_cpu_caps=$libcrypto_src/arch/$arch/crypto_cpu_caps.c
|
189
|
+
if [ -f "$crypto_cpu_caps" ]; then
|
190
|
+
$CP "$crypto_cpu_caps" crypto/arch/$arch/
|
191
|
+
fi
|
192
|
+
done
|
193
|
+
|
194
|
+
for i in $libcrypto_src/bn/arch/*; do
|
195
|
+
arch=`basename $i`
|
196
|
+
mkdir -p crypto/bn/arch/$arch
|
197
|
+
$CP $libcrypto_src/bn/arch/$arch/* crypto/bn/arch/$arch/
|
198
|
+
done
|
199
|
+
|
200
|
+
$CP crypto/compat/b_win.c crypto/bio
|
201
|
+
$CP crypto/compat/ui_openssl_win.c crypto/ui
|
202
|
+
# add the libcrypto symbol export list
|
203
|
+
$GREP -v OPENSSL_ia32cap_P $libcrypto_src/Symbols.list | $GREP '^[A-Za-z0-9_]' > crypto/crypto.sym
|
204
|
+
|
205
|
+
fixup_masm() {
|
206
|
+
cpp -I./crypto -I./include/compat -D_MSC_VER -U__CET__ $1 \
|
207
|
+
| sed -e 's/^#/;/' \
|
208
|
+
| sed -e 's/|/OR/g' \
|
209
|
+
| sed -e 's/~/NOT/g' \
|
210
|
+
| sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \
|
211
|
+
> $2
|
212
|
+
}
|
213
|
+
|
214
|
+
# generate assembly crypto algorithms
|
215
|
+
asm_src=$libcrypto_src
|
216
|
+
|
217
|
+
gen_asm_stdout() {
|
218
|
+
CC=true perl $asm_src/$2 $1 > crypto/$3.tmp
|
219
|
+
[ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp
|
220
|
+
#if defined(HAVE_GNU_STACK)
|
221
|
+
.section .note.GNU-stack,"",%progbits
|
222
|
+
#endif
|
223
|
+
EOF
|
224
|
+
if [ $1 = "masm" ]; then
|
225
|
+
fixup_masm crypto/$3.tmp crypto/$3
|
226
|
+
rm crypto/$3.tmp
|
227
|
+
else
|
228
|
+
$MV crypto/$3.tmp crypto/$3
|
229
|
+
fi
|
230
|
+
}
|
231
|
+
|
232
|
+
gen_asm_mips() {
|
233
|
+
abi=$1
|
234
|
+
dir=$2
|
235
|
+
src=$3
|
236
|
+
dst=$4
|
237
|
+
CC=true perl $asm_src/$dir/asm/$src.pl $abi $dst.S
|
238
|
+
cat <<-EOF >> $dst.S
|
239
|
+
#if defined(HAVE_GNU_STACK)
|
240
|
+
.section .note.GNU-stack,"",%progbits
|
241
|
+
#endif
|
242
|
+
EOF
|
243
|
+
mv $dst.S crypto/$dir/$dst.S
|
244
|
+
}
|
245
|
+
|
246
|
+
gen_asm() {
|
247
|
+
CC=true perl $asm_src/$2 $1 crypto/$3.tmp
|
248
|
+
[ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp
|
249
|
+
#if defined(HAVE_GNU_STACK)
|
250
|
+
.section .note.GNU-stack,"",%progbits
|
251
|
+
#endif
|
252
|
+
EOF
|
253
|
+
if [ $1 = "masm" ]; then
|
254
|
+
fixup_masm crypto/$3.tmp crypto/$3
|
255
|
+
rm crypto/$3.tmp
|
256
|
+
else
|
257
|
+
$MV crypto/$3.tmp crypto/$3
|
258
|
+
fi
|
259
|
+
}
|
260
|
+
|
261
|
+
echo generating mips ASM source for elf
|
262
|
+
gen_asm_mips o32 aes aes-mips aes-mips
|
263
|
+
gen_asm_mips o32 bn mips bn-mips
|
264
|
+
gen_asm_mips o32 bn mips-mont mont-mips
|
265
|
+
gen_asm_mips o32 sha sha1-mips sha1-mips
|
266
|
+
gen_asm_mips o32 sha sha512-mips sha256-mips
|
267
|
+
gen_asm_mips o32 sha sha512-mips sha512-mips
|
268
|
+
|
269
|
+
echo generating mips64 ASM source for elf
|
270
|
+
gen_asm_mips 64 aes aes-mips aes-mips64
|
271
|
+
gen_asm_mips 64 bn mips bn-mips64
|
272
|
+
gen_asm_mips 64 bn mips-mont mont-mips64
|
273
|
+
gen_asm_mips 64 sha sha1-mips sha1-mips64
|
274
|
+
gen_asm_mips 64 sha sha512-mips sha256-mips64
|
275
|
+
gen_asm_mips 64 sha sha512-mips sha512-mips64
|
276
|
+
|
277
|
+
for abi in elf macosx masm mingw64; do
|
278
|
+
echo generating x86_64 ASM source for $abi
|
279
|
+
|
280
|
+
gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S
|
281
|
+
gen_asm_stdout $abi aes/asm/aesni-x86_64.pl aes/aesni-$abi-x86_64.S
|
282
|
+
gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl bn/modexp512-$abi-x86_64.S
|
283
|
+
gen_asm_stdout $abi bn/asm/x86_64-mont.pl bn/mont-$abi-x86_64.S
|
284
|
+
gen_asm_stdout $abi bn/asm/x86_64-mont5.pl bn/mont5-$abi-x86_64.S
|
285
|
+
gen_asm_stdout $abi modes/asm/ghash-x86_64.pl modes/ghash-$abi-x86_64.S
|
286
|
+
gen_asm_stdout $abi rc4/asm/rc4-x86_64.pl rc4/rc4-$abi-x86_64.S
|
287
|
+
done
|
288
|
+
|
289
|
+
# copy libtls source
|
290
|
+
echo copying libtls source
|
291
|
+
rm -f tls/*.c tls/*.h libtls/src/*.c libtls/src/*.h
|
292
|
+
touch tls/empty.c
|
293
|
+
for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
|
294
|
+
if [ -e $libtls_src/$i ]; then
|
295
|
+
$CP $libtls_src/$i tls
|
296
|
+
fi
|
297
|
+
done
|
298
|
+
# add the libtls symbol export list
|
299
|
+
$GREP '^[A-Za-z0-9_]' < $libtls_src/Symbols.list > tls/tls.sym
|
300
|
+
|
301
|
+
# copy nc(1) source
|
302
|
+
echo "copying nc(1) source"
|
303
|
+
$CP $bin_src/nc/nc.1 apps/nc
|
304
|
+
rm -f apps/nc/*.c apps/nc/*.h
|
305
|
+
$CP_LIBC $libc_src/net/base64.c apps/nc/compat
|
306
|
+
for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/nc/Makefile.am` ; do
|
307
|
+
if [ -e $bin_src/nc/$i ]; then
|
308
|
+
$CP $bin_src/nc/$i apps/nc
|
309
|
+
fi
|
310
|
+
done
|
311
|
+
|
312
|
+
# copy ocspcheck(1) source
|
313
|
+
echo "copying ocspcheck(1) source"
|
314
|
+
$CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck
|
315
|
+
rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h
|
316
|
+
$CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat
|
317
|
+
for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do
|
318
|
+
if [ -e $sbin_src/ocspcheck/$i ]; then
|
319
|
+
$CP $sbin_src/ocspcheck/$i apps/ocspcheck
|
320
|
+
fi
|
321
|
+
done
|
322
|
+
|
323
|
+
# copy openssl(1) source
|
324
|
+
echo "copying openssl(1) source"
|
325
|
+
$CP $bin_src/openssl/openssl.1 apps/openssl
|
326
|
+
$CP $libcrypto_src/cert.pem .
|
327
|
+
$CP $libcrypto_src/openssl.cnf .
|
328
|
+
$CP $libcrypto_src/x509v3.cnf .
|
329
|
+
for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/openssl/Makefile.am` ; do
|
330
|
+
if [ -e $bin_src/openssl/$i ]; then
|
331
|
+
$CP $bin_src/openssl/$i apps/openssl
|
332
|
+
fi
|
333
|
+
done
|
334
|
+
|
335
|
+
# copy libssl source
|
336
|
+
echo "copying libssl source"
|
337
|
+
rm -f ssl/*.c ssl/*.h
|
338
|
+
touch ssl/empty.c
|
339
|
+
for i in `awk '/SOURCES|HEADERS/ { if ($3 !~ /.*crypto_arch.*/) print $3 }' ssl/Makefile.am` ; do
|
340
|
+
dir=`dirname $i`
|
341
|
+
mkdir -p ssl/$dir
|
342
|
+
$CP $libssl_src/$i ssl/$i
|
343
|
+
done
|
344
|
+
# add the libssl symbol export list
|
345
|
+
$GREP '^[A-Za-z0-9_]' < $libssl_src/Symbols.list > ssl/ssl.sym
|
346
|
+
|
347
|
+
# copy libcrypto tests
|
348
|
+
echo "copying tests"
|
349
|
+
touch tests/empty.c
|
350
|
+
for i in `find $libcrypto_regress -name '*.[ch]'`; do
|
351
|
+
$CP "$i" tests
|
352
|
+
done
|
353
|
+
$CP $libcrypto_regress/evp/evptests.txt tests
|
354
|
+
$CP $libcrypto_regress/aead/*.txt tests
|
355
|
+
$CP $libcrypto_regress/ct/ctlog.conf tests
|
356
|
+
$CP $libcrypto_regress/ct/*.crt tests
|
357
|
+
$CP $libcrypto_regress/x509/policy/*.pem tests
|
358
|
+
$CP $libcrypto_regress/mlkem/*.txt tests
|
359
|
+
|
360
|
+
# generate libcrypto freenull.c
|
361
|
+
awk -f $libcrypto_regress/free/freenull.awk \
|
362
|
+
< $libcrypto_src/Symbols.list > tests/freenull.c.body
|
363
|
+
cat $libcrypto_regress/free/freenull.c.head tests/freenull.c.body \
|
364
|
+
$libcrypto_regress/free/freenull.c.tail > tests/freenull.c.tmp
|
365
|
+
$MV tests/freenull.c.tmp tests/freenull.c
|
366
|
+
|
367
|
+
# copy libc tests
|
368
|
+
$CP $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c
|
369
|
+
$CP $libc_regress/explicit_bzero/explicit_bzero.c tests
|
370
|
+
$CP_LIBC $libc_src/string/memmem.c tests/compat
|
371
|
+
$CP $libc_regress/timingsafe/timingsafe.c tests
|
372
|
+
|
373
|
+
# copy libssl tests
|
374
|
+
$CP $libssl_regress/ssl/testssl tests
|
375
|
+
for i in `find $libssl_regress -name '*.c'`; do
|
376
|
+
$CP "$i" tests
|
377
|
+
done
|
378
|
+
$CP $libssl_regress/unit/tests.h tests
|
379
|
+
$CP $libssl_regress/certs/*.pem tests
|
380
|
+
$CP $libssl_regress/certs/*.crl tests
|
381
|
+
|
382
|
+
# copy libtls tests
|
383
|
+
for i in `find $libtls_regress -name '*.c'`; do
|
384
|
+
$CP "$i" tests
|
385
|
+
done
|
386
|
+
|
387
|
+
chmod 755 tests/testssl
|
388
|
+
|
389
|
+
# add headers
|
390
|
+
(cd include/openssl
|
391
|
+
$CP Makefile.am.tpl Makefile.am
|
392
|
+
for i in `ls -1 *.h|sort`; do
|
393
|
+
echo "opensslinclude_HEADERS += $i" >> Makefile.am
|
394
|
+
done
|
395
|
+
echo endif >> Makefile.am
|
396
|
+
)
|
397
|
+
|
398
|
+
add_man_links() {
|
399
|
+
filter=$1
|
400
|
+
dest=$2
|
401
|
+
echo "install-data-hook:" >> $dest
|
402
|
+
for i in `$GREP $filter man/links`; do
|
403
|
+
IFS=","; set $i; unset IFS
|
404
|
+
if [ "$2" != "" ]; then
|
405
|
+
echo " ln -sf \"$1\" \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest
|
406
|
+
fi
|
407
|
+
done
|
408
|
+
echo "" >> $dest
|
409
|
+
echo "uninstall-local:" >> $dest
|
410
|
+
for i in `$GREP $filter man/links`; do
|
411
|
+
IFS=","; set $i; unset IFS
|
412
|
+
if [ "$2" != "" ]; then
|
413
|
+
echo " -rm -f \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest
|
414
|
+
fi
|
415
|
+
done
|
416
|
+
}
|
417
|
+
|
418
|
+
# apply local patches
|
419
|
+
PATCH=patch
|
420
|
+
# Prefer gnu patch on AIX systems, if available
|
421
|
+
if [ -x /opt/freeware/bin/patch ]; then
|
422
|
+
PATCH=/opt/freeware/bin/patch
|
423
|
+
fi
|
424
|
+
for i in patches/*.patch; do
|
425
|
+
$PATCH -p0 < $i
|
426
|
+
done
|
427
|
+
|
428
|
+
# copy manpages
|
429
|
+
echo "copying manpages"
|
430
|
+
echo EXTRA_DIST = CMakeLists.txt > man/Makefile.am
|
431
|
+
echo "if !ENABLE_LIBTLS_ONLY" >> man/Makefile.am
|
432
|
+
echo dist_man3_MANS = >> man/Makefile.am
|
433
|
+
echo dist_man5_MANS = >> man/Makefile.am
|
434
|
+
(cd man
|
435
|
+
for i in `ls -1 $libssl_src/man/*.3 | sort`; do
|
436
|
+
NAME=`basename "$i"`
|
437
|
+
$CP $i .
|
438
|
+
echo "dist_man3_MANS += $NAME" >> Makefile.am
|
439
|
+
done
|
440
|
+
|
441
|
+
for i in `ls -1 $libcrypto_src/man/*.3 | sort`; do
|
442
|
+
NAME=`basename "$i"`
|
443
|
+
$CP $i .
|
444
|
+
echo "dist_man3_MANS += $NAME" >> Makefile.am
|
445
|
+
done
|
446
|
+
|
447
|
+
for i in `ls -1 $libtls_src/man/*.3 | sort`; do
|
448
|
+
NAME=`basename "$i"`
|
449
|
+
$CP $i .
|
450
|
+
echo "dist_man3_MANS += $NAME" >> Makefile.am
|
451
|
+
done
|
452
|
+
|
453
|
+
for i in `ls -1 $libcrypto_src/man/*.5 | sort`; do
|
454
|
+
NAME=`basename "$i"`
|
455
|
+
$CP $i .
|
456
|
+
echo "dist_man5_MANS += $NAME" >> Makefile.am
|
457
|
+
done
|
458
|
+
)
|
459
|
+
add_man_links . man/Makefile.am
|
460
|
+
echo endif >> man/Makefile.am
|
data/vendor/liburing/configure
CHANGED
@@ -596,8 +596,28 @@ typedef int __kernel_rwf_t;
|
|
596
596
|
|
597
597
|
EOF
|
598
598
|
fi
|
599
|
+
|
600
|
+
cat >> $compat_h << EOF
|
601
|
+
#if defined(__has_include)
|
602
|
+
/* introduced in C++17 & C23 */
|
603
|
+
/* quotes "" quotes needed for GCC < 10 */
|
604
|
+
#if __has_include("linux/time_types.h")
|
605
|
+
#include <linux/time_types.h>
|
606
|
+
#else
|
607
|
+
struct __kernel_timespec {
|
608
|
+
int64_t tv_sec;
|
609
|
+
long long tv_nsec;
|
610
|
+
};
|
611
|
+
#endif
|
612
|
+
|
613
|
+
#define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1
|
614
|
+
#endif
|
615
|
+
|
616
|
+
EOF
|
617
|
+
|
599
618
|
if test "$__kernel_timespec" != "yes"; then
|
600
619
|
cat >> $compat_h << EOF
|
620
|
+
#if !defined(__has_include)
|
601
621
|
#include <stdint.h>
|
602
622
|
|
603
623
|
struct __kernel_timespec {
|
@@ -607,14 +627,15 @@ struct __kernel_timespec {
|
|
607
627
|
|
608
628
|
/* <linux/time_types.h> is not available, so it can't be included */
|
609
629
|
#define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1
|
610
|
-
|
630
|
+
#endif
|
611
631
|
EOF
|
612
632
|
else
|
613
633
|
cat >> $compat_h << EOF
|
634
|
+
#if !defined(__has_include)
|
614
635
|
#include <linux/time_types.h>
|
615
636
|
/* <linux/time_types.h> is included above and not needed again */
|
616
637
|
#define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1
|
617
|
-
|
638
|
+
#endif
|
618
639
|
EOF
|
619
640
|
fi
|
620
641
|
if test "$open_how" != "yes"; then
|
@@ -13,7 +13,7 @@ int setup_listening_socket(int port, int ipv6);
|
|
13
13
|
* To avoid making large changes in tests, define a helper
|
14
14
|
* function that wraps posix_memalign as our own aligned_alloc.
|
15
15
|
*/
|
16
|
-
void *
|
16
|
+
void *t_aligned_alloc(size_t alignment, size_t size);
|
17
17
|
|
18
18
|
void t_error(int status, int errnum, const char *format, ...);
|
19
19
|
|
@@ -45,10 +45,10 @@ static int register_memory(struct io_uring *ring, void *ptr, size_t size)
|
|
45
45
|
struct io_uring_region_desc rd = {};
|
46
46
|
struct io_uring_mem_region_reg mr = {};
|
47
47
|
|
48
|
-
rd.user_addr = (
|
48
|
+
rd.user_addr = uring_ptr_to_u64(ptr);
|
49
49
|
rd.size = size;
|
50
50
|
rd.flags = IORING_MEM_REGION_TYPE_USER;
|
51
|
-
mr.region_uptr = (
|
51
|
+
mr.region_uptr = uring_ptr_to_u64(&rd);
|
52
52
|
mr.flags = IORING_MEM_REGION_REG_WAIT_ARG;
|
53
53
|
|
54
54
|
return io_uring_register_region(ring, &mr);
|
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
|
93
93
|
* page aligned, we're using only first two wait entries here and
|
94
94
|
* the rest of the memory can be reused for other purposes.
|
95
95
|
*/
|
96
|
-
reg =
|
96
|
+
reg = t_aligned_alloc(page_size, page_size);
|
97
97
|
if (!reg) {
|
98
98
|
fprintf(stderr, "allocation failed\n");
|
99
99
|
return 1;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
// SPDX-License-Identifier: GPL-2.0
|
2
2
|
#include <assert.h>
|
3
3
|
#include <errno.h>
|
4
|
-
#include <error.h>
|
5
4
|
#include <fcntl.h>
|
6
5
|
#include <limits.h>
|
7
6
|
#include <stdbool.h>
|
@@ -11,6 +10,7 @@
|
|
11
10
|
#include <string.h>
|
12
11
|
#include <unistd.h>
|
13
12
|
#include <stdarg.h>
|
13
|
+
#include <time.h>
|
14
14
|
|
15
15
|
#include <arpa/inet.h>
|
16
16
|
#include <linux/errqueue.h>
|
@@ -163,7 +163,7 @@ static void zcrx_populate_area(struct io_uring_zcrx_area_reg *area_reg)
|
|
163
163
|
t_error(1, 0, "mmap(): area allocation failed");
|
164
164
|
|
165
165
|
memset(area_reg, 0, sizeof(*area_reg));
|
166
|
-
area_reg->addr = (
|
166
|
+
area_reg->addr = uring_ptr_to_u64(area_ptr);
|
167
167
|
area_reg->len = AREA_SIZE;
|
168
168
|
area_reg->flags = 0;
|
169
169
|
}
|
@@ -194,7 +194,7 @@ static void setup_zcrx(struct io_uring *ring)
|
|
194
194
|
|
195
195
|
struct io_uring_region_desc region_reg = {
|
196
196
|
.size = ring_size,
|
197
|
-
.user_addr = (
|
197
|
+
.user_addr = uring_ptr_to_u64(ring_ptr),
|
198
198
|
.flags = rq_flags,
|
199
199
|
};
|
200
200
|
|
@@ -204,8 +204,8 @@ static void setup_zcrx(struct io_uring *ring)
|
|
204
204
|
.if_idx = ifindex,
|
205
205
|
.if_rxq = cfg_queue_id,
|
206
206
|
.rq_entries = rq_entries,
|
207
|
-
.area_ptr = (
|
208
|
-
.region_ptr = (
|
207
|
+
.area_ptr = uring_ptr_to_u64(&area_reg),
|
208
|
+
.region_ptr = uring_ptr_to_u64(®ion_reg),
|
209
209
|
};
|
210
210
|
|
211
211
|
ret = io_uring_register_ifq(ring, ®);
|
@@ -915,6 +915,22 @@ enum io_uring_socket_op {
|
|
915
915
|
SOCKET_URING_OP_SIOCOUTQ,
|
916
916
|
SOCKET_URING_OP_GETSOCKOPT,
|
917
917
|
SOCKET_URING_OP_SETSOCKOPT,
|
918
|
+
SOCKET_URING_OP_TX_TIMESTAMP,
|
919
|
+
};
|
920
|
+
|
921
|
+
/*
|
922
|
+
* SOCKET_URING_OP_TX_TIMESTAMP definitions
|
923
|
+
*/
|
924
|
+
|
925
|
+
#define IORING_TIMESTAMP_HW_SHIFT 16
|
926
|
+
/* The cqe->flags bit from which the timestamp type is stored */
|
927
|
+
#define IORING_TIMESTAMP_TYPE_SHIFT (IORING_TIMESTAMP_HW_SHIFT + 1)
|
928
|
+
/* The cqe->flags flag signifying whether it's a hardware timestamp */
|
929
|
+
#define IORING_CQE_F_TSTAMP_HW ((__u32)1 << IORING_TIMESTAMP_HW_SHIFT)
|
930
|
+
|
931
|
+
struct io_timespec {
|
932
|
+
__u64 tv_sec;
|
933
|
+
__u64 tv_nsec;
|
918
934
|
};
|
919
935
|
|
920
936
|
/* Zero copy receive refill queue entry */
|