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. Errors when trying to build an example from a guide...how can I resolve.

OS: Ubuntu 8.04.1
IDE: Netbeans 6.5 Beta

Addtional info:
----------------------
Android SDK installed
Android plugins installed.

Guide being followed:
-----------------------
http://wiki.netbeans.org/IntroAndroidDevNetBeans

When i get to the first build and run part I get this error

***
init:
deps-jar:
ERROR: Unknown command 'compile'
Android Asset Packaging Tool

Usage:
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
List contents of Zip-compatible archive.

aapt d[ump] WHAT file.{apk} [asset [asset ...]]
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.

aapt p[ackage] [-f][-u][-m][-v][-x][-M AndroidManifest.xml] \
[-I base-package [-I base-package ...]] \
[-A asset-source-dir] [-P public-definitions-file] \
[-S resource-sources] [-F apk-file] [-J R-file-dir] \
[raw-files-dir [raw-files-dir] ...]

Package the android resources. It will read assets and resources that
are
supplied with the -M -A -S or raw-files-dir arguments. The -J -P -F
and -R
options control which files are output.

aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]
Delete specified files from Zip-compatible archive.

aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]
Add specified files to Zip-compatible archive.

aapt v[ersion]
Print program version.

Modifiers:
-a print Android-specific data (resources, manifest) when listing
-c specify which configurations to include. The default is all
configurations. The value of the parameter should be a comma
separated list of configuration values. Locales should be specified
as either a language or language-region pair. Some examples:
en
port,en
port,land,en_US
If you put the special locale, zz_ZZ on the list, it will perform
pseudolocalization on the default locale, modifying all of the
strings so you can look for strings that missed the
internationalization process. For example:
port,land,zz_ZZ
-d one or more device assets to include, separated by commas
-f force overwrite of existing files
-j specify a jar or zip file containing classes to include
-m make package directories under location specified by -J
-u update existing packages (add new, replace older, remove deleted
files)
-v verbose output
-x create extending (non-application) resource IDs
-z require localization of resource attributes marked with
localization="suggested"
-A additional directory in which to find raw asset files
-F specify the apk file to output
-I add an existing package to base include set
-J specify where to output R.java resource constant definitions
-M specify full path to AndroidManifest.xml to include in zip
-P specify where to output public resource definitions
-S directory in which to find resources
-0 don't compress files we're adding
/home/pokeymon/hd2/data/programming/MyFirstAndroidApp/nbproject/build-
impl.xml:334: exec returned: 2
BUILD FAILED (total time: 0 seconds)
***


How can I resolve that.

Thanks.

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

2. app>dialog>textentry getting the EditText values

Hello all,

I've been playing around with the dialogs and have been trying to get
the values of the username and password EditTexts in the text entry
dialog API demo. I added the two lines of code to try to get the value
in the onClick method:

case DIALOG_TEXT_ENTRY:
            // This example shows how to add a custom layout to an
AlertDialog
            LayoutInflater factory = LayoutInflater.from(this);
            final View textEntryView =
factory.inflate(R.layout.alert_dialog_text_entry, null);
            return new AlertDialog.Builder(AlertDialogSamples.this)
                .setIcon(R.drawable.alert_dialog_icon)
                .setTitle(R.string.alert_dialog_text_entry)
                .setView(textEntryView)
                .setPositiveButton(R.string.alert_dialog_ok, new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {

                        EditText userNameEditText= (EditText)
findViewById(R.id.username_edit);
                        String userName=
userNameEditText.getText().toString();

                    }
                })
                .setNegativeButton(R.string.alert_dialog_cancel, new
DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int
whichButton) {

                        /* User clicked cancel so do some stuff */
                    }
                })
                .create();
        }
        return null;


It runs ok until i push the "ok" button. I then get an "application
has stopped unexpectedly" error.
What is the right way to access the values?

Cheers

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

3. JOIN New Google Group: Android-Freeware!

4. Draw graphics with opengl

5. Adding content to a tab view dynamically

6. Exception when leaving an activity (with the back button) which is binded to a Service

7. Difficult Paragraph on Tasks