Debian Codegraph @

runtime/linux/autoconf-kernel_read-new-args.c

raw
1 //
2 // The following kernel commit changed the kernel_read() function signature:
3 //
4 // commit bdd1d2d3d251c65b74ac4493e08db18971c09240
5 // Author: Christoph Hellwig <[email protected]>
6 // Date: Fri Sep 1 17:39:13 2017 +0200
7 //
8 // fs: fix kernel_read prototype
9 //
10 // Use proper ssize_t and size_t types for the return value and count
11 // argument, move the offset last and make it an in/out argument like
12 // all other read/write helpers, and make the buf argument a void pointer
13 // to get rid of lots of casts in the callers.
14 //
15 // Signed-off-by: Christoph Hellwig <[email protected]>
16 // Signed-off-by: Al Viro <[email protected]>
17 //
18 // This changed the function signature from:
19 //
20 // int kernel_read(struct file *file, loff_t offset, char *addr,
21 // unsigned long count);
22 //
23 // to:
24 //
25 // ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos);
26 //
27
28 #include <linux/fs.h>
29
30 ssize_t foo(struct file *file, void *buf, size_t count, loff_t *pos);
31
32 ssize_t foo(struct file *file, void *buf, size_t count, loff_t *pos)
33 {
34 return kernel_read(file, buf, count, pos);
35 }