Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add CMSG_ALIGN and CMSG_LEN for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
todayman committed Nov 21, 2014
1 parent 4ae1da4 commit 3f2ff00
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/sys/posix/sys/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@ version( linux )
: cast(cmsghdr*) null );
}

extern (D)
{
size_t CMSG_ALIGN( size_t len)
{
return (len + size_t.sizeof - 1) & cast(size_t) (~(size_t.sizeof - 1));
}

size_t CMSG_LEN( size_t len )
{
return CMSG_ALIGN(cmsghdr.sizeof) + len;
}
}

struct linger
{
int l_onoff;
Expand Down

0 comments on commit 3f2ff00

Please sign in to comment.