I am currently trying to add systemd socket activation to my socket-based application. Therefore I have to construct a Socket from a file descriptor, similarly to Network.Socket's mkSocket and also convert the socket to a file descriptor to store it afterwards.
I am wondering, if this would be functionality that should be added to System.Socket.Unsafe or similar, since I guess this problem arises from time to time. The biggest problem I see is ensuring that the socket and the address family/socket type match with the type we convert to in the library.
Edit: Flesh out the question.
I am currently trying to add systemd socket activation to my
socket-based application. Therefore I have to construct aSocketfrom a file descriptor, similarly toNetwork.Socket'smkSocketand also convert the socket to a file descriptor to store it afterwards.I am wondering, if this would be functionality that should be added to
System.Socket.Unsafeor similar, since I guess this problem arises from time to time. The biggest problem I see is ensuring that the socket and the address family/socket type match with the type we convert to in the library.Edit: Flesh out the question.