mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
LibC: A whole bunch of compat work towards porting Lynx.
This commit is contained in:
parent
48590a0e51
commit
2c3cf22bc9
10 changed files with 125 additions and 5 deletions
31
LibC/netdb.cpp
Normal file
31
LibC/netdb.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
static hostent __gethostbyname_buffer;
|
||||
static in_addr_t __gethostbyname_address;
|
||||
static in_addr_t* __gethostbyname_address_list_buffer[2];
|
||||
|
||||
hostent* gethostbyname(const char* name)
|
||||
{
|
||||
if (!strcmp(name, "boards.4channel.org")) {
|
||||
__gethostbyname_buffer.h_name = "boards.4channel.org";
|
||||
__gethostbyname_buffer.h_aliases = nullptr;
|
||||
__gethostbyname_buffer.h_addrtype = AF_INET;
|
||||
__gethostbyname_address = 0x4b4f1168;
|
||||
__gethostbyname_address_list_buffer[0] = &__gethostbyname_address;
|
||||
__gethostbyname_address_list_buffer[1] = nullptr;
|
||||
__gethostbyname_buffer.h_addr_list = (char**)__gethostbyname_address_list_buffer;
|
||||
__gethostbyname_buffer.h_length = 4;
|
||||
return &__gethostbyname_buffer;
|
||||
}
|
||||
dbgprintf("FIXME(LibC): gethostbyname(%s)\n", name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue