lksctp-tools icon indicating copy to clipboard operation
lksctp-tools copied to clipboard

Why does sctp_recvmsg return int instead of ssize_t?

Open jefftt opened this issue 2 years ago • 3 comments

Hello, I was wondering why sctp_recvmsg returns int here instead of ssize_t which is defined in the spec here.

In my case ssize_t is 64 bits and int is 32 bits so an int with a value of -1 will be 4294967295 in 64 bits

jefftt avatar Nov 04 '22 20:11 jefftt

I have no idea. It pre-dates git history. I would guess it was an overlook. But agree, a classic type of bug that this needs fixing here. The standard recvmsg also returns ssize_it.

marceloleitner avatar Nov 25 '22 13:11 marceloleitner

What's the contributing process? I'd be happy to submit a patch, the only question I have is how will the API change be handled. Would this be considered a breaking change?

jefftt avatar Dec 02 '22 13:12 jefftt

Cool. We're transitioning from patch over emails to using pull requests here. For now you can pick one and we will adjust.

On the API change, that's a good question. It's been so long.. I'm afraid we will have to figure it out. API wise, I think this is okay. Both are signed and no sctp msg can ever use that much. But ABI wise, I need to check.

marceloleitner avatar Dec 09 '22 13:12 marceloleitner