diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2021-07-21 08:35:47 +0000 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-10-05 11:19:26 +0900 |
commit | 79737026ed7b5ddae4c375b564fd5f27f573b025 (patch) | |
tree | 933265417c12d61078a98c02032ce01c6a5b2830 /src | |
parent | 7d222bed9dff4713d6fb261b56910f216463597b (diff) | |
download | DLT-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')
-rw-r--r-- | src/daemon/dlt-daemon.c | 20 | ||||
-rw-r--r-- | src/daemon/dlt.conf | 1 |
2 files changed, 15 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) diff --git a/src/daemon/dlt.conf b/src/daemon/dlt.conf index ab2a9bd..7e19817 100644 --- a/src/daemon/dlt.conf +++ b/src/daemon/dlt.conf @@ -61,6 +61,7 @@ RingbufferMaxSize = 10000000 RingbufferStepSize = 500000 # The size of Daemon FIFO (/tmp/dlt) (Default: 65536, MinSize: depend on pagesize of system, MaxSize: please check /proc/sys/fs/pipe-max-size) +# This is only supported for Linux. # DaemonFIFOSize = 65536 # Initial log-level that is sent when an application registers (Default: 4) |