Socket module

CMSG_ALIGN

procedure · 1 overloadSource

Rounds size up to the alignment of control message data: 4 bytes on macOS, 8 elsewhere. A negative size, or one too large to round, fails an assertion.

Example
assert(CMSG_ALIGN(0) == 0);
assert(CMSG_ALIGN(1) % 4 == 0);
assert(CMSG_ALIGN(CMSG_ALIGN(5)) == CMSG_ALIGN(5));

Doesn't run in the browser (only on linux, macos).

CMSG_ALIGN :: (size: int) -> int

Rounds size up to the alignment of control message data: 4 bytes on macOS, 8 elsewhere. A negative size, or one too large to round, fails an assertion.

Parameters

size: int

Returns

int
Example
assert(CMSG_ALIGN(0) == 0);
assert(CMSG_ALIGN(1) % 4 == 0);
assert(CMSG_ALIGN(CMSG_ALIGN(5)) == CMSG_ALIGN(5));

Doesn't run in the browser (only on linux, macos).

See also