if ((compat_ssize_t) count < 0)
return -EINVAL;
- return sys_read(fd, buf, count);
+ return ksys_read(fd, buf, count);
}
COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, compat_size_t, count)
file->f_pos = pos;
}
-SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
+ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count)
{
struct fd f = fdget_pos(fd);
ssize_t ret = -EBADF;
return ret;
}
+SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
+{
+ return ksys_read(fd, buf, count);
+}
+
ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count)
{
struct fd f = fdget_pos(fd);
unsigned int count);
int ksys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
off_t ksys_lseek(unsigned int fd, off_t offset, unsigned int whence);
+ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count);
/*
* The following kernel syscall equivalents are just wrappers to fs-internal
ksys_ioctl(fd, TCGETS, (long)&termios);
termios.c_lflag &= ~ICANON;
ksys_ioctl(fd, TCSETSF, (long)&termios);
- sys_read(fd, &c, 1);
+ ksys_read(fd, &c, 1);
termios.c_lflag |= ICANON;
ksys_ioctl(fd, TCSETSF, (long)&termios);
ksys_close(fd);
* Read block 0 to test for compressed kernel
*/
ksys_lseek(fd, start_block * BLOCK_SIZE, 0);
- sys_read(fd, buf, size);
+ ksys_read(fd, buf, size);
*decompressor = decompress_method(buf, size, &compress_name);
if (compress_name) {
* Read 512 bytes further to check if cramfs is padded
*/
ksys_lseek(fd, start_block * BLOCK_SIZE + 0x200, 0);
- sys_read(fd, buf, size);
+ ksys_read(fd, buf, size);
if (cramfsb->magic == CRAMFS_MAGIC) {
printk(KERN_NOTICE
* Read block 1 to test for minix and ext2 superblock
*/
ksys_lseek(fd, (start_block+1) * BLOCK_SIZE, 0);
- sys_read(fd, buf, size);
+ ksys_read(fd, buf, size);
/* Try minix */
if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
}
printk("Loading disk #%d... ", disk);
}
- sys_read(in_fd, buf, BLOCK_SIZE);
+ ksys_read(in_fd, buf, BLOCK_SIZE);
ksys_write(out_fd, buf, BLOCK_SIZE);
#if !defined(CONFIG_S390)
if (!(i % 16)) {
static long __init compr_fill(void *buf, unsigned long len)
{
- long r = sys_read(crd_infd, buf, len);
+ long r = ksys_read(crd_infd, buf, len);
if (r < 0)
printk(KERN_ERR "RAMDISK: error while reading compressed data");
else if (r == 0)