diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-05-03 12:10:02 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-05-03 12:26:48 +0200 |
commit | 12968ba98642bd7057e8e7f41e184ab2d61671ed (patch) | |
tree | 8f3e3706bc8038f795d6f5b758b46126787dde9f /include | |
parent | 711777a4c7665db2d7ec8d05105eee29054c8562 (diff) | |
download | ouroboros-12968ba98642bd7057e8e7f41e184ab2d61671ed.tar.gz ouroboros-12968ba98642bd7057e8e7f41e184ab2d61671ed.zip |
lib: Make UNIX socket buffer size configurable0.11.3
This makes the buffer size used by the UNIX sockets configurable. In
case of a lot of IPCPs in the system it might become too small with
the default value, resulting in irm command failures. The user can now
easily configure it with an adequate value.
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/CMakeLists.txt | 6 | ||||
-rw-r--r-- | include/ouroboros/sockets.h.in (renamed from include/ouroboros/sockets.h) | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index c0a83030..fe0ccf5d 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -1,6 +1,12 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/version.h" @ONLY) +set(SOCK_BUF_SIZE 10240 CACHE STRING + "Size of the buffer used by the UNIX sockets for local IPC") + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sockets.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/sockets.h" @ONLY) + set(HEADER_FILES cacep.h cdefs.h diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h.in index 36ea4da9..4557a9ef 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h.in @@ -40,10 +40,9 @@ typedef IpcpMsg ipcp_msg_t; #define SOCK_PATH_SUFFIX ".sock" #define IRM_SOCK_PATH SOCK_PATH "irm" SOCK_PATH_SUFFIX -#define IRM_MSG_BUF_SIZE 2048 - #define IPCP_SOCK_PATH_PREFIX SOCK_PATH "ipcp" -#define IPCP_MSG_BUF_SIZE IRM_MSG_BUF_SIZE + +#define SOCK_BUF_SIZE @SOCK_BUF_SIZE@ /* Returns the full socket path of an IPCP */ char * ipcp_sock_path(pid_t pid); |