[openbeosnetteam] Re: R5 compatibility and libnetapi.so

Hi,

On 2006-10-05 at 16:41:10 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> 
> I'm currently investigating our previous R5 compatibility layer, and
> wanted to ask what kind of solution you would prefer for us. The
> options are:
> 
> a) Keep a libnet.so around that exports all the needed symbols and just
> always converts all calls.
> b) Link libnet.so to libnetwork.so (as done with libbind.so and
> libsocket.so), and determine at runtime if the compatibility layer
> should be used or not.
> 
> a) would have the benefit that a BONE application that loads a
> net_server add-on would still work; but since this is a very
> constructed example, I don't know if that should really matter.

Hm, why would that be the case? Because the check you proposed for option b) 
would fail for an add-on?

> b) would be much easier to do and reduce the network related libraries
> a bit more.

Yes, that sounds better, but...

> I'm also thinking about moving libnetapi.so (and libbnetapi.so) into
> libnetwork.so as well.
> 
> About b): am I right that only calls to socket(), setsockopt(), ...
> including sockaddr_ins need to be converted? Do you have any indication
> that checking against being linked against "libnet.so" is not an
> unambiguous sign of activating the compatibility layer?

...I think I would not consider it fine behaviour if I write a networking 
program (using haiku's API) and have it crash simply because I forgot to 
remove the '-lnet' that I forgot to remove from my Makefile. 
In that case (and for a C-program only), the runtime check would trigger the 
conversion from old to new API, although the program is in fact using the new 
API, right?

cheers,
        Oliver

Other related posts: