Instead of calling out and invoking external commands sgdisk and partman, you should be able to do the same things with libfdisk which will give you a proper C API. Since recent versions of util-linux (v2.26) libfdisk is now a public shared library with API stability guarantees. It can handle both old-style MBR layout as well as new-style GPT layout. https://www.kernel.org/pub/linux/utils/util-linux/v2.26/libfdisk-docs/
on a related note, udisks2 seems to also use sfdisk with the now *deprecated* --change-id commandline option. Here's the util-linux commit message: commit 8eab3194ce1737a167812d5e84d83b0dfc253fac Author: Karel Zak <kzak@redhat.com> Date: Mon Sep 15 12:37:52 2014 +0200 sfdisk: add --parttype The patch also makes --{id,change-id,print-id} deprecated in favour of --parttype. The original --id is too generic option name and the --print-id and --change-id are unnecessary and inconsistent with another sfdisk options (e.g. we don't have --change-bootable)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.