]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/libfrr.c
Merge pull request #3098 from opensourcerouting/watchfrr-delay
[mirror_frr.git] / lib / libfrr.c
index 252132201d56b8588bf628da3a826d1a2ddbe69c..35a6da577f692ac2f4533ac6e4de248bc307c3fd 100644 (file)
@@ -993,3 +993,25 @@ void frr_fini(void)
                fclose(fp);
        }
 }
+
+#ifdef INTERP
+static const char interp[]
+       __attribute__((section(".interp"), used)) = INTERP;
+#endif
+/*
+ * executable entry point for libfrr.so
+ *
+ * note that libc initialization is skipped for this so the set of functions
+ * that can be called is rather limited
+ */
+extern void _libfrr_version(void)
+       __attribute__((visibility("hidden"), noreturn));
+void _libfrr_version(void)
+{
+       const char banner[] =
+               FRR_FULL_NAME " " FRR_VERSION ".\n"
+               FRR_COPYRIGHT GIT_INFO "\n"
+               "configured with:\n    " FRR_CONFIG_ARGS "\n";
+       write(1, banner, sizeof(banner) - 1);
+       _exit(0);
+}