implementation of opendir and readdir

Li, Yang YLi@ballytech.com
Wed Sep 4 18:14:00 GMT 2013


Deal Paul:

That's great help.  Thanks for the clarification.

Best
Yang

-----Original Message-----
From: Paul Pluzhnikov [mailto:ppluzhnikov@google.com] 
Sent: Wednesday, September 04, 2013 10:59 AM
To: Li, Yang
Cc: libc-help@sourceware.org
Subject: Re: implementation of opendir and readdir

On Wed, Sep 4, 2013 at 10:30 AM, Li, Yang <YLi@ballytech.com> wrote:

> So my first question is, when a user called "readdir", which function is it actually linked to?

Neither of the ones you found.

The actual readdir on Linux is in sysdeps/posix/readdir.c

> How does the linker know not to link against "glibc" and link to some kernel provided library?

You are confused. There is no such thing as "kernel provided library".
It is impossible for user code to link directly to any code in linux3.11/fs/...

> So where are the actual source code for processing "opendir"?

sysdeps/posix/opendir.c

HTH,
-- 
Paul Pluzhnikov




More information about the Libc-help mailing list