* Renamed libnetapi to libbnetapi. Create a symlink in the image.

* Extended R5 compatibility check to also consider calls from
  libbnetapi.
* Fixed incorrect R5 compatibility check in BNetEndpoint constructor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-05-14 13:49:48 +00:00
parent ae28f0aebd
commit 07ddcd64cf
8 changed files with 61 additions and 12 deletions
+4 -4
View File
@@ -359,7 +359,7 @@ if $(HAIKU_SHARED_LIBSUPC++) {
# network libraries
HAIKU_NETWORK_LIBS = network ;
HAIKU_NETAPI_LIB = netapi ;
HAIKU_NETAPI_LIB = bnetapi ;
HAIKU_SELECT_UNAME_ETC_LIB = ; # libroot, against which we link anyway
# library and executable glue code
@@ -408,8 +408,8 @@ HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
# init library name map
{
local i ;
for i in be game GL mail media midi midi2 network netapi opengl screensaver root z
textencoding tracker translation {
for i in be game GL mail media midi midi2 network bnetapi opengl
screensaver root z textencoding tracker translation {
HAIKU_LIBRARY_NAME_MAP_$(i) = lib$(i).so ;
}
HAIKU_LIBRARY_NAME_MAP_libstdc++ = $(HAIKU_LIBSTDC++) ;
@@ -658,7 +658,7 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
# network libraries
if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
HOST_NETWORK_LIBS = network ;
HOST_NETAPI_LIB = netapi ;
HOST_NETAPI_LIB = bnetapi ;
HOST_SELECT_UNAME_ETC_LIB = ; # libroot
} else if $(HOST_PLATFORM_BONE_COMPATIBLE) {
HOST_NETWORK_LIBS = socket bind ;
+3 -1
View File
@@ -64,7 +64,7 @@ BEOS_DEMOS = BSnow Chart Clock $(X86_ONLY)Cortex FontDemo
Playground Pulse Sudoku
;
BEOS_SYSTEM_LIBS = libbe.so $(HAIKU_LIBSTDC++) libmedia.so libtracker.so
libtranslation.so libnetapi.so libnetwork.so libdebug.so libbsd.so
libtranslation.so libbnetapi.so libnetwork.so libdebug.so libbsd.so
libmail.so libtextencoding.so libz.so libfreetype.so libpng.so libmidi.so
libmidi2.so libdevice.so libgame.so libscreensaver.so <revisioned>libroot.so
$(X86_ONLY)libGL.so libfluidsynth.so liblpsolve55.so liblinprog.so libalm.so
@@ -197,6 +197,8 @@ for lib in $(BEOS_SYSTEM_LIBS_LIBNETWORK_ALIASES) {
AddSymlinkToHaikuImage beos system lib : libnetwork.so : $(lib) ;
}
AddSymlinkToHaikuImage beos system lib : libbnetapi.so : libnetapi.so ;
# libGL.so has GLUT built-in
if $(TARGET_ARCH) = x86 {
AddSymlinkToHaikuImage beos system lib : $(X86_ONLY)libGL.so : libglut.so ;
+2
View File
@@ -41,5 +41,7 @@ struct r5_sockaddr_in {
extern bool __gR5Compatibility;
extern addr_t __gNetworkStart;
extern addr_t __gNetworkEnd;
extern addr_t __gNetAPIStart;
extern addr_t __gNetAPIEnd;
#endif // NET_R5_COMPATIBILITY_H
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -18,6 +18,8 @@
bool __gR5Compatibility = false;
addr_t __gNetworkStart;
addr_t __gNetworkEnd;
addr_t __gNetAPIStart;
addr_t __gNetAPIEnd;
static void
+2 -1
View File
@@ -5,6 +5,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders net ;
local netapi_sources =
init.cpp
NetEndpoint.cpp
NetAddress.cpp
NetBuffer.cpp
@@ -43,7 +44,7 @@ if $(TARGET_PLATFORM) != haiku {
# boot home config lib ;
boot home Desktop haiku-networkingkit lib ;
} else {
SharedLibrary libnetapi.so :
SharedLibrary libbnetapi.so :
$(netapi_sources)
: be $(TARGET_NETWORK_LIBS)
;
+1 -4
View File
@@ -3,9 +3,6 @@
* Distributed under the terms of the MIT License.
*/
#include <r5_compatibility.h>
#include <Message.h>
#include <NetEndpoint.h>
@@ -28,7 +25,7 @@ BNetEndpoint::BNetEndpoint(int type)
fTimeout(B_INFINITE_TIMEOUT),
fLastError(0)
{
if ((fSocket = socket(__gR5Compatibility ? R5_AF_INET : AF_INET, type, 0)) < 0)
if ((fSocket = socket(AF_INET, type, 0)) < 0)
fLastError = errno;
else
fInit = B_OK;
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Axel Dörfler, axeld@pinc-software.de
*/
#include <string.h>
#include <image.h>
#include <OS.h>
#include <r5_compatibility.h>
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
__gNetAPIStart = (addr_t)min_c(info.text, info.data);
__gNetAPIEnd = min_c((addr_t)info.text + info.text_size,
(addr_t)info.data + info.data_size);
break;
}
}
}
extern "C" void
initialize_before()
{
// If in compatibility mode get our code address range.
if (__gR5Compatibility)
find_own_image();
}
+5 -1
View File
@@ -38,8 +38,12 @@ check_r5_compatibility()
};
stack_frame* frame = (stack_frame*)get_stack_frame();
if (frame->return_address >= __gNetworkStart && frame->return_address < __gNetworkEnd)
if (frame->return_address >= __gNetworkStart
&& frame->return_address < __gNetworkEnd
|| frame->return_address >= __gNetAPIStart
&& frame->return_address < __gNetAPIEnd) {
return false;
}
return true;
#endif