Howto pass pointer to char parameter to kernel via copy_to_user()

by Danke Xie » Wed, 21 Jul 2010 04:25:56 GMT


Sponsored Links
 Hi Dwi,

I couldn't really figure out what is being done in the code. But I
think I noticed a reason why the call might fail (though not 100%
sure). You allocated one byte with kmalloc, which is sizeof(char), but
you would be copying 4 bytes into the area, that is sizeof(tmp). I
think that's why you got a seg fault. Do you think so?

Regards,
Danke




-- 



Other Threads

1. Galley of thumbnails from the web running out of memory

My application loads 12 100x100 thumbnail images from the web using
the code below.  I then display the thumbnails in a GridView using an
ImageAdapter derived from BaseAdapter.  I'm running into memory issues
because each of the thumbnails is held in memory as a Bitmap.

This seems like a fairly straightforward application (display a
gallery of thumbnails from the web), can some give me advice on how to
reduce my memory needs?  Maybe there's a better way to display web
images in a GridView that doesn't involve downloading and storing each
one as a Bitmap?


                // Download a Bitmap thumbnail for each photo
                Bitmap bm;
                HttpGet httpRequest;
                HttpClient httpclient;
                HttpResponse response;
                HttpEntity entity;
                InputStream instream = null;
                BufferedHttpEntity bufHttpEntity;
                for (Photo photo : photos) {
                        try {

                                httpRequest = new HttpGet(photo.getThumbnail());

                                httpclient = new DefaultHttpClient();
                                response = (HttpResponse) httpclient
                                                .execute(httpRequest);

                                entity = response.getEntity();
                                bufHttpEntity = new BufferedHttpEntity(
                                                entity);
                                instream = bufHttpEntity.getContent();

                                bm = BitmapFactory.decodeStream(instream);

                                photo.setBm(bm);
                                listener.onPhotoDownloadListener(photo);
                        } catch (Exception e) {

                        } finally {
                                try {
                                        if (instream != null) {
                                                instream.close();
                                        }
                                } catch (IOException e) {
                                        e.printStackTrace();
                                }
                        }
                }

-- 

2. executing a shell script from Android application

Hi all,

  I am configuring wifi on my android based board using shell script.
Now I want to execute the same script from android application. For
that, I had used following code, but it didn't give any success till
now,

I had executed same script from "adb shell" prompt and it works
nicely.

Process exeCommands = Runtime.getRuntime().exec("/data/busybox/
board_script.sh");

is there anything else required than this???

Please help..
Asif

-- 

3. No visual feedback for preference defaults - bug or feature?

4. Finding a Point-Of-Interest

5. bind to a remore service

6. Eclair build bootup issue on Beagle board.

7. Suspicious TCP RST packets while device is sleeping.