Find the answer to your Linux question:
Results 1 to 3 of 3
What is the first function run in uClibc when user application call read(...)? I only could find Code: _syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count) #ifndef __LINUXTHREADS_OLD__ libc_hidden_def(read) #else ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2007
    Posts
    3

    Question 'read' function in uClibc 0.9.32


    What is the first function run in uClibc when user application call read(...)?

    I only could find

    Code:
    _syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
    #ifndef __LINUXTHREADS_OLD__
    libc_hidden_def(read)
    #else
    libc_hidden_weak(read)
    strong_alias(read,__libc_read)
    #endif
    under uClibc-0.9.32\libc\sysdeps\linux\common\read.c.

    Thank you.

  2. #2
    Just Joined!
    Join Date
    Jan 2011
    Location
    Fairfax, Virginia, USA
    Posts
    94
    Quote Originally Posted by unifoxz View Post
    What is the first function run in uClibc when user application call read(...)?

    I only could find

    Code:
    _syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
    #ifndef __LINUXTHREADS_OLD__
    libc_hidden_def(read)
    #else
    libc_hidden_weak(read)
    strong_alias(read,__libc_read)
    #endif
    under uClibc-0.9.32\libc\sysdeps\linux\common\read.c.

    Thank you.
    Hi unifoxz,
    Read is a system call ... its not a library call. I don't have a solid understanding of the mechanics of how this works to be honest, but the interface is usually something like <syscall.h>. When a user space application issues a system call, the call is translated into an integer and the associated data is passed to the kernel in one of two ways. The use space application usually blocks waiting for the kernel to complete its system call. I don't think you'll find a "C" interface in (uc)libc.so, but like I said ... I'm not an expert here.

  3. #3
    Just Joined!
    Join Date
    Jan 2007
    Posts
    9

    Get the system calls using strace.

    get the call sequence using some debugging tool like strace.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •