summaryrefslogtreecommitdiff
path: root/src/daemon/dlt-daemon.c
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2021-07-21 08:35:47 +0000
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-10-05 11:19:26 +0900
commit79737026ed7b5ddae4c375b564fd5f27f573b025 (patch)
tree933265417c12d61078a98c02032ce01c6a5b2830 /src/daemon/dlt-daemon.c
parent7d222bed9dff4713d6fb261b56910f216463597b (diff)
downloadDLT-daemon-79737026ed7b5ddae4c375b564fd5f27f573b025.tar.gz
daemon: Enable to use FIFO on QNX
It depends on OSes if maximum size of pipe can be configured per process or not. For example, on QNX it can be only set from pipe resource manager. Also flags used to set the value are only supported on Linux. Now DaemonFIFOSize option in dlt.conf is only relevant for Linux. Also -f option is added to build scripts to enable FIFO as IPC. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/daemon/dlt-daemon.c')
-rw-r--r--src/daemon/dlt-daemon.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index c09a809..fd7d3e5 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -553,12 +553,6 @@ int option_file_parser(DltDaemonLocal *daemon_local)
value, &(daemon_local->RingbufferStepSize)) < 0)
return -1;
}
- else if (strcmp(token, "DaemonFIFOSize") == 0)
- {
- if (dlt_daemon_check_numeric_setting(token,
- value, &(daemon_local->daemonFifoSize)) < 0)
- return -1;
- }
else if (strcmp(token, "SharedMemorySize") == 0)
{
daemon_local->flags.sharedMemorySize = atoi(value);
@@ -714,6 +708,15 @@ int option_file_parser(DltDaemonLocal *daemon_local)
}
#ifdef DLT_DAEMON_USE_FIFO_IPC
+ else if (strcmp(token, "DaemonFIFOSize") == 0)
+ {
+ if (dlt_daemon_check_numeric_setting(token,
+ value, &(daemon_local->daemonFifoSize)) < 0)
+ return -1;
+#ifndef __linux__
+ printf("Option DaemonFIFOSize is set but only supported on Linux. Ignored.\n");
+#endif
+ }
else if (strcmp(token, "DaemonFifoGroup") == 0)
{
strncpy(daemon_local->flags.daemonFifoGroup, value, NAME_MAX);
@@ -1375,11 +1378,16 @@ static int dlt_daemon_init_fifo(DltDaemonLocal *daemon_local)
return -1;
} /* if */
+#ifdef __linux__
+ /* F_SETPIPE_SZ and F_GETPIPE_SZ are only supported for Linux.
+ * For other OSes it depends on its system e.g. pipe manager.
+ */
if (daemon_local->daemonFifoSize != 0) {
/* Set Daemon FIFO size */
if (fcntl(fd, F_SETPIPE_SZ, daemon_local->daemonFifoSize) == -1)
dlt_vlog(LOG_ERR, "set FIFO size error: %s\n", strerror(errno));
}
+#endif
/* Get Daemon FIFO size */
if ((fifo_size = fcntl(fd, F_GETPIPE_SZ, 0)) == -1)