+/*
+ *
+ * utility
+ *
+ */
+
+#define _GNU_SOURCE
+
+#include <unistd.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+static const struct option longopts[] = {
+ { "print-rtld-now", 0, 0, '\1' },
+ { }
+};
+
+static void printusage(FILE *f) {
+ fputs("usage: fishdescriptor --print-rtld-now\n",f);
+}
+
+int main(int argc, char **argv) {
+ int o;
+
+ while ((o = getopt_long(argc, argv, "", longopts, 0)) != -1) {
+ switch (o) {
+ case '\1' /* --print-rtld-now */:
+ printf("%d\n", RTLD_NOW);
+ exit (0);
+ default:
+ fputs("bad usage: unknown option\n",stderr);
+ printusage(stderr);
+ exit(-1);
+ }
+ }
+
+ fputs("bad usage: XXX\n",stderr);
+ printusage(stderr);
+ exit(-1);
+}