Skip to content

Commit

Permalink
Add SO_ERROR support for getsockoption()
Browse files Browse the repository at this point in the history
The errno information is private data inside socket data structure.
For some reason SO_ERROR for getsockoption() is not implemented.

This ifunctionality is important for code handing O_NONBLOCK sockets.
  • Loading branch information
dkloper committed May 29, 2024
1 parent 0c4ca43 commit 8f8a43e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions StdLib/EfiSocketLib/Socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2892,6 +2892,13 @@ EslSocketOptionGet (
pOptionData = (CONST UINT8 *)&pSocket->Type;
LengthInBytes = sizeof ( pSocket->Type );
break;
case SO_ERROR:
//
// Return the socket type
//
pOptionData = (CONST UINT8 *)&pSocket->errno;
LengthInBytes = sizeof ( pSocket->errno );
break;
}
break;
}
Expand Down

0 comments on commit 8f8a43e

Please sign in to comment.