Subject: port-i386/500: file system space is lost
To: None <>
From: Lennart Augustsson <>
List: netbsd-bugs
Date: 09/28/1994 16:05:03
>Number:         500
>Category:       port-i386
>Synopsis:       file system space is lost
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 28 16:05:02 1994
>Originator:     Lennart Augustsson
"Chalmers Univ. of Tech"
System: NetBSD 1.0_BETA NetBSD 1.0_BETA (MARVIN) #409: Thu Sep 8 11:21:23 MET DST 1994 i386

	When the program below is run 1M of file system space is
	lost, despite the created file being unlink()ed.
	compile the program below, do a 'df .', run it, and do 'df .' again.
	1M less, *sigh*

#include <sys/types.h>
#include <sys/mman.h>
char b[1024];
	int fd;
	int i;
	void *p;

	fd = creat("foo", 0666);
	for(i = 0; i < 1024; i++)
		write(fd, b, 1024);
	fd = open("foo", 0);
	p = mmap(0, 1024*1024, PROT_READ, 0, fd, 0);
	if (p == -1) perror("mmap");
	munmap(p, 1024*1024);