--- /dev/null
+CFLAGS += $(shell pkg-config --cflags mount)
+LIBMOUNT = $(shell pkg-config --libs mount)
+
+all: c-mounts c-langinfo
+
+c-mounts: c-mounts.o
+ $(CC) -Wall -o $@ $^ $(LIBMOUNT)
+
+c-langinfo: c-langinfo.o
+ $(CC) -Wall -o $@ $^
+
+clean:
+ rm -f c-mounts c-langinfo *.o
+
+run: all
+ LANG=en_US.UTF-8 ./c-langinfo
+ LANG=en_GB.UTF-8 ./c-langinfo
+ LANG=en_IE.UTF-8 ./c-langinfo
+ ./c-mounts
+
+.PHONY: clean run
--- /dev/null
+#include <langinfo.h>
+#include <locale.h>
+#include <stdio.h>
+
+int main()
+{
+ printf("locale: %s\n", setlocale (LC_ALL, ""));
+ printf("codeset: %s\n", nl_langinfo(CODESET));
+ printf("date/time format: %s\n", nl_langinfo(D_T_FMT));
+ printf("currency: %s\n", nl_langinfo(CRNCYSTR));
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+#include <err.h>
+#include <string.h>
+#include <libmount.h>
+
+int
+main()
+{
+ int r;
+ const char *version;
+
+ r = mnt_get_library_version(&version);
+ if (r < 0)
+ errx(1, "failed to get lib versino: %s", strerror (-r));
+ printf("libmount version: %s\n", version);
+
+ struct libmnt_table *table = mnt_new_table();
+ r = mnt_table_parse_mtab (table, NULL);
+ if (r < 0)
+ errx(1, "failed to parse mtab: %s", strerror (-r));
+
+ struct libmnt_fs *fs;
+ r = mnt_table_first_fs(table, &fs);
+ if (r < 0)
+ errx(1, "failed to find first fs: %s", strerror (-r));
+ printf("first fs type: %s source: %s target: %s\n", mnt_fs_get_fstype(fs), mnt_fs_get_source(fs), mnt_fs_get_target(fs));
+ mnt_free_fs(fs);
+
+ mnt_free_table(table);
+ return 0;
+}