Thread: about system calls

  1. #1
    Just kidding.... fnoyan's Avatar
    Join Date
    Jun 2003
    Still in the egg

    about system calls


    Assume a process being run in user space makes a system call (say read() in a UNIX system), does it take less amount of time (ar any resource) to use a standart library function like fread()? Because our process makes a call to the OS for the system call and OS implements it in the kernel space.

    PS: Assume I want to read a text file.So, use of fread() is possible instead of read().


  2. #2
    Registered User
    Join Date
    Aug 2005
    fread() is a wrapper for read(), so yes, fread() may be a bit slower by only a few clock ticks. But that is important only if you are writing a really time-critical application where every millisecond and clock tick counts. Most programs should use fread() is C applications.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic system calls help.
    By AmbliKai in forum C Programming
    Replies: 5
    Last Post: 03-21-2008, 07:18 AM
  2. Opinions on custom system build
    By lightatdawn in forum Tech Board
    Replies: 2
    Last Post: 10-18-2005, 04:15 AM
  3. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 07:38 AM
  4. School Mini-Project on C/C++ (Need Your Help)..
    By EazTerence in forum C++ Programming
    Replies: 4
    Last Post: 09-08-2005, 01:08 AM
  5. System Calls && Variables
    By Okiesmokie in forum C++ Programming
    Replies: 6
    Last Post: 03-06-2002, 09:10 PM