about system calls

This is a discussion on about system calls within the C Programming forums, part of the General Programming Boards category; Hi Assume a process being run in user space makes a system call (say read() in a UNIX system), does ...

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

    about system calls

    Hi

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

    Thnaks...

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    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, 08:18 AM
  2. Opinions on custom system build
    By lightatdawn in forum Tech Board
    Replies: 2
    Last Post: 10-18-2005, 05:15 AM
  3. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 08: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, 02:08 AM
  5. System Calls && Variables
    By Okiesmokie in forum C++ Programming
    Replies: 6
    Last Post: 03-06-2002, 09:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21