Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jan 2001 02:46:22 +0100 (CET)
From:      markush@acc.umu.se
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/24315: getcwd under Linux emulation fails after rmdir
Message-ID:  <20010114014622.C3B13382A@romy.carbonide.com>

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

>Number:         24315
>Category:       kern
>Synopsis:       getcwd under Linux emulation fails after a rmdir
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 13 17:50:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Markus Holmberg
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
n/a
>Environment:

	FreeBSD 4.2-STABLE

>Description:

	After doing a rmdir(2) on a directory (in FreeBSD "mode", in a
	shell for example), a program executing under Linux emulation
	will fail the call to getcwd with the error "Not a directory".

>How-To-Repeat:

	$ cd /tmp
	$ ./cwd
	/tmp
	$ mkdir foo
	$ rmdir foo
	$ ./cwd
	getcwd: Not a directory


	# to "fix" the problem, do a "cd ."

	$ cd .
	$ ./cwd
	/tmp

cwd.c:

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

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

        if ((buf = getcwd(NULL, 0)) == NULL) {
                perror("getcwd");
                return 1;
        }
        printf("%s\n", buf);

        return 0;
}
------------------------------------------------------


>Fix:

	Not known.


>Release-Note:
>Audit-Trail:
>Unformatted:


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




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