> From: Gilles Chanteperdrix [mailto:[email protected]]
> Sent: Wednesday, May 04, 2011 8:41 AM
>
> What I suggest, is that you make a patch which removes the read
> implementation and adds the readv implementation. In this case, the
> kernel will use readv to implement read anyway, and there will be no
> code duplication.
Thank you for the clarification. However, in the (still used by us) Linux
2.4.25 kernel's function
asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count)
{
ssize_t ret;
struct file * file;
ret = -EBADF;
file = fget(fd);
if (file) {
if (file->f_mode & FMODE_READ) {
ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
file, file->f_pos, count);
if (!ret) {
ssize_t (*read)(struct file *, char *, size_t, loff_t *);
ret = -EINVAL;
if (file->f_op && (read = file->f_op->read) != NULL)
ret = read(file, buf, count, &file->f_pos);
}
}
if (ret > 0)
dnotify_parent(file->f_dentry, DN_ACCESS);
fput(file);
}
return ret;
}
it doesn’t look like it would use readv to implement read, so I'm afraid that
your otherwise good suggestion would not work with such old kernel versions.
--
Dietmar
--------------------------------------------------------
manroland AG
Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul
Steidle
Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht
Offenbach HRB-Nr. 42592
USt-Ident-Nr. DE 250200933
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help