LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-13-2021, 02:55 AM   #1
viveksahu26
LQ Newbie
 
Registered: Sep 2021
Posts: 1

Rep: Reputation: Disabled
Lightbulb System calls function and library function


So, Can I say that a library function when invoked in the code uses the system call function to execute itself ?
 
Old 09-13-2021, 04:57 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
No. There are library functions that don't use system calls, such as many (or all?) math functions.
 
Old 09-13-2021, 05:41 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by viveksahu26 View Post
So, Can I say that a library function when invoked in the code uses the system call function to execute itself ?
Yes, you can say [whatever you want], but it is not true. And most probably meaningless. What do you mean by "uses system call function to execute itself"?
this is how a c function call works (in general): https://stackoverflow.com/questions/...callstack-work
What do you really want to know?
 
Old 09-13-2021, 06:59 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
I guess what the OP has in mind are the f- family of file access calls like fopen, fread and so on. These are indeed programmer-friendly wrappers for the system calls whose names are given by removing the f-prefix. But most C-library functions are not of this kind.
 
Old 09-14-2021, 04:25 AM   #5
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,830
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Sounds suspiciously like a homework question to me.
 
  


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
how does java calls the system calls which are written in c babu198649 Linux - General 3 12-05-2011 03:40 AM
a script calls another script which calls "bash" inside lordofring Linux - Software 10 03-18-2010 09:59 AM
linking library in kernel - what might be the calls library should not be using lakshmi00786 Linux - Kernel 2 07-25-2009 01:30 PM
Unix system calls and c library? goldeneagle1234 Linux - Newbie 2 09-14-2008 09:23 PM
function calls inside a function manas_sem Programming 2 02-28-2007 01:27 AM

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

All times are GMT -5. The time now is 09:24 PM.

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