freebsd-dev/sys/compat
Dmitry Chagin 3a66cf0372 Replace Linuxulator implementation of readdir(), getdents() and
getdents64() with wrapper over kern_getdirentries().

The patch was originally written by emaste@ and then adapted by trasz@
and me.

Note:
1. I divided linux_getdents() and linux_readdir() as in case when the
getdents() called with count = 1 (readdir() case) it can overwrite
user stack (by writing to user buffer pointer more than 1 byte).

2. Linux returns EINVAL in case when user supplied buffer is not enough
to contain fetched dirent.

3. Linux returns ENOTDIR in case when fd points to not a directory.

Reviewed by:		trasz@
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D2210
2017-02-14 19:13:27 +00:00
..
cloudabi Rework r313352. 2017-02-13 09:04:38 +00:00
cloudabi32 Regenerate all the system call tables to drop "created from" lines. 2017-02-10 19:45:02 +00:00
cloudabi64 Regenerate all the system call tables to drop "created from" lines. 2017-02-10 19:45:02 +00:00
freebsd32 Rework r313352. 2017-02-13 09:04:38 +00:00
ia32 Tidy up ia32_sysvec sv_flags setting 2016-10-20 20:29:54 +00:00
linprocfs Remove PG_CACHED-related fields from struct vmmeter, because they are no 2016-11-22 18:13:46 +00:00
linsysfs Add support to the jail framework to be able to mount linsysfs(5) and 2015-07-19 08:52:35 +00:00
linux Replace Linuxulator implementation of readdir(), getdents() and 2017-02-14 19:13:27 +00:00
linuxkpi/common Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
ndis ndis(4): Undo unneeded workarounds in ndis' rand(). 2016-05-22 14:13:20 +00:00
netbsd Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
svr4 Regenerate all the system call tables to drop "created from" lines. 2017-02-10 19:45:02 +00:00
x86bios x86bios: spelling fix in a comment. 2016-04-30 00:34:04 +00:00