LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 06-05-2015, 04:13 AM   #1
bipin7301
LQ Newbie
 
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
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");
 
Old 06-05-2015, 04:28 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is there a command to open a root terminal and execute a function? cravengemetzel Linux - General 3 12-30-2012 04:10 AM
Fedora 16: Trying to execute an xinput command at boot up before login. Cmd works in terminal as su Ron Pierce Linux - Newbie 1 04-24-2012 09:41 PM
[SOLVED] Make linux terminal transparent with terminal command? yooy Linux - Newbie 1 05-11-2010 03:24 AM
Execute a command in all tabs in gnome-terminal ganesh_k Linux - Newbie 3 11-01-2008 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 01:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration