diff options
author | Ed Maste <emaste@FreeBSD.org> | 2023-03-31 18:50:26 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2023-04-04 13:29:53 +0000 |
commit | 20c9c3be5acc66de9081f1f24456a62ba9395c4f (patch) | |
tree | a4d35412590cf3c95490378e46fc6a5475410f1d /lib/libc | |
parent | 11cdffc60325580d55e0ab835429d3fda2cbc8fb (diff) | |
download | src-20c9c3be5acc66de9081f1f24456a62ba9395c4f.tar.gz src-20c9c3be5acc66de9081f1f24456a62ba9395c4f.zip |
kqueue: add close() calls to man page example
There is no real need to close descriptors before a process exits, but
these close calls demonstrate by example that kqueue descriptors occupy
the same namespace as other file descriptors.
Reviewed by: fernape, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39376
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/kqueue.2 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index af60bb396d6a..cad4361f2b3c 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -773,6 +773,10 @@ main(int argc, char **argv) printf("Something was written in '%s'\en", argv[1]); } } + + /* kqueues are destroyed upon close() */ + (void)close(kq); + (void)close(fd); } .Ed .Sh ERRORS |