Difference between system calls and normal functions in C


 
Thread Tools Search this Thread
Top Forums Programming Difference between system calls and normal functions in C
# 8  
Old 11-07-2011
Quote:
Originally Posted by jim mcnamara
I don't get your point, network interfaces (sockets) are directly associated with file descriptors, at least in all of the boxes I've seen. Ditto eth0:, bge0:, etc., (nics) or whatever you call yours.
They are not present as files, there's no /dev/eth0 for example. This is very different from any other kind of UNIX device -- terminals, disks, even random number sources are all available as files and can be handled with open/read/write/close. Networking is not. It doesn't even use open/read/write, though it does share close().
Quote:
If you are crazy, or on Linux you can call ioctl() on eth0:. Why? because ioctl works on files.
ioctl works on file descriptors. First, you have to open that somehow, and that's not done through the normal channels.

The example first shows how to twiddle settings on a serial port /dev/ttyS0. That is a file.

Then it shows how to do so on a network interface, starting with a socket() call instead.
# 9  
Old 11-08-2011
thank you all..can we change the permissions of a file by using system calls?
# 10  
Old 11-08-2011
Jim already told you how in post #5...
# 11  
Old 11-08-2011
How can we identify which is system calls and which is normal function? Is there any way to find out?

Last edited by aarathy; 11-10-2011 at 02:05 AM..
# 12  
Old 11-08-2011
System calls (e.g. open) are normally in section 2 of the manual, library functions (e.g. fopen) are in section 3.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Difference between normal Execute permission and GUID

Hi, Any can explain the difference between the normal execute permission for the file and GUID of the file. Since the normal execute permission has right to execute file why there is need of providing GUID for the same file. Also share some examples for SUID and SGID programs. Regards... (3 Replies)
Discussion started by: ksgnathan
3 Replies

2. UNIX for Dummies Questions & Answers

system calls in C

Hello, how would i be able to call ps in C programming? thanks, ---------- Post updated at 01:39 AM ---------- Previous update was at 01:31 AM ---------- here's the complete system call, ps -o pid -p %d, getpit() (2 Replies)
Discussion started by: l flipboi l
2 Replies

3. UNIX for Dummies Questions & Answers

About system calls.

Hi all, I am new here . I want to know about system call in detail. As system calls are also function .How system identifies it.:) (2 Replies)
Discussion started by: vishwasrao
2 Replies

4. Solaris

difference between RPATH and normal linking while building

while building in solaris and going for dynamic linking whats the difference or advantage or disadvantage in using RPATH vs while linking package and dependency libraries i need a little explanation about this RPATH option specially and the difference with normal linking using -L (0 Replies)
Discussion started by: mobydick
0 Replies

5. BSD

system calls

what is the functions and relationship between fork,exec,wait system calls as i am a beginer just want the fundamentals. (1 Reply)
Discussion started by: sangramdas
1 Replies

6. UNIX Desktop Questions & Answers

Using system calls

Hi, I'm new to UNIX system calls. Can someone share your knowledge as to how exactly system calls should be executed? Can they be typed like commands such as mkdir on the terminal itself? Also, are there any websites which will show me an example of the output to expect when a system call like... (1 Reply)
Discussion started by: ilavenil
1 Replies

7. Solaris

System calls ?

where can i find the differences in System calls between solaris and aix? also is it possible to find a comprehensive list of them? (1 Reply)
Discussion started by: TECHRAMESH
1 Replies

8. UNIX for Dummies Questions & Answers

System calls for cp and mv

Which system calls are made for operations cp and mv (2 Replies)
Discussion started by: gaurava99
2 Replies

9. UNIX for Dummies Questions & Answers

Any difference between the CLI of Mac OS X and normal UNIX?

Any? (11 Replies)
Discussion started by: edward
11 Replies

10. UNIX for Dummies Questions & Answers

System Calls

What does the system call "dup" do? What is the difference between dup and dup2 I have a fair idea of what it does but I am confused when its coming down to the exact details... Please help me!:confused: (2 Replies)
Discussion started by: clickonline1
2 Replies
Login or Register to Ask a Question