The R5 compatibility is now turned off when the socket functions are used

within the library - theoretically, this mechanism could be extended to
turn the compatibility layer on and off based on the images that call the
functions (allowing to mix R5 and BONE network add-ons in a single executable).
This change fixes R5 networking apps such as Vision, and NetworkTime (both
now seem to work fine under Haiku).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19431 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-12-05 03:03:15 +00:00
parent 40eb4ed30d
commit bcb0dd2b3b
3 changed files with 65 additions and 14 deletions
+21
View File
@@ -16,6 +16,26 @@
bool __gR5Compatibility = false;
addr_t __gNetworkStart;
addr_t __gNetworkEnd;
static void
find_own_image()
{
int32 cookie = 0;
image_info info;
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
if (((uint32)info.text <= (uint32)find_own_image
&& (uint32)info.text + (uint32)info.text_size > (uint32)find_own_image)) {
// found us
__gNetworkStart = (addr_t)min_c(info.text, info.data);
__gNetworkEnd = min_c((addr_t)info.text + info.text_size,
(addr_t)info.data + info.data_size);
break;
}
}
}
extern "C" void
@@ -55,6 +75,7 @@ initialize_before()
if (enable > 0) {
__gR5Compatibility = true;
find_own_image();
debug_printf("libnetwork.so running in R5 compatibility mode.\n");
}
}