# Fix accept function API · gitcafe/zig

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

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

Visibility: public

Requested revision: 87b11617b55254abab267e8739ee2f0d926fbcf5

Requested commit: 87b11617b55254abab267e8739ee2f0d926fbcf5

Commit: 87b11617b55254abab267e8739ee2f0d926fbcf5

Tree: 8677ff7d47b1140d05e5bcff8723ccbc175b0341

Author: Jonathan Marler

Committer: Andrew Kelley

## Message

```
Fix accept function API

The sockaddr pointer and size of the accept function points to a data structure that can only be determined at runtime.  The only requirement is that it must be large enough to hold 2 bytes for the address family value.  Typeical usage of the socket API is for UDP/TCP IPv4 and IPv6 sockets, which use sockaddr_in and sockaddr_in6.  And some sockets can actually support both simultaneously in which case the app may want to have access to the size of the returned sockaddr.  Operating systems can even support custom protocols where they use custom sockaddr data structures.  In this case the standard library would have no knowledge of the actual size of the sockaddr being passed into the accept function.  In this case the standard library should defer to the app to pass in the size of their structure.

```

## Parents

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

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