xterm: Error 18, errno 13

Glynn Clements glynn at gclements.plus.com
Sat Dec 4 08:40:11 PST 2004


Javier Valencia wrote:

> > Is your kernel module checking both the device and inode number? Or is
> > it only checking the inode number, and mistaking /dev or /dev/pts for
> > the /bin directory? Note that /dev/pts definitely won't be on the root
> > filesystem, and /dev won't be on the root filesystem if you are using
> > devfs.
> 
> My module only checks for inode number,

That's a bug. Inode numbers are only unique per filesystem (i.e. disk,
partition etc).

> it prints "write denied on inode 4", that is my /bin directory.

Every filesystem will have an inode numbered 4. Inode 4 on your root
filesystem may be the /bin directory; inode 4 on /dev/pts will be one
of the ptys.

> Another thing very curious, is that the 
> first xterm gets frozen with this error, but all next xterms work 
> perfectly!! Why am i having this error only in the first xterm?

Only one pty will have inode number 4; other ptys will have different
inode numbers.

> stats of my /bin:
> 
>   File: `/bin/'
>   Size: 3712            Blocks: 7          IO Block: 131072 directory
> Device: 304h/772d       Inode: 4           Links: 2

So your module should be checking (pseudo-code):

	if (device == 0x0304 && inode == 4)
		...

and not just checking the inode number.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list