Module Name:    src
Committed By:   riastradh
Date:           Sat Feb  8 13:30:42 UTC 2025

Modified Files:
        src/share/man/man3: CMSG_DATA.3

Log Message:
cmsg(3): Handle as many descriptors as the sender sends in example.

Due to a quirk of alignment, sizing the control buffer for
CMSG_SPACE(sizeof(int)) does not guarantee at most one file
descriptor fits in the buffer -- so if there is a chance the sender
may send more than one descriptor, the receiver has to loop over all
of them to avoid leaks.

Prompted by:

PR lib/59054: cmsg(3) uses malloc(3) unnecessarily


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man3/CMSG_DATA.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to