Re: read vs fread

From: David Schwartz (davids_at_webmaster.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 12:03:22 -0800


"Grant Edwards" <grante@visi.com> wrote in message
news:421f4794$0$46582$a1866201@visi.com...

> On 2005-02-25, Jan Kandziora <jjj@gmx.de> wrote:

>> Patrice Kadionik schrieb:
>
>>> - are syscalls.
>>
>> No, they are library functions of libc. Syscalls are special calls, which
>> use the Kernelspace/Userspace gate. They are implemented e.g. by software
>> interrupts in Linux on the x86 platform. These are used *inside* the
>> read()
>> etc. functions.
>
> That's technically true, but those library calls map directly
> into syscalls (same parameters, same return values) and are
> documented in a section 2 of the manual (generally referred to
> as the system call section) instead of section 3 (generally
> referred to as library section).

    Except that can have huge semantic differences. On LinuxThreads, for
example, the system calls are not cancellation points, but the library
functions are.

    DS



Relevant Pages

  • Re: RFC: disablenetwork facility. (v4)
    ... I think seccomp() is too much restricted to apply for general applications. ... Most applications will need some other syscalls in addition to exit, ... Aren't you forgetting about libc? ... To be able to handle socketcall-style multiplexors, we will need a hook inside ...
    (Linux-Kernel)
  • Re: Where is the source to the system calls?
    ... > of the subroutines in libc that converted C-language function calls, ... into assembler language system calls. ... about x86 Assembler and syscalls in Developers' Handbook. ...
    (freebsd-hackers)
  • Re: Suggestions on Avoiding syscall Overhead
    ... System wide global readonly page which will help on these syscalls: ... Accelerating gettimeofday() makes a lot of sense; ... statically link against libc, so you have to make sure that libc can ...
    (freebsd-current)
  • Re: Suggestions on Avoiding syscall Overhead
    ... System wide global readonly page which will help on these syscalls: ... Do any real programs call these syscalls very often? ... I'm not convinced about calls such as getuid() and gethostname, ... statically link against libc, so you have to make sure that libc can ...
    (freebsd-current)
  • Re: read vs fread
    ... they are library functions of libc. ... > use the Kernelspace/Userspace gate. ... into syscalls ...
    (comp.os.linux.development.system)