Sysupgrade for C api

is there a example about how to call sysupgrade -c bash cmd in C language to start system upgrade?
how to do upgrade in C? I now use system("sysupgrade -c sm.bin"); , but i think it is not very good

Maybe 'system' ?

He just said he used system().

You may be able to use libubus to call sysupgrade via ubus.

root@OpenWrt:~# ubus -v list system
'system' @b5b56299



maybe there is a better way

but on some my using openwrt, sysupgrade has no params