diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-06-29 20:25:50 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-06-29 20:25:50 +0200 |
commit | 27b2baf8423dda719ddac4926c43bdddb427ee1f (patch) | |
tree | 750d4d005815ecdf49a13dac565878849d6ee098 | |
parent | ba849f06d5c287e6d04e5cc91fe96c0a54df3199 (diff) |
server: Check that constructor attributes work on the system
-rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -148,7 +148,17 @@ void signal_handler(int sig){ } } +static bool constructors_work = false; + +__attribute__((constructor)) +static void constructor(void) { constructors_work = true; } + int main(int argc,char **argv){ + if (!constructors_work) { + fprintf(stderr, "This platform does not support application constructors, which tomsg requires\n"); + return 1; + } + srandomdev(); if(sodium_init()<0){ fprintf(stderr,"Could not initialise libsodium!\n"); |