Sponsored Content
Full Discussion: system calls vs libraries
Top Forums Programming system calls vs libraries Post 101091 by Perderabo on Friday 3rd of March 2006 11:04:52 PM
Old 03-04-2006
An example of a system call is open(). A process calls open() to open a file. The open function that gets linked to the program does reside in a library. But it very quickly hands the request of to the kernel. The kernel will open the file if it can. And either a file descriptor or an error message are returned to the user.

On the other hand, fopen() is the kind of function the folks call a library function. It will open a file, but it is not a system call. It must call open() to get the job done. A library function usually sits on top of coreesponding system calls. Or a library might be, say, math functions that can be implemented without a system call.

The distinction between system calls and functions gets a little blurred every now and then. getpid() is a system call that returns the process id of the caller. HP figured out a clever way to get the pid without invoking the kernel. HP now calls these "lightweight system calls". But they aren't exactly ssytem calls any more. Most versions of unix will claim that there are several system calls to exec another program: execl(), execle(), execlp(), execv(), execve(), and execvp(). But generally, only execve() actually exists and the other "system calls" invoke it.

This is why Posix lumps system call and functions together and simply calls them "interfaces".
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. UNIX for Dummies Questions & Answers

System calls?

open, creat, read, write, lseek and close Are they all primitive? :confused: *Another Question: is there a different between a system call, and an i/o system call? (2 Replies)
Discussion started by: PlunderBunny
2 Replies

4. 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

5. 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

6. Programming

System calls

why user is not able to switch from user to kernel mode by writing the function whose code is identical to system call. (1 Reply)
Discussion started by: joshighanshyam
1 Replies

7. 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

8. 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

9. 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

10. Programming

System Calls using C w/BASH

Hello all, I'm attempting to write a basic application that appends an arbitrary list of txt files to one txt file. So, for example, if the application is run like so: appendFileToFile file1.txt file2.txt file3.txt the system command should, hopefully be, cat >> testfile.txt I'm... (4 Replies)
Discussion started by: whyte_rhyno
4 Replies
UNIMPLEMENTED(2)					     Linux Programmer's Manual						  UNIMPLEMENTED(2)

NAME
afs_syscall, break, fattach, fdetach, ftime, getmsg, getpmsg, gtty, isastream, lock, madvise1, mpx, prof, profil, putmsg, putpmsg, secu- rity, stty, tuxcall, ulimit, vserver - unimplemented system calls SYNOPSIS
Unimplemented system calls. DESCRIPTION
These system calls are not implemented in the Linux kernel. RETURN VALUE
These system calls always return -1 and set errno to ENOSYS. NOTES
Note that ftime(3), profil(3), and ulimit(3) are implemented as library functions. Some system calls, like alloc_hugepages(2), free_hugepages(2), ioperm(2), iopl(2), and vm86(2) exist only on certain architectures. Some system calls, like ipc(2), create_module(2), init_module(2), and delete_module(2) exist only when the Linux kernel was built with sup- port for them. SEE ALSO
syscalls(2) Linux 2017-09-15 UNIMPLEMENTED(2)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy