Reputation: 7547
I went through the documentation, but still didn't get what does optlen do in getsockopt(int s, int level, int optname, void *optval,
socklen_t *optlen)
, can anyone explain?
Upvotes: 2
Views: 619
Reputation: 3449
Optlen is an in-out parameter used to specify the length of the buffer.
Upvotes: 1
Reputation: 311054
You set it to the size of the data item you're receiving the option value into. On return the size may have been adjusted.
The documentation does say that.
Upvotes: 3