[openbeosstorage] Re: ddm questions

On 2003-10-24 at 20:03:28 [+0200], you wrote:
> > > > + Do I need to copy out the data in the pointer arguments (all of 
> > > > which
> > > > are
> > > > names) for the _kern_validate_set_partition_{name,content_name,type}()
> > > > functions? I can't really see any reason to other than truncating long
> > > > names, but I was planning on returning B_NAME_TOO_LONG in those
> > > > instances
> > > > anyway.
> > > 
> > > Well, _kern_validate_set_partition_type()'s argument is a const char*, 
> > > so
> > > I
> > > guess I know the answer for that one already,
> > 
> > Exactly. :-)
> > 
> > > but the question stands for
> > > the other two.
> > 
> > Yep, the non-const was chosen intentionally. I had the feeling, that e.g.
> > truncating a name wouldn't be too unusual.
> 
> So do you not want me to return B_NAME_TOO_LONG if the name is larger than
> B_OS_NAME_LENGTH and instead let the validate function handle things?

That's what I was trying to say. :-) The string is passed to the disk system, 
which will truncate the name, if necessary, and the syscall just needs to 
copy it back into userland space.

CU, Ingo

Other related posts: