implementation of opendir and readdir

Li, Yang
Wed Sep 4 18:14:00 GMT 2013

Deal Paul:

That's great help.  Thanks for the clarification.


-----Original Message-----
From: Paul Pluzhnikov [] 
Sent: Wednesday, September 04, 2013 10:59 AM
To: Li, Yang
Subject: Re: implementation of opendir and readdir

On Wed, Sep 4, 2013 at 10:30 AM, Li, Yang <> 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"?


Paul Pluzhnikov

More information about the Libc-help mailing list