mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibC+LookupServer: Compute magic number to avoid hardcoding
This commit is contained in:
parent
0d6c8afa4e
commit
34a8ee6da5
Notes:
sideshowbarker
2024-07-18 01:29:53 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/34a8ee6da50 Pull-request: https://github.com/SerenityOS/serenity/pull/10748 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/trflynn89
2 changed files with 5 additions and 3 deletions
|
@ -27,12 +27,13 @@ static in_addr_t* __gethostbyname_address_list_buffer[2];
|
|||
|
||||
static hostent __gethostbyaddr_buffer;
|
||||
static in_addr_t* __gethostbyaddr_address_list_buffer[2];
|
||||
// XXX: IPCCompiler depends on LibC. Because of this, it cannot be compiled
|
||||
// IPCCompiler depends on LibC. Because of this, it cannot be compiled
|
||||
// before LibC is. However, the lookup magic can only be obtained from the
|
||||
// endpoint itself if IPCCompiler has compiled the IPC file, so this creates
|
||||
// a chicken-and-egg situation. Because of this, the LookupServer endpoint magic
|
||||
// is hardcoded here.
|
||||
static constexpr i32 lookup_server_endpoint_magic = 9001;
|
||||
// Keep the name synchronized with LookupServer/LookupServer.ipc.
|
||||
static constexpr i32 lookup_server_endpoint_magic = "LookupServer"sv.hash();
|
||||
|
||||
// Get service entry buffers and file information for the getservent() family of functions.
|
||||
static FILE* services_file = nullptr;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
endpoint LookupServer [magic=9001]
|
||||
// Keep the name synchronized with LibC/netdb.cpp, constant 'lookup_server_endpoint_magic'.
|
||||
endpoint LookupServer
|
||||
{
|
||||
lookup_name(String name) => (int code, Vector<String> addresses)
|
||||
lookup_address(String address) => (int code, String name)
|
||||
|
|
Loading…
Add table
Reference in a new issue