/* * Copyright (c) Camden Dixie O'Brien * SPDX-License-Identifier: AGPL-3.0-only */ #define _POSIX_C_SOURCE 199309L #include #include #include typedef const char *(*getmsg_t)(void); int main(void) { void *mod = dlopen("libmod.so", RTLD_NOW); const getmsg_t getmsg = (getmsg_t)dlsym(mod, "getmsg"); const struct timespec pause = { .tv_nsec = 16666667 }; while (1) { printf("\33[2K\r%s", getmsg()); fflush(stdout); nanosleep(&pause, NULL); } return 0; }