Tss2_TctiLdr_GetInfo(3)
π Tss2_TctiLdr_GetInfo(3) π
okay bestie, welcome to the Library Functions Manual corner of the internet, where we ask the TctiLdr library politely (or not so politely) to hand over the TSS2_TCTI_INFO struct for a TCTI library. this is Tss2_TctiLdr_GetInfo, and she is iconic. let's get into it π¦
β¨ NAME β¨
Tss2_TctiLdr_GetInfo β query the TctiLdr library for the TSS2_TCTI_INFO structure that's associated with a TCTI library. that's the whole gig. she's a looker-upper π
πΈ SYNOPSIS πΈ
#include <tss2/tss2_tctildr.h>
TSS2_RC Tss2_TctiLdr_GetInfo (constchar *name", TSS2_TCTI_INFO **info);
yes babe, that really is how it's printed, character for character. i don't make the rules, i just serve the vibes β¨
π DESCRIPTION π
so Tss2_TctiLdr_GetInfo() tries to instantiate a TSS2_TCTI_INFO structure that fits the TCTI library tied to the name you hand her. and heads up: the TSS2_TCTI_INFO* reference she gives back? you have to free it yourself with the Tss2_TctiLdr_FreeInfo () function. no ghosting, no leaking, we are responsible queens π«Ά
the name parameter is a C string. if that string is NULL, the library picks a default TCTI for you β and it's literally the same TCTI library that gets used to initialize the context returned by Tss2_TctiLdr_Initialize when you pass it a NULL name. consistency, we love to see it. if name is non-NULL, then Tss2_TctiLdr_GetInfo () uses the exact same algorithm to map that string to the name of an installed TCTI library as Tss2_TctiLdr_Initialize () does. same brain, same algorithm π§
the info parameter is a reference to a TSS2_TCTI_INFO*. the reference that comes back is allocated by the function, and yeah β the caller has to free it. that's you. that's your job now. main character responsibility π
β RETURN VALUE β
a successful call returns TSS2_RC_SUCCESS. an unsuccessful call returns a response code, and those are all listed right below in ERRORS. no mystery, no cliffhanger π
π ERRORS π
TSS2_TCTI_RC_MEMORYβ comes back if memory allocation fails. the malloc said no πTSS2_TCTI_RC_NOT_SUPPORTEDβ comes back when the loader literally cannot locate a TCTI library with the name you provided. she looked everywhere bestie πTSS2_TCTI_RC_IO_ERRORβ comes back if something goes wrong down in the underlying library loading mechanism. it's giving plumbing problems π₯TSS2_TCTI_RC_BAD_REFERENCEβ comes back if theinfoparameter isNULL. bestie. you have to actually give her somewhere to put it π
π EXAMPLE π
example code. yes, verbatim, every character, we do not touch the sacred text β¨
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <tss2/tss2_tctildr.h>
TSS2_TCTI_INFO *info = NULL;
TSS2_RC rc = Tss2_TctiLdr_GetInfo (NULL, &info);
if (rc != TSS2_RC_SUCCESS) {
fprintf (stderr, "Initialization of default TCTI context failed with "
"response code: 0x%" PRIx32 "0, rc);
exit (EXIT_FAILURE);
}
if (info != NULL) {
Tss2_TctiLdr_FreeInfo (info);
info = NULL;
}
exit (EXIT_SUCCESS);
see how she frees the info and then nulls it out? that's the self-care we're talking about π
π AUTHOR π
TPM2 Software Project <https://github.com/tpm2-software/tpm2-tss>
the icons who wrote her π
π SEE ALSO π
Tss2_Tcti_Device_Init(3)Tss2_Tcti_Socket_Init(3)Tss2_TctiLdr_Initialize(3)Tss2_TctiLdr_Finalize(3)tcti-device(7)tcti-socket(7)tcti-tabrmd(7)tpm2-abrmd(8)
the whole friend group, go say hi π«Ά
π§ COLOPHON π§
this page is part of release 4.2.0 of Open Source implementation of the TCG TPM2 Software Stack (TSS2). a description of the project, info about reporting bugs, and the latest version of this page all live at <https://github.com/tpm2-software/tpm2-tss/>.
π LICENSE π
this work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). for more information visit <https://creativecommons.org/licenses/by/4.0/>
and that's the whole page bestie β brought to you by the TPM2 Software Stack, dated JUNE 2019. she's been slaying since 2019 and she will keep slaying. mwah π π
π¦ where this page comes from
- arch rolling: tpm2-tss 4.2.0-2 Β· BSD-2-Clause
- nixos 26.05: tpm2-tss 4.2.0
- nixpkgs unstable: tpm2-tss 4.2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms