tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

vectorized fsyncv(2) syscall -- useful?

readv(2)/writev(2) are the vectorized forms of read(2)/write(2).  They
exist to reduce the number of context switches required when dealing
with batches of IO.

I think that it would be both useful and trivial to add an fsyncv(2)
syscall to src/sys/kern/vfs_syscalls.c.  I'm thinking along the lines


/* struct and prototype in unistd.h */
struct fsyncvec
        int fd;
                int errno; /* output */
                int how; /* input */
        } u;
        off_t start;
        off_t len;

/* return how many of the sv[] processed successfully */
int fsyncv(const struct fsyncvec *sv, int svcnt);


Indicate total success by returning svcnt.  [Also] indicate individual
sv[n] success by setting sv[n].u.errno equal to 0.

#define EOKAY 0 /* add this to sys/errno.h ? */

Agree?  Disagree?  "Patches welcome"?

Everquick Internet -
A division of Brotsman & Dreger, Inc. -
Bandwidth, consulting, e-commerce, hosting, and network building
Phone: +1 785 865 5885 Lawrence and [inter]national
Phone: +1 316 794 8922 Wichita
DO NOT send mail to the following addresses: -*- -*-
Sending mail to spambait addresses is a great way to get blocked.
Ditto for broken OOO autoresponders and foolish AV software backscatter.

Home | Main Index | Thread Index | Old Index