* return values:
* zero - success
* -EFAULT - vec points to an illegal address
- * -EINVAL - addr is not a multiple of PAGE_CACHE_SIZE,
- * or len has a nonpositive value
+ * -EINVAL - addr is not a multiple of PAGE_CACHE_SIZE
* -ENOMEM - Addresses in the range [addr, addr + len] are
* invalid for the address space of this process, or
* specify one or more pages which are not currently
if (start & ~PAGE_CACHE_MASK)
goto einval;
- if (start < FIRST_USER_PGD_NR * PGDIR_SIZE)
- goto enomem;
-
limit = TASK_SIZE;
if (start >= limit)
goto enomem;
+ if (!len)
+ return 0;
+
max = limit - start;
len = PAGE_CACHE_ALIGN(len);
- if (len > max)
- goto einval;
+ if (len > max || !len)
+ goto enomem;
end = start + len;