From owner-freebsd-current Sun Jun 13 18:22:11 1999 Delivered-To: freebsd-current@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id 894BC14C95; Sun, 13 Jun 1999 18:22:07 -0700 (PDT) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.3/8.9.3) with ESMTP id VAA02659; Sun, 13 Jun 1999 21:22:00 -0400 (EDT) Message-Id: <199906140122.VAA02659@cs.rpi.edu> To: The Hermit Hacker Cc: Matthew Dillon , "David E. Cross" , freebsd-current@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG, crossd@cs.rpi.edu Subject: Re: MMAP() in STABLE/CURRENT ... In-Reply-To: Message from The Hermit Hacker of "Sun, 13 Jun 1999 22:02:13 -0300." Date: Sun, 13 Jun 1999 21:22:00 -0400 From: "David E. Cross" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Here's the code: #include #include #include #include #include #include #define DBSIZE 733055625 int main(void) { int fd; unsigned char *dbp; fd=open(argv[1], O_CREAT | O_RDWR | O_TRUNC, 0600); lseek(fd, DBSIZE -1, SEEK_SET); write(fd, &fd, 1); dbp=mmap(NULL, DBSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); close (fd); memset(dbp, 0, DBSIZE); munmap(dbp, DBSIZE); return 0; } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message