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
This commit is contained in:
parent
11cdffc603
commit
20c9c3be5a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user