look into the getsockopt call and the option SO_SNDBUF layer as SOL_SOCKET and the rest is up to you to figure out.
I found these in the socket(7) man page, and I also looked at the getsockopt(2) man page but Im still trying to figure some of it out.
EDIT:
ok, Im not that great with C, C++ is much more my style, but I threw together a simple little C program that checks what the send buffer size is. I didn't do any double checking, so this might be wrong, but might as well give it a shot, here is the code
Code:
#include <sys/socket.h>
#include <sys/types.h>
#include <stdio.h>
int main(void)
{
int mysocket,buffsize,length;
length = sizeof(int);
mysocket = socket(PF_INET,SOCK_STREAM,6);
getsockopt(mysocket, SOL_SOCKET,SO_SNDBUF,&buffsize,&length);
printf("the send buff is %i bytes in size.\n", buffsize);
return 0;
}
I got
the send buff is 16384 bytes in size.
for the output.