blob: b27894969cd50ca48f41de10a033b43e1ac6abf0 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library zx;
[Transport = "Syscall"]
protocol socket {
/// Create a socket.
socket_create(uint32 options) -> (status status, handle out0, handle out1);
/// Write data to a socket.
/// Rights: handle must be of type ZX_OBJ_TYPE_SOCKET and have ZX_RIGHT_WRITE.
socket_write(handle:SOCKET handle, uint32 options, vector_void buffer)
-> (status status, optional_usize actual);
/// Read data from a socket.
/// Rights: handle must be of type ZX_OBJ_TYPE_SOCKET and have ZX_RIGHT_READ.
socket_read(handle:SOCKET handle, uint32 options)
-> (status status, vector_void buffer, optional_usize actual);
/// Prevent reading or writing.
/// Rights: handle must be of type ZX_OBJ_TYPE_SOCKET and have ZX_RIGHT_WRITE.
socket_shutdown(handle:SOCKET handle, uint32 options) -> (status status);
};