How to run legato terminal commands via a .c file without using system

Hello,
Currently we are using “system” to trigger legato terminal commands via a .c file but this has been flagged as bug by sonarqube our code scanning tools so I am looking for alternate options to trigger the legato commands without using system, Can you please help or suggest alternatives ?

    system("/sbin/udhcpc -R -b -i wlan0");
    system("/usr/sbin/ntpd -q -p pool.ntp.org");
    system("reboot")

Thanks
Vishal

Thanks
Vishal

probably you need to port the source code to your application: