acadia/lib/mammoth/ipc/port_client.cpp

19 lines
472 B
C++
Raw Normal View History

#include "ipc/port_client.h"
#include <glacier/status/error.h>
#include <zcall.h>
#include "util/debug.h"
namespace mmth {
PortClient PortClient::AdoptPort(z_cap_t cap) { return PortClient(cap); }
PortClient::PortClient(z_cap_t port_cap) : port_cap_(port_cap) {}
glcr::ErrorCode PortClient::WriteString(glcr::String str, z_cap_t cap) {
return static_cast<glcr::ErrorCode>(
ZPortSend(port_cap_, str.length() + 1, str.cstr(), 1, &cap));
}
} // namespace mmth