Context: I want to gracefully close a TCP connection and I want to know if I need to worry about the ENOBUFS
error, even if it is rare.
On the web, there are two shutdown()
man pages - one is a kernel function and second is a C posix function. The posix man page has an additional return value - it says the function may fail with an error ENOBUFS (shutdown(2), shutdown(3p)). The posix one is 4 years old while the other one was modified 3 months ago.
One the other hand though, when I do the same but through my command line (man version 2.9.4), there is no posix and not even a C library function page, and only the kernel function page, which is 3 years old and does not specify ENOBUFS
as an error.
Which one should I prefer? The web man pages or from the terminal?
If there is a function that has man pages for both 2 and 3, which one do I pick? And if the pick depends, what to use in the case of shutdown()
? (Should I prefer the latest man page?)