HomeFreeBSD

unix/dgram: add a specific send method - uipc_sosend_dgram()

Description

unix/dgram: add a specific send method - uipc_sosend_dgram()

This is first step towards splitting classic BSD socket
implementation into separate classes. The first to be
split is PF_UNIX/SOCK_DGRAM as it has most differencies
to SOCK_STREAM sockets and to PF_INET sockets.

Historically a protocol shall provide two methods for sendmsg(2):
pru_sosend and pru_send. The former is a generic send method,
e.g. sosend_generic() which would internally call the latter,
uipc_send() in our case. There is one important exception, though,
the sendfile(2) code will call pru_send directly. But sendfile
doesn't work on SOCK_DGRAM, so we can do the trick. We will create
socket class specific uipc_sosend_dgram() which will carry only
important bits from sosend_generic() and uipc_send().

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35293

Details

Provenance
glebiusAuthored on Jun 24 2022, 4:09 PM
Reviewer
markj
Differential Revision
D35293: unix/dgram: add a specific send method - uipc_sosend_dgram()
Parents
rGbc6d0d72f4f4: UFS rename: make it reliable when using SU and reaching nlink limit
Branches
Unknown
Tags
Unknown