dirent64 is missing in bionic/libc/kernel/common/linux/dirent.h

by fadden » Tue, 28 Jul 2009 03:09:37 GMT

Sponsored Links

Can the code use plan old dirent rather than dirent64?



dirent64 is missing in bionic/libc/kernel/common/linux/dirent.h

by Elvis Dowson » Tue, 28 Jul 2009 12:12:38 GMT

 Hi,       I encountered a similar error, see

Sponsored Links

dirent64 is missing in bionic/libc/kernel/common/linux/dirent.h

by louis » Thu, 30 Jul 2009 11:01:46 GMT


To fadden,
I am not sure that using dirent instead of dirent64 will work without
any regression but  I will try.

To Elvis
There is similar structure in my cupcake source tree: "struct
linux_dirent64" defined in kernel/include/linux/dirent.h is almost
same to dirent64 defined in bionic/libc/kernel/common/linux/dirent.h.
How can I sure that dirent64 is supported in bionic of current cupcake
source tree.

Another question is that is there any support for telldir and seekdir?
If not available, what should I do to add the replacements?

Best regards

> see

dirent64 is missing in bionic/libc/kernel/common/linux/dirent.h

by Elvis Dowson » Thu, 30 Jul 2009 12:43:13 GMT


Yes, I had encountered it too, and it probably is a result of an evolution
of the linux kernel. The original bionic libraries in the android-sdk-1.5_r3
libraries did not have that entry.

Which linux kernel version does cupcake correspond to?

In any case, while porting bionic libc to v2.6.31 kernel version (trouble
shooting some DSS2 display issues with android at the moment), I encountered
the same this and applied the following patch, renamed two variables in the
linux_dirent64 struct, so that compilation could proceed. I don't think
android requires linux_dirent64, but just leave it there anyway, and apply
the following patch.

From: Elvis Dowson <elvis.dow...@gmail.com>
Date: Sun, 26 Jul 2009 00:06:54 +0400
Subject: [PATCH] libc: Re-import dirent and direct64 entries into

 libc/kernel/common/linux/dirent.h |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/libc/kernel/common/linux/dirent.h
index 7799fe3..3f8628f 100644
--- a/libc/kernel/common/linux/dirent.h
+++ b/libc/kernel/common/linux/dirent.h
@@ -12,9 +12,24 @@
 #ifndef _LINUX_DIRENT_H
 #define _LINUX_DIRENT_H

+struct dirent {
+long d_ino;
+__kernel_off_t d_off;
+ unsigned short d_reclen;
+ char d_name[256];
+struct dirent64 {
+ __u64 d_ino;
+ __s64 d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
 struct linux_dirent64 {
- u64 d_ino;
- s64 d_off;
+ __u64 d_ino;
+ __s64 d_off;
  unsigned short d_reclen;
  unsigned char d_type;
  char d_name[0];

Best regards,




dirent64 is missing in bionic/libc/kernel/common/linux/dirent.h

by Jean-Baptiste Queru » Thu, 30 Jul 2009 21:05:02 GMT

 For reference, cupcake uses linux 2.6.27.


Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further



Other Threads

1. OutOfMemoryError from BitmapFactory

Like many others here I'm getting OutOfMemoryError from BitmapFactory
when decoding multiple bitmaps.
I am sure I am not leaking memory. Here is the system log from a

I/dalvikvm-heap(  501): Grow heap (frag case) to 8.731MB for 1357499-
byte allocation
I/ActivityManager(   82): Process com.android.vending (pid 333) has
D/dalvikvm(  501): GC freed 7 objects / 248 bytes in 164ms
D/CameraService(   32): getParameters
V/QualcommCameraHardware(   32): getParameters: EX
E/Camera  (  501): _getParameters: antibanding=auto;antibanding-
D/dalvikvm(  501): GC freed 204 objects / 1415776 bytes in 140ms
E/dalvikvm-heap(  501): 778240-byte external allocation too large for
this process.
E/        (  501): VM won't let us allocate 778240 bytes
D/skia    (  501): xxxxxxxxxxxxxxxxxxxx allocPixelRef failed
W/dalvikvm(  501): threadid=15: thread exiting with uncaught exception
E/AndroidRuntime(  501): Uncaught handler: thread Thread-8 exiting due
to uncaught exception
E/AndroidRuntime(  501): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget

As you can see the heap was just grown to 8.731 MB, which is much less
than the 16 MB allowed, and much less than the maximum memory this
same program has routinely used -- over 10 MB. Just prior to the
failed allocation of 778,240 bytes GC freed 1,415,776 bytes. So there
should be plenty of memory available.
I am scrupulously recycling bitmaps nulling pointers, etc.
Any ideas what's going on, or for a workaround?

2. pretty great idea

hey developers,

i have a preposition for anybody that is fairly good at programming
and wants to make a name on the android market. personally, i have no
experience whatsoever in developing any type of program. although, i
do believe that if somebody was able to turn my basic idea into
reality, they would be able to make quite a few dollars, or at least
receive some major props.

im not asking for any money. i just want to see this program, and have
it on my g1. and maybe have my name and a picture of me flash at the
intro ;).

so yea, please email me if you want the details of the idea.
seriously, what do you have to lose.



3. Anyone been asked by dev to change their rating for their app on market?

4. SurfaceFlinger and permitions

5. How to create two TextView without write the XML file?

6. UK Sales of the G1

7. Android 1.5: Problems developing on a device