Re: devfs_make_node()
Re: devfs_make_node()
- Subject: Re: devfs_make_node()
- From: Terry Lambert <email@hidden>
- Date: Thu, 8 Nov 2007 21:49:46 -0800
On Nov 8, 2007, at 9:02 PM, Nick Blievers wrote:
Also, if you look at Leopard sources for devfs, you will see that
there is a mechanism for creating directories, but there is no KPI
published for it, and its use is therefore completely unsipported
and subject to change; however, it does exist.
Again we are not trying to create directories directly, they are
created as a by-product of calling devfs_make_node() with a full
path, which the comments say (when calling dev_finddir()) acts like
a mkdir -p.
Are you sure you are not running into the fact that we now enforce
DEVMAXNAMESIZE, instead of copying off into random memory at the end
of the structure? There is a limit of 32 bytes on the path length,
including all component separators.
If you hack and use the unpublished method, be aware that the a_dvp
needs to point to the directory in which the node is being created,
so you have to do it by basing it there, rather than at the root of
devfs. Specifically path component separators are not recognized.
devfs_make_node() is a published method... that used to allow the
creation of directories within /dev. It still does provide that
functionality, just truncating one of the path elements due to an
off by one error.
Also FWIW: This is exactly what I told you in the radar.
Sort of. I really think we are talking at cross purposes here. I am
not trying to do anything new and different from whats been done
previously, and I am certainly not trying to make life difficult for
you. Its just that, as far as I am aware, I am using a published
interface that has had a behaviour change from Tiger to Leopard, due
to an off by one error.
Thanks for the detailed feedback, and while I will obviously look
for alternate solutions (since calling devfs_make_node("/dev/fooX/
bah") really sucks), I still maintain that this is a regression.
Please file a radar. This was not clear from your previous radar (in
which we did resolve an off-by-one error), and as long as you are not
bumping into DEVMAXNAMESIZE, we would need a radar number to hang the
work off of, even if we knew it was a bug.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden