Re: limited usability of the library libprocps from an external software

Craig Small <[email protected]>
Newsgroups gmane.linux.procps.devel
Message-ID <CALy8Cw4U_VNWgsFRs168kd9jZth64__EGFgbZjg04JK7_KPJCw@mail.gmail.com>
Hi Davide,
  You're absolutely right that the library could export more. We are
working on a new API that both exposes more variables and is expandable so
we don't need to bump the API each time we add something.  It's getting
there but taking some time to get to where we want it to be.

 - Craig


On Sun, 10 May 2020 at 23:34, Davide Madrisan <[email protected]>
wrote:

> Hello Craig,
>
> the library libprocps exports a limited set of symbols and this, in my
> opinion, limits a lot its usability.
> A simple PoC follows:
>
>     $ cat procpsng_poc.c
>     #include <stdio.h>
>     #include <proc/sysinfo.h>
>
>     int
>     main ()
>     {
>       meminfo ();
>       printf ("kb_dirty: %lu\n", kb_dirty);
>       return 0;
>     }
>
>     $ gcc -Wall procpsng_poc.c -o procpsng_poc -lprocps
>     /usr/bin/ld: /tmp/cc7MZSOM.o: in function `main':
>     procpsng_poc.c:(.text+0x25): undefined reference to `kb_dirty'
>     collect2: error: ld returned 1 exit status
>
> Why for instance "kb_main_total" is listed in proc/libprocps.sym but not
> "kb_dirty"?
>
> I think several objects declared as extern in proc/sysinfo.h should be
> exported too:
>   * all the missing kb_* ones,
>   * vminfo
>   * the vm_nr_* variables.
>
> And maybe other interesting variables declared in the other pubic headers,
>
> What do you think?
> Should I open an issue on GitLab? Create a patch?
>
> Take care.
> ---
> Davide Madrisan
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.