Building sunrpc from glibc source

Ian Kent ikent@redhat.com
Sat Aug 7 00:27:22 GMT 2021


On 6/8/21 8:07 pm, Ian Kent wrote:
> On 6/8/21 7:12 am, Binello, Severino via Libc-alpha wrote:
>> Hello
>>
>>    As of RedHat 8, the sunrpc is no longer included with glibc shared 
>> object library.
>> Unfortunately, our communications software would require extensive 
>> redesign in order to use tirpc.
>
> For example?
>
> Can you describe the sort of challenges you have doing this please.
>
>
>> As such, we are looking into an alternative approach where we just 
>> build the sunrpc portion from the glibc source tar file.
>> However, running into difficulties separating it out.
>> Can you recommend a method for just building the sunrpc code ?
>
> It's worth understanding what might be needed in order to use libtirpc
>
> first.
>
>
>>
>> Thanks Much
>> -Sev
>>
>> ps: Below is the reason why our code is incompatible with the tirpc 
>> design
>> with old glibc every RPC server runs in its own thread,
>> with tirpc library there can be only one RPC server per program.
>> See:
>> from svc.c of tirpc library:
>>
>> static struct svc_callout /* removed declaration */ *svc_head;
>>
>> from svc.c of glibc-2.25:
>>
>> #ifdef _RPC_THREAD_SAFE_
>> #define svc_head RPC_THREAD_VARIABLE(svc_head_s)
>> #else
>> static struct svc_callout *svc_head;
>> #endif
>>
>> As you can see, if RPC_THREAD_SAFE_ is defined,
>> svc_head is per thread variable.
>
> I think I have some quick and nasty multi-thread libtirpc svc code
>
> kicking around somewhere (if I can find it now). It might be worth
>
> cleaning that up and maybe enhancing it a little, or maybe it's broken
>
> I don't know, but I'd recommend looking at that first, if there's not
>
> to many other problems to deal with.

Actually it looks like this was multi-threaded io not multi-threaded 
servers.


But I'm not sure that you can't register multiple services in both glibc

and libtirpc, it's just that it's not thread safe to do so in glibc.


Maybe I don't understand what your doing, explain it please.


Why do you need a separate services list for each thread rather than a

library global lock protected services list as in libtirpc?


Ian



More information about the Libc-alpha mailing list