[PATCH] fadvise: return ESPIPE on FIFO/pipe
The patch makes posix_fadvise return ESPIPE on FIFO/pipe in order to be fully POSIX-compliant. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
99aef427e2
commit
87ba81dba4
1 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,11 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
|
|||
if (!file)
|
||||
return -EBADF;
|
||||
|
||||
if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) {
|
||||
ret = -ESPIPE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mapping = file->f_mapping;
|
||||
if (!mapping || len < 0) {
|
||||
ret = -EINVAL;
|
||||
|
|
Loading…
Reference in a new issue