You are not logged in.

#1 2008-06-30 16:50:27

abijr
Member
Registered: 2008-05-18
Posts: 71

C programming System calls

Ok I am starting to program in C and I would like to make useful apps
but I don't know how to call other programs within linux from C
I'm looking for guides that help on linux "C" programming.
I've tried some guides I googled but I tried their examples and don't get anything
they appear obsolete (1996 or 1999)
Guide I found

Any sugestions?

Thanks

Offline

#2 2008-06-30 17:04:06

sniffles
Member
Registered: 2008-01-23
Posts: 275

Re: C programming System calls

Offline

#3 2008-06-30 17:53:51

abijr
Member
Registered: 2008-05-18
Posts: 71

Re: C programming System calls

Thanks, smile

Offline

#4 2008-07-05 02:44:20

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: C programming System calls

One thing that's cool is that most system routines have man pages. When you're reading your book and the author is not clear about a detail of how some function works, you can look it up with man.

To call another program, you might want to look at "exec" and friends (man execl) and fork (man fork). But I am also a newbie here.

Offline

#5 2008-07-05 04:54:58

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: C programming System calls

Note that calling other programs is not a common occurrence for C programs...nor is that a "system call". A system call is calling a kernel-provided function such as stat or access, not calling another user-space program on the system.

Offline

#6 2008-07-05 12:53:22

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: C programming System calls

For most programs, using posix calls would make more sense than linux system calls --- your program would be more portable. Just something to keep in mind smile

Offline

#7 2008-07-09 07:50:57

elgatofelix
Member
From: Chile
Registered: 2007-07-03
Posts: 137

Re: C programming System calls

toofishes wrote:

Note that calling other programs is not a common occurrence for C programs...nor is that a "system call". A system call is calling a kernel-provided function such as stat or access, not calling another user-space program on the system.

U call other programs with a system call, u can open a file and do operations on it with system calls too.

What he want is a GUI like gtk or a framework


Are u listening?

Offline

#8 2008-07-09 20:12:10

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: C programming System calls

toofishes wrote:

Note that calling other programs is not a common occurrence for C programs...

Yes, it sounds like OP is misapplying C somewhat. A scripting language is a better choice if you're trying to do scripting.

Offline

Board footer

Powered by FluxBB