`unsigned long` is a 32bit variable on 32bit systems, while `lvm_vg_get_size()` return 64bit integers, so this will result in an error on those systems. Please change `unsigned long` to `uint64_t`.