LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Games (https://www.linuxquestions.org/questions/linux-games-33/)
-   -   Alternative of system() in c Linux to execute a terminal command of linux (https://www.linuxquestions.org/questions/linux-games-33/alternative-of-system-in-c-linux-to-execute-a-terminal-command-of-linux-4175544565/)

bipin7301 06-05-2015 04:13 AM

Alternative of system() in c Linux to execute a terminal command of linux
 
I want to execute a terminal command of linux in C program. currently I am using system() function but I want to use any other as system() function is banned as per MISRA.

for ex, how to replace

system("hwclock --systohc --utc");

pan64 06-05-2015 04:28 AM

http://stackoverflow.com/questions/3...mmand-of-linux

(I'm not really familiar with MISRA)
I assume in general you are not allowed to invoke external commands, so replacing system call is not a solution.
In such cases I would check the source code of hwclock, probably you will get some tips how to use that within your app.


All times are GMT -5. The time now is 06:23 AM.