This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Attachment: syscalls.cc.diff
Description: Binary data

Attachment: dir.cc.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]