Hello, I have a simple program using libmount that simply gets the path of the root filesystem. I can't seem to get it to work. I always get a segmentation fault. There is probably something basic that I am missing but can't figure it out. #include <stdlib.h> #include <string.h> #include <stdio.h> #include <assert.h> #include <libmount.h> int main(int argc, char *argv[]) { struct libmnt_context *cxt; struct libmnt_table *tab; struct libmnt_fs *fs; /* Enable debugging */ mnt_init_debug(0xffff); /* Create new mount context */ cxt = mnt_new_context(); if (!cxt) printf("Error creating new mount context\n"); /* A mount table */ if (mnt_context_get_mtab(cxt, &tab) < 0) printf("Error getting mtab\n"); /* Get the root filesystem */ if (mnt_table_get_root_fs(tab, &fs) == -1) printf("Error getting root fs from mount table\n"); const char *src = mnt_fs_get_source(fs); char *root = mnt_pretty_path(src, NULL); printf("root filesystem source (pretty) %s\n", root); return 0; } -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html