summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/pf
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2015-07-29 06:31:44 +0000
committered <ed@FreeBSD.org>2015-07-29 06:31:44 +0000
commit6b0f23aa74024f30bd5dcb208dd6b97b348d491d (patch)
tree1ccfa9bf01d3687a1ac9ee3a666ca13dc59c3823 /sys/netpfil/pf
parentdc24acf353f991eedc9c11264a4358d8097a89c1 (diff)
downloadFreeBSD-src-6b0f23aa74024f30bd5dcb208dd6b97b348d491d.zip
FreeBSD-src-6b0f23aa74024f30bd5dcb208dd6b97b348d491d.tar.gz
Implement CloudABI's readdir().
Summary: CloudABI's readdir() system call could be thought of as a mixture between FreeBSD's getdents(2) and pread(). Instead of using the file descriptor offset, userspace provides a 64-bit cloudabi_dircookie_t continue reading at a given point. CLOUDABI_DIRCOOKIE_START, having value 0, can be used to return entries at the start of the directory. The file descriptor offset is not used to store the cookie for the reason that in a file descriptor centric environment, it would make sense to allow concurrent use of a single file descriptor. The remaining space returned by the system call should be filled with a partially truncated copy of the next entry. The advantage of doing this is that it gracefully deals with long filenames. If the C library provides a buffer that is too small to hold a single entry, it can still extract the directory entry header, meaning that it can retry the read with a larger buffer or skip it using the cookie. Test Plan: This implementation passes the cloudlibc unit tests at: https://github.com/NuxiNL/cloudlibc/tree/master/src/libc/dirent Reviewers: marcel, kib Reviewed By: kib Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3226
Diffstat (limited to 'sys/netpfil/pf')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud