# os: make msghdr, msghdr_const, and sockaddr_storage backwards-compatible · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/aad8491dbd98052e97b395ea572b186482d3b38f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: aad8491dbd98052e97b395ea572b186482d3b38f

Requested commit: aad8491dbd98052e97b395ea572b186482d3b38f

Commit: aad8491dbd98052e97b395ea572b186482d3b38f

Tree: c58fd0921a6082a39f388b46d36c543d191974cf

Author: Kenta Iwasaki

Committer: Kenta Iwasaki

## Message

```
os: make msghdr, msghdr_const, and sockaddr_storage backwards-compatible

`msghdr` and `msghdr_const` definitions have been added back the way
they were in std.os. std.os.sendmsg has also been modified to accept a
msghdr_const again to ensure backwards-compatibility with this PR.
Underneath the hood, std.os.sendmsg will @ptrCast the provided
msghdr_const into a std.x.os.Socket.Message.

`sockaddr_storage` definitions have been added back the way they were in
std.os, except that it now simply aliases
std.x.os.Socket.Address.Native.Storage as all of
std.x.os.Socket.Address.Native.Storage's fields are equivalent to the
fields that were previously defined for std.x.os.bits.sockaddr_storage.

std.x.os.Socket.sendMessage now no longer is a stub that aliases
std.os.sendmsg, but instead calls and handles
errors from std.os.system.sendmsg directly.

Addresses feedback to urge backwards compatibility from @andrewrk.

```

## Parents

- [6950e4c2943d7eee1868aff1bf9e24f6bb310f60](https://git.cafe/gitcafe/zig/commit/6950e4c2943d7eee1868aff1bf9e24f6bb310f60?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/aad8491dbd98052e97b395ea572b186482d3b38f?format=markdown)
