mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-20 13:25:19 +00:00
Merge pull request #4462 from A1029384756/master
Added Unlinking Section to Posix Socket Binding Documentation
This commit is contained in:
@@ -48,6 +48,12 @@ foreign libc {
|
||||
addr.sun_family = .UNIX
|
||||
copy(addr.sun_path[:], "/somepath\x00")
|
||||
|
||||
/*
|
||||
unlink the socket before binding in case
|
||||
of previous runs not cleaning up the socket
|
||||
*/
|
||||
posix.unlink("/somepath")
|
||||
|
||||
if posix.bind(sfd, (^posix.sockaddr)(&addr), size_of(addr)) != .OK {
|
||||
/* Handle error */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user