No atime updates of /dev nodes on local keyboard, mouse input in2.4.26

From: David McBride
Date: Tue Oct 12 2004 - 10:19:37 EST


Greetings,

Some software, such as Condor[1], depends on the fact that the atime of the /dev/console and /dev/input/mice files is updated when keystrokes are entered or a mouse is used, respectively.

However, certainly in recent kernels (I've tried stock 2.4.21 and 2.4.26) this doesn't appear to be the case. As I'm running Condor (for which source isn't available) and depend on these atime update semantics for correct operation I'm trying to re-add this functionality.

I found via Google a patch[2] to do exactly this for 2.6; I've been trying to implement my own equivilent on 2.4. However, I'm not at all familiar with the kernel internals and could use some help from someone with a better understanding of the code involved.

Specifically, the patch above for evdev.c and related input drivers apply cleanly on 2.4.26 -- and they work; atimes are now updated when mouse input occurs.

However, PS/2 keyboard support is more problematic. Code to do what I want already appears to exist in drivers/char/pc_keyb.c:

static ssize_t read_aux(struct file * file, char * buffer,
size_t count, loff_t *ppos)
{
[...]

if (count-i) {
file->f_dentry->d_inode->i_atime = CURRENT_TIME;
return count-i;
}

[...]

However, no /dev node receives an atime update when keystrokes are entered *and* when I added debugging printks to this section of code no messages appeared in dmesg -- suggesting that this conditional never evaluates to true. (I suspect that this function never gets called at all.)

I'm now a little lost. Can anyone help?
(If you reply, please explicitly CC me.)

Cheers,
Davidj
[2] http://www.ussg.iu.edu/hypermail/linux/kernel/0406.1/1612.html

--
David McBride <dwm99@xxxxxxxxxxxx>
Department of Computing, Imperial College, London
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/