[lkml]   [2008]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Questions about mmap
Thiago Lacerda wrote:
> typedef struct hashtable {
> flow_t *hashBuckets[X]; // X is a natural number
> unsigned int size;
> } Hastable;
> So, my question is: Can I mmap the hashtable struct and access
> directly from userspace? I'm afraid that this could turn on mess
> because of the array of pointers.
> If it's possible, does anyone know a piece of code that can match my
> problem? I've been googling and I just find codes dealing with structs
> itself, not pointers.

If you require portability, you can only use integer types of fixed size
in kernel<->userspace ABIs. Pointers can then be exchanged as __u64
under the assumption that pointers not wider than 64 bits. See for
example the FW_CDEV_IOC_QUEUE_ISO ioctl in include/linux/firewire-cdev.h.
Stefan Richter
-=====-==--- =-=- --=-=

 \ /
  Last update: 2008-10-05 16:05    [W:0.082 / U:6.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site