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


 Hi

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


 Hi,




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
bionic/libc/kernel/common/linux/dirent.h

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

diff --git a/libc/kernel/common/linux/dirent.h
b/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];
-- 
1.6.0.3

Best regards,

Elvis

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



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.

JBQ






-- 
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
warning.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. com.android.dx.cf.code.SimException: local variable type mismatch

While dex-ing a jar I am getting the the following. Does anyone knows
how to fix it? Supposedly build-no-debug should help but I cannot find
any reference to this flag in android source.
Any help appreciated

Tomasz


[apply] UNEXPECTED TOP-LEVEL EXCEPTION:
 [apply] com.android.dx.cf.code.SimException: local variable type
mismatch: attempt to set or access a value of type
groovy.lang.Reference using a local variable of type
java.lang.Object[]. This is symptomatic of .class transformation tools
that ignore local variable information.
 [apply]   at
com.android.dx.cf.code.BaseMachine.throwLocalMismatch(BaseMachine.java:537)
 [apply]   at
com.android.dx.cf.code.BaseMachine.getLocalTarget(BaseMachine.java:392)
 [apply]   at
com.android.dx.cf.code.BaseMachine.storeResults(BaseMachine.java:519)
 [apply]   at
com.android.dx.cf.code.ValueAwareMachine.run(ValueAwareMachine.java:196)
 [apply]   at
com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:290)
 [apply]   at
com.android.dx.cf.code.Simulator$SimVisitor.visitLocal(Simulator.java:542)
 [apply]   at
com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:517)
 [apply]   at com.android.dx.cf.code.Simulator.simulate(Simulator.java:96)
 [apply]   at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:681)
 [apply]   at com.android.dx.cf.code.Ropper.doit(Ropper.java:636)
 [apply]   at com.android.dx.cf.code.Ropper.convert(Ropper.java:253)
 [apply]   at
com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:252)
 [apply]   at
com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
 [apply]   at
com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
 [apply]   at com.android.dx.command.dexer.Main.processClass(Main.java:297)
 [apply]   at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
 [apply]   at com.android.dx.command.dexer.Main.access$100(Main.java:56)
 [apply]   at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
 [apply]   at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
 [apply]   at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
 [apply]   at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
 [apply]   at com.android.dx.command.dexer.Main.processOne(Main.java:245)
 [apply]   at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
 [apply]   at com.android.dx.command.dexer.Main.run(Main.java:139)
 [apply]   at com.android.dx.command.dexer.Main.main(Main.java:120)
 [apply]   at com.android.dx.command.Main.main(Main.java:87)
 [apply] ...at bytecode offset 00000057

--~--~---------~--~----~------------~-------~--~----~

2. WebView and Button in layout, only one of them can be clicked.

Could you post your layout xml file? Thanks.
R/




--~--~---------~--~----~------------~-------~--~----~

3. More than one package in my project on pre 1.5 sdk

4. how to adjust the window position on the framework layer

5. How to enable/disable GPRS/EDGE data connection

6. Black Screen problem with graphics update using unlockCanvasAndPost()

7. getting android_id from GoogleLoginServiceBlockingHelper?