[lkml]   [2000]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH,preliminary] cleanup shm handling
Hi David,

On Wed, 13 Dec 2000, David Howells wrote:
>>> I'm currently writing a Win32 emulation kernel module to help
>>> speed Wine up,
> ^^^^^^^^^^^^^
>> fd = shm_open ("xxx",...)
>> ptr = mmap (NULL, size, ..., fd, offset);
> I am doing this from within kernel space. I'd like to avoid doing
> the full open and mmap if possible. I was wondering if there're some
> shortcuts I could make use of.

There will be a

struct file *shmem_file_setup(char * name, loff_t size)

which gives you an open sruct file to an unlinked file of size
size. You can then do

user_addr = (void *) do_mmap (file, addr, size, prot, flags, 0);

with that struct file. You can look at shmget/shmat in ipc/shm.c. They
use the same procedure form kernel space.

All this will only work with my patch.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.066 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site