[PATCH] _unlink() & rmdir() on /proc/*

Pavel Tsekov ptsekov@syntrex.com
Tue Jun 4 05:37:00 GMT 2002


Hello,

Currently "rm -rf" on a file or directory under /proc returns
ENOENT. This is not correct and is caused by the fact that
the posix filename for, say, /proc/uptime is translated to
the following win32 name: c:\cygwin\proc\uptime (if c:\cygwin
is mounted on /).

The attached patches fix this problem by returning EROFS
from _unlink() and rmdir() if path_conv::get_devn() returns
any of the following device numbers: FH_PROC, FH_PROCESS, FH_REGISTRY.

P.S. I don't expect this patches to be applied because they may look
like ugly hacks or something like that... I didn't find any more
appropriate way to fix this though without greater modifications to
the code. I see several ways of fixing this in a much better way:

1. unlink () and rmdir () should be made virtual functions in
fhandler_base.

2. mount should support mounting in read, write, read-write mode

But again this will involve greater modification of the code so I
don't want to do anything else before hearing people's opinions :)
I'm sure that this was discussed at least once and there may be
reasons for why the things are as they are.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syscalls.cc.diff
Type: application/octet-stream
Size: 548 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020604/a905213f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir.cc.diff
Type: application/octet-stream
Size: 474 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020604/a905213f/attachment-0001.obj>


More information about the Cygwin-patches mailing list