Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jan 2001 03:14:54 +0100
From:      Markus Holmberg <markush@acc.umu.se>
To:        freebsd-emulation@freebsd.org
Subject:   getcwd(3) after rmdir(2) or unlink(2) fails under Linux emulation
Message-ID:  <20010108031454.A10576@acc.umu.se>

next in thread | raw e-mail | index | archive | help

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi.

If modifying the current directory by either removing a directory or
unlinking a file (in one program), a subsequenct call to getcwd(3) in
another program executing under Linux emulation will fail.

This can be demonstrated by running the attached C program (compiled
under Linux) after removing a directory or a file in the current
directory.

Unfortunately due to limited experience in the kernel area I do not have
a patch to contribute. Unless the matter is brought forward in some way
on this list in a couple of days time I will send-pr it to make sure it
gets archived...

I'm running FreeBSD 4.2-STABLE from 2001-01-04.

Cheers, Markus.

(I'm not on the list, cc if more input is needed from me.)

-- 

Markus Holmberg         |       Give me Unix or give me a typewriter.
markush@acc.umu.se      |       http://www.freebsd.org/

--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cwd.c"

#include <unistd.h>
#include <stdio.h>

#define BUFSIZE 1024

int main(int argc, char *argv[])
{
	char buf[BUFSIZE];

	if (getcwd(buf, BUFSIZE) == NULL) {
		perror("getcwd");
		return 1;
	}

	printf("%s\n", buf);

	return 0;
}

--IJpNTDwzlM2Ie8A6--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010108031454.A10576>