From owner-freebsd-hackers Tue Jan 23 13:33:13 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA18867 for hackers-outgoing; Tue, 23 Jan 1996 13:33:13 -0800 (PST) Received: from Relay1.Austria.EU.net (relay1.Austria.EU.net [192.92.138.47]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA18857 for ; Tue, 23 Jan 1996 13:33:00 -0800 (PST) From: marino.ladavac@aut.alcatel.at Received: from atusks01.aut.alcatel.at by Relay1.Austria.EU.net with SMTP id AA05101 (5.67b/IDA-1.5 for ); Tue, 23 Jan 1996 22:32:47 +0100 Received: from atuhc16 by atusks01.aut.alcatel.at (4.1/SMI-4.1/AAA-1.29/main) id AA07374; Tue, 23 Jan 96 22:31:57 +0100 Message-Id: <9601232131.AA07374@atuhc16.atusks01.aut.alcatel.at> Received: by atuhc16 (1.38.193.4/16.2) id AA19137; Tue, 23 Jan 1996 22:31:55 +0100 Subject: Re: Amancio's tv program with capture! To: james@miller.cs.uwm.edu (Jim Lowe) Date: Tue, 23 Jan 96 22:31:55 MET Cc: hackers@freebsd.org In-Reply-To: <199601232053.OAA14413@miller.cs.uwm.edu>; from "Jim Lowe" at Jan 23, 96 2:53 pm Mailer: Elm [revision: 70.85] Sender: owner-hackers@freebsd.org Precedence: bulk > > > How does one mark the driver/mmapped memory as shared memory > > > with the current utilities? It isn't real obvious that one can > > > actually do this without modifiying the shmat system call (or at > > > least to me). > > > > > > int fd; > > caddr_t mapaddr; > > > > if( ( fd = open( DEV_NAME, O_RDWR)) == -1) { > > perror( "open"); > > exit( 1); > > } > > > > mapaddr = mmap( 0, /* map here, 0 = don't care*/ > > DEV_MEM_SIZE, /* device memory window*/ > > PROT_READ|PROT_WRITE, /* will be reading/writing*/ > > MAP_HASSEMAPHORE, /* (?) prevent caching*/ > > fd, /* fd for device*/ > > (off_t)0 /* full window*/ > > ); > > > I know how to mmap. The question is once you have mapaddr how does > one attach that to X's shared memory functions through the Xshm > utilities? I don't beleive I have ever head of map_hassemaphore... Is it possible to mmap() something to the address returned by shmat()? Something like: shmaddr = shmat( shmid, NULL, 0 ); mapaddr = mmap( shmaddr, ... ); I haven't got a slightest clue about this approach. /Alby > -Jim