Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sys/compat/linux/linux_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ static int
linux_mmap_check_fp(struct file *fp, int flags, int prot, int maxprot)
{

/* Linux returns EBADF if mmap() is called on an O_PATH file descriptor */
if (fp->f_ops == &path_fileops)
return (EBADF);

/* Linux mmap() just fails for O_WRONLY files */
if ((fp->f_flag & FREAD) == 0)
return (EACCES);
Expand Down
Loading