diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-01-18 18:50:05 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-01-19 08:35:10 +0100 |
| commit | c20c5bfb40bb65d4196bcf97e80acd97496ddda3 (patch) | |
| tree | 351b452f55934e8468ddbdb79d16ccb7819eab29 /src/ipcpd/unicast/fa.c | |
| parent | c51611c27f766bb4f413485bf8a12bca02e98669 (diff) | |
| download | ouroboros-c20c5bfb40bb65d4196bcf97e80acd97496ddda3.tar.gz ouroboros-c20c5bfb40bb65d4196bcf97e80acd97496ddda3.zip | |
build: Add an option for container compatibility
This adds a BUILD_CONTAINER option that disables some features that
require elevated privileges like setting thread priorities, which
might not be supported in docker environments.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast/fa.c')
| -rw-r--r-- | src/ipcpd/unicast/fa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c index ac168bd9..dc23340c 100644 --- a/src/ipcpd/unicast/fa.c +++ b/src/ipcpd/unicast/fa.c @@ -689,9 +689,11 @@ void fa_fini(void) int fa_start(void) { +#ifndef BUILD_CONTAINER struct sched_param par; int pol; int max; +#endif fa.psched = psched_create(packet_handler, np1_flow_read); if (fa.psched == NULL) { @@ -704,6 +706,7 @@ int fa_start(void) goto fail_thread; } +#ifndef BUILD_CONTAINER if (pthread_getschedparam(fa.worker, &pol, &par)) { log_err("Failed to get worker thread scheduling parameters."); goto fail_sched; @@ -721,12 +724,15 @@ int fa_start(void) log_err("Failed to set scheduler priority to maximum."); goto fail_sched; } +#endif return 0; +#ifndef BUILD_CONTAINER fail_sched: pthread_cancel(fa.worker); pthread_join(fa.worker, NULL); +#endif fail_thread: psched_destroy(fa.psched); fail_psched: |
