Nonotify 0.3.2 (A simple dnotify replacement)
A message that is not in the archive (sent off-list or not yet received): [email protected]
On Sun, 22 Aug 2004 05:40:06 +0200, you wrote in linux.kernel:
Quoted 7 lines
2) The
/dev/nonotifydevice:
/dev/nonotifyhas the only purpose to offer a specialstat()call via ioctl to read thecontents_mtimefield of directories (together with atime, mtime, ctime). The client has to set the 'filename' field of the 'nonotify_stat' structure and receives the four timespec fields updated via ioctl.
A lot of people here (Linus, for instance) frown on ioctl() interfaces. They're hard to do right in 32/64bit compat layers, for example. How about using a syscall interface instead?
Signature · 2 lines
Ciao, Pascal
Quoted 10 lines · Pascal Schmidt
On Sun, 22 Aug 2004 05:40:06 +0200, you wrote in linux.kernel:
Quoted 7 lines
2) The
/dev/nonotifydevice:
/dev/nonotifyhas the only purpose to offer a specialstat()call via ioctl to read thecontents_mtimefield of directories (together with atime, mtime, ctime). The client has to set the 'filename' field of the 'nonotify_stat' structure and receives the four timespec fields updated via ioctl.
Quoted 3 lines
A lot of people here (Linus, for instance) frown on
ioctl()interfaces. They're hard to do right in 32/64bit compat layers, for example. How about using a syscall interface instead?
Nonotify uses ioctl mainly for 'pragmatical' reasons. A syscall would be technically better - that's for sure, actually it was my initial idea to use one (or to change the stat-call).
But i didn't want to bother people with asking to assign me a syscall-number before even knowing if they like my idea. And changing it to use a syscall lateron would be no problem at all from the concept of nonotify.
Also - as a kernel newbie - i didn't find any good documentation how to add my own syscall into the kernel. I just wanted to get nonotify working as an 'optional patch', without changing tons of files.
But you could help me if you have a look at my ioctl function. I'm using a structure which contains a char* pointer and four timespec fields. Do you know if this causes problems with 32/64bit compatibility.
Thanks,
Norbert
Quoted 4 lines · nf
But i didn't want to bother people with asking to assign me a syscall-number before even knowing if they like my idea. And changing it to use a syscall lateron would be no problem at all from the concept of nonotify.
Right. It's just something to consider if you aim for inclusion in the mainline tree later.
Quoted 3 lines
Also - as a kernel newbie - i didn't find any good documentation how to add my own syscall into the kernel. I just wanted to get nonotify working as an 'optional patch', without changing tons of files.
Adding a syscall should roughly work like this:
- write your sys_foo() function
- add your syscall number to include/asm-i386/unistd.h, don't forget to change the "#define NR_syscalls" accordingly
- add ".long sys_foo" to sys_call_table in arch/i386/kernel/entry.S, in the right place (i.e. syscall 290 would need to be element 290 in the list)
- arrange for the object file with sys_foo in it to be linked into the kernel
You're right, your going to have to touch a couple of files for this approach.
Quoted 3 lines
But you could help me if you have a look at my ioctl function. I'm using a structure which contains a char* pointer and four timespec fields. Do you know if this causes problems with 32/64bit compatibility.
I don't think the timespecs will be a problem. However, the char pointer will have different sizes and alignment requirements on 32bit and 64bit system. I'm no expert in how that can be handled in the compat layer, though.
Signature · 2 lines
Ciao, Pascal