I know I can cat /proc/sys/net/core/wmem_max to get the maximum size for SO_SNDBUF on a socket, but is there an easy way to query that value in C without going through the klud
Couldn't you invoke the sysctl command on the shell (use system() or popen/pclose()) to get this information...at least avoids opening a file but may be equivalent in overall ugliness: