diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-03-07 13:53:27 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-03-07 15:43:19 +0000 |
commit | a6fb86917362e3f6d24e95e940e80845c2cfde8a (patch) | |
tree | fbfe6221d83ac500fa627b8a38b7f345c3532d96 /cddl/contrib/opensolaris/lib/libctf/common | |
parent | 8dbae4ce32bde42daee050ccfceee5eb2d306786 (diff) | |
download | src-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/libctf/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c | 3 |
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, |