Utilize the fd directly rather than through opening its pseudo file in /proc, with this change it will be more compatible with different types of file descriptor including file descriptors of network sockets, while the old approach is kinda limited to files and pipes.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description of changes:
Utilize the fd directly rather than through opening its pseudo file in /proc, with this change it will be more compatible with different types of file descriptor including file descriptors of network sockets, while the old approach is kinda limited to files and pipes.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.