aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-03-07 13:53:27 +0000
committerMark Johnston <markj@FreeBSD.org>2022-03-07 15:43:19 +0000
commita6fb86917362e3f6d24e95e940e80845c2cfde8a (patch)
treefbfe6221d83ac500fa627b8a38b7f345c3532d96 /cddl/contrib/opensolaris/lib
parent8dbae4ce32bde42daee050ccfceee5eb2d306786 (diff)
downloadsrc-a6fb86917362e3f6d24e95e940e80845c2cfde8a.tar.gz
src-a6fb86917362e3f6d24e95e940e80845c2cfde8a.zip
libctf: Handle CTFv3 containers
In general, the patch adds indirection to minimize the amount of code that needs to know about differences between v2 and v3. Specifically, some new ctf_get_ctt_* functions are added, and new LCTF_* macros are added to use the underlying container's version to do the right thing. CTF containers can have parent/child relationships, wherein a type ID in one container refers to a type in the parent. It is permitted for the parent and child to have different versions. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34363
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-rw-r--r--cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
index f48c09cce0e2..e1ba993a09a9 100644
--- a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
+++ b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
@@ -245,7 +245,8 @@ ctf_fdopen(int fd, int *errp)
*/
if (nbytes >= (ssize_t) sizeof (ctf_preamble_t) &&
hdr.ctf.ctp_magic == CTF_MAGIC) {
- if (hdr.ctf.ctp_version > CTF_VERSION)
+ if (hdr.ctf.ctp_version != CTF_VERSION_2 &&
+ hdr.ctf.ctp_version != CTF_VERSION_3)
return (ctf_set_open_errno(errp, ECTF_CTFVERS));
ctfsect.cts_data = mmap64(NULL, st.st_size, PROT_READ,