Fsreadwritec

asmlinkage ssize_t sys_read(unsigned int fd, char _user * buf, size_t count)

struct file *file; ssize_t ret = -EBADF; int fput_needed;

file = fget_light(fd, &fput_needed); if (file) {

loff_t pos = file_pos_read(file); ret = vfs_read(file, buf, count, &pos); file_pos_write(file, pos); fput_light(file, fput_needed);

return ret;

Here, the bulk of the work is done by vfs_read, as described in Chapter 8.

A third ''type'' of system call acts as a multiplexer. Multiplexers use constants to delegate system calls to functions that perform very different tasks. A prime example is socketcall (discussed in Chapter 12), which groups together all network-related calls.

Continue reading here: Netsocketc

Was this article helpful?

0 0