Hi, Recently I am working with dlinfo and from my understanding of the use of RTLD_DI_SERINFO in [dlinfo](https://man7.org/linux/man-pages/man3/dlinfo.3.html), the first call gives dls_size value that helps ensure the struct is large enough, but the second call is seemly doing nothing new but repeating computation of first call to fill out the two fields dls_size and dls_cnt. Besides, from the [code called](https://elixir.bootlin.com/glibc/glibc-2.37.9000/source/elf/dl-load.c#L2298) by the dlopen [interface](https://elixir.bootlin.com/glibc/glibc-2.37.9000/source/dlfcn/dlinfo.c#L63), I am unable to locate some code distinguishing the two calls and therefore my question is whether this two-step call sequence is something really necessary, or is it already enough to just copy over the stats like cnt and size, through, for example, having a new request item called RTLD_DI_SERINFOSIZE_COPY to provide some forward compatibility from library authors’ viewpoint. As a running example, the following code prints two exact same line on my machine. ```c Dl_serinfo dl_search_size; if (dlinfo(dl_handle, RTLD_DI_SERINFOSIZE, &dl_search_size)) { printf("dlinfo: %s while populating search info size", dlerror()); return; } printf("%d %ld\n", dl_search_size.dls_cnt, dl_search_size.dls_size); Dl_serinfo *dl_search_info = (Dl_serinfo *)malloc(dl_search_size.dls_size); if (!dl_search_info) { perror("malloc"); return; } if (dlinfo(dl_handle, RTLD_DI_SERINFOSIZE, dl_search_info)) { printf("dlinfo: %s while ", dlerror()); return; } printf("%d %ld\n", dl_search_info->dls_cnt, dl_search_info->dls_size); ``` Thanks a lot for your attention and hope you a great day. Best, Qixing