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

Davide Madrisan <[email protected]>
Newsgroups gmane.linux.procps.devel
Message-ID <CAFjCWUPLWyjZmSDtxYcC5VKYLWJ3UEfji8uaJg6vxwXPgRJBmg@mail.gmail.com>
Thanks for your reply.
Actually I ended up using the new API which is undoubtedly a big
enhancement and very easy to understand and link to.
Great job! I can't wait for it to be published as a stable release.

Cheers,
Davide

Il giorno lun 18 mag 2020 alle ore 12:23 Craig Small <[email protected]>
ha scritto:

> 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
>>
>

-- 
Cordialement, Best regards, Distinti saluti
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.