The kernel and character set encodings
The kernel and character set encodings
Posted Feb 20, 2004 17:37 UTC (Fri) by Ross (guest, #4065)In reply to: The kernel and character set encodings by flewellyn
Parent article: The kernel and character set encodings
But you are using C strings to denote the elements which means they are
still NUL terminated. To fix it you need a second array for the path
component lengths. I think you are unlikely to convince any of the kernel
guys this isn't too ugly to live.
Posted Feb 20, 2004 22:32 UTC (Fri)
by spitzak (guest, #4593)
[Link]
One possibly less-ugly scheme is to use Plan9's "walk" style. You have With this, no arrays are passed to the kernel, and it does not have to
I agree that a length is needed, not just for encoding NUL, but to allow The kernel and character set encodings
a slash-seperated name to be quickly converted to this form, without a
need to malloc and copy a block of memory for each piece.
"file descriptors" that represent a filename, unopened as yet. These are
created by copying an
existing one (a small set, such as one for "/", are provided when the
program starts up, like stdin/out). There is then a call something like
walk(fd,char* name,int length) which moves fd to the subdirectory in
name[0..length-1]. When you finally are at the desired file you call
open(fd,mode). Existing open() calls would be turned into a bunch of walk
calls followed by a new open.
store these arrays.
