From 943adb0f97766b4cfb4a2fa4b9d54b26ea1c1055 Mon Sep 17 00:00:00 2001 From: SKTT1Ryze Date: Sat, 30 Apr 2022 20:46:58 +0800 Subject: [PATCH] add license and coments --- src/accept.cc | 15 ++ src/file.cc | 16 ++ src/future.h | 16 ++ src/kuro.h | 371 +++++++++++++++++++++++++++++++++++++++++++- src/op.cc | 18 ++- src/open.cc | 16 ++ src/read.cc | 16 ++ src/recv.cc | 16 ++ src/send.cc | 16 ++ src/slab.cc | 16 ++ src/slab.h | 17 +- src/task.cc | 16 ++ src/tcp_listener.cc | 16 ++ src/tcp_stream.cc | 16 ++ src/write.cc | 16 ++ 15 files changed, 590 insertions(+), 7 deletions(-) diff --git a/src/accept.cc b/src/accept.cc index 66d04c8..cb34424 100644 --- a/src/accept.cc +++ b/src/accept.cc @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ #include "kuro.h" Accept::Accept(std::shared_ptr& uring, int sockfd, diff --git a/src/file.cc b/src/file.cc index 5184d3c..bf764e0 100644 --- a/src/file.cc +++ b/src/file.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include #include diff --git a/src/future.h b/src/future.h index b699fa5..6064664 100644 --- a/src/future.h +++ b/src/future.h @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include #include diff --git a/src/kuro.h b/src/kuro.h index 547432c..22d3d76 100644 --- a/src/kuro.h +++ b/src/kuro.h @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #if !defined(__cpp_impl_coroutine) #define __cpp_impl_coroutine 1 #endif @@ -19,8 +35,26 @@ using Callback = std::function; -/* ----- Coroutine ----- */ - +/* ----- C++20 Coroutine ----- */ + +/* + * Coroutine is usually treated as resumable function in C++ + * and asynchorous task in Rust. + * + * [`Task`] here refers to return type of coroutine function: + * ```C++ + * Task<> co_xxx(...) { + * co_await xxx; + * + * co_return xxx; + * } + * ``` + * + * More details about C++20 coroutine in + * https://en.cppreference.com/w/cpp/language/coroutines + * + * More details about Kuro Task in `Kuro/examples` + * */ template class Task { public: @@ -34,7 +68,6 @@ class Task { Task get_return_object() { return Task(handle_type::from_promise(*this)); } std::suspend_never initial_suspend() { return {}; } std::suspend_never final_suspend() noexcept { return {}; } - // void return_void() {} std::suspend_never return_value(T v) { value = v; @@ -55,10 +88,48 @@ class Task { T result() { return h_.promise().value; } }; +/* + * Enter event loop and execute created [`Task`]s + * until all of then being handled. + * + * example: + * ```C++ + * Task<> co_read() {...} + * + * // prepare io_uring + * struct io_uring uring; + * io_uring_queue_init(4, &ring, 0); + * std::shared_ptr handle = std::make_shared(ring); + * + * // create two tasks + * auto task0 = co_read(); + * auto task1 = co_read(); + * + * // asynchorous execute + * async_execute(handle); + * + * // both of task0 and task1 have been done. + * + * ``` + * + * More details in `Kuro/examples` + * */ void async_execute(std::shared_ptr& uring_handle); -/* ----- Events ----- */ - +/* ----- IO Events ----- */ + +/* + * Base class of all io events + * + * [`Op`] is subclass of [`Future`], which is abstract inteface of + * Awaitable in C++ 20 coroutine. + * + * `Awaitable` in C++ is similar to `Future` in Rust. + * + * More details about Awaitable/Future in + * https://en.cppreference.com/w/cpp/language/coroutines and + * https://rust-lang.github.io/async-book/02_execution/02_future.html + * */ template class Op : public Future<__s32> { public: @@ -79,6 +150,24 @@ class Op : public Future<__s32> { T value; }; +/* + * Asynchorous and awaitable object equal to read(2). + * + * example: + * ```C++ + * Task co_read(void* buf, shared_ptr& uring) { + * int fd = open(...); + * + * int n = co_await Read(uring, fd, buf, 1024, 0); + * + * printf("read %d bytes\n", n); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Read : public Op { public: int fd; @@ -90,6 +179,24 @@ class Read : public Op { unsigned nbytes, __u64 offset); }; +/* + * Asynchorous and awaitable object equal to readv(2). + * + * example: + * ```C++ + * Task co_readv(const struct iovec* iov, shared_ptr& uring) { + * int fd = open(...); + * + * int n = co_await Readv(uring, fd, iov, 1, 0); + * + * printf("readv %d bytes\n", n); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Readv : public Op { public: int fd; @@ -101,6 +208,24 @@ class Readv : public Op { unsigned nr_vecs, __u64 offset); }; +/* + * Asynchorous and awaitable object equal to write(2). + * + * example: + * ```C++ + * Task co_write(const void* buf, shared_ptr& uring) { + * int fd = open(...); + * + * int n = co_await Write(uring, fd, buf, 1024, 0); + * + * printf("write %d bytes\n", n); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Write : public Op { public: int fd; @@ -112,6 +237,24 @@ class Write : public Op { unsigned nbytes, __u64 offset); }; +/* + * Asynchorous and awaitable object equal to writev(2). + * + * example: + * ```C++ + * Task co_writev(const struct iovec* iov, shared_ptr& uring) { + * int fd = open(...); + * + * int n = co_await Write(uring, fd, iov, 1, 0); + * + * printf("writev %d bytes\n", n); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Writev : public Op { public: int fd; @@ -123,6 +266,22 @@ class Writev : public Op { const struct iovec* iov, unsigned nr_vecs, __u64 offset); }; +/* + * Asynchorous and awaitable object equal to openat(2). + * + * example: + * ```C++ + * Task co_openat(const char* path, shared_ptr& uring) { + * int fd = co_await OpenAt(uring, AT_FDCWD, path, O_RDONLY, 0600); + * + * printf("open %d\n", fd); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class OpenAt : public Op { public: int dfd; @@ -134,6 +293,25 @@ class OpenAt : public Op { mode_t mode); }; +/* + * Asynchorous and awaitable object equal to accept(2). + * + * example: + * ```C++ + * Task co_accept(int sockfd, shared_ptr& uring) { + * struct sockaddr addr; + * socklen_t len; + * + * co_await Accept(uring, sockfd, &addr, &len, 0); + * + * printf("accepted"); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Accept : public Op { public: int sockfd; @@ -145,6 +323,22 @@ class Accept : public Op { socklen_t* len, int flags); }; +/* + * Asynchorous and awaitable object equal to recv(2). + * + * example: + * ```C++ + * Task co_recv(int sockfd, void* buf, shared_ptr& uring) { + * int n = co_await Recv(uring, sockfd, buf, 1024, 0); + * + * printf("recv %d bytes\n"); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Recv : public Op { public: int sockfd; @@ -156,6 +350,22 @@ class Recv : public Op { int flags); }; +/* + * Asynchorous and awaitable object equal to send(2). + * + * example: + * ```C++ + * Task co_send(int sockfd, const void* buf, shared_ptr& uring) { + * int n = co_await Send(uring, sockfd, buf, 1024, 0); + * + * printf("send %d bytes\n"); + * + * co_return 0; + * } + * ``` + * + * More details in https://github.com/axboe/liburing/tree/master/man. + * */ class Send : public Op { public: int sockfd; @@ -169,17 +379,66 @@ class Send : public Op { /* ----- File System ----- */ +/* + * The class holds a file descriptor. + * + * It's clever to perform all file operations via [`File`] and + * it's methond. + * + * example: + * ```C++ + * Task co_fs(std::shared_ptr& uring) { + * int fd = co_await async_open(uring, "xxx"); + * auto file = File(fd); + * + * char buf[50] = "Hello, Kuro"; + * + * co_await file.write(uring, buf, strlen(buf)); + * + * co_return 0; + * } + * ``` + * + * More details in `Kuro/examples`. + * */ class File { public: File() {} File(int fd); ~File(); + /* + * Asynchorous and awaitable read at file equal to read(2). + * + * See examples in [`Read`] and + * https://man7.org/linux/man-pages/man2/read.2.html + * */ Read read(std::shared_ptr& uring, void* buf, unsigned nbytes); + + /* + * Asynchorous and awaitable readv at file equal to readv(2). + * + * See examples in [`Readv`] and + * https://man7.org/linux/man-pages/man2/readv.2.html + * */ Readv readv(std::shared_ptr& uring, const struct iovec* iov, unsigned nr_vecs); + + /* + * Asynchorous and awaitable write at file equal to write(2). + * + * See examples in [`Write`] and + * https://man7.org/linux/man-pages/man2/write.2.html + * */ Write write(std::shared_ptr& uring, const void* buf, unsigned nbytes); + + /* + * Asynchorous and awaitable writev at file equal to writev(2). + * + * See examples in [`Writev`] and + * https://man7.org/linux/man-pages/man2/writev.2.html + * */ Writev writev(std::shared_ptr& uring, const struct iovec* iov, unsigned nr_vecs); @@ -187,6 +446,27 @@ class File { int fd; }; +/* + * Asynchorous open file with read-only mode. + * + * `WARNING`: the type of return value is [`int`] instead of [`File`]. + * + * Originally, we can co_await [`File`] type like: + * ```C++ + * File f = co_await async_open(...); + * ``` + * + * if we change the [`Map<__s32, OpenAt, int>`] to [`Map<__s32, OpenAt, File>`] + * like: + * ```C++ + * Map<__s32, OpenAt, File> async_open(...); + * ``` + * + * However, bug in `gcc` prevents us to do that: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101133. + * + * Hope it be fixed soon:). + * */ Map<__s32, OpenAt, int> async_open(std::shared_ptr& uring, const char* path); @@ -195,11 +475,35 @@ Map<__s32, OpenAt, int> async_open(std::shared_ptr& uring, // Map<__s32, OpenAt, File> async_open(std::shared_ptr& uring, // const char*path); +/* + * Asynchorous create file with read-write mode. + * */ Map<__s32, OpenAt, int> async_create(std::shared_ptr& uring, const char* path); /* ----- Net ----- */ +/* + * [`TcpStream`] holds a socket to perform send/recv operations. + * + * example: + * ```C++ + * Task co_send(std::shared_ptr& uring, TcpStream* stream_) { + * void* buf; + * + * if(posix_memalign(&buf, 1024, 1024)) + * co_return 1; + * + * int n = co_await stream_.async_recv(uring, buf, 1024); + * + * printf("recv %d bytes\n", n); + * + * co_return 0; + * } + * ``` + * + * More details in `Kuro/examples`. + * */ class TcpStream { public: int fd; @@ -210,21 +514,78 @@ class TcpStream { TcpStream(int fd); ~TcpStream(); + /* + * Asynchorous and awaitable recv at stream equal to recv(2). + * + * See examples in [`Recv`] and + * https://man7.org/linux/man-pages/man2/recv.2.html + * */ Recv async_recv(std::shared_ptr& uring, void* buf, size_t len); + + /* + * Asynchorous and awaitable send at stream equal to send(2). + * + * See examples in [`Send`] and + * https://man7.org/linux/man-pages/man2/send.2.html + * */ Send async_send(std::shared_ptr& uring, const void* buf, size_t len); }; +/* + * [`TcpListener`] holds a socket to accept connections. + * + * example: + * ```C++ + * Task co_accept(std::shared_ptr& uring) { + * TcpListener listener = TcpListener(); + * TcpStream stream_ = TcpStream(); + * + * listener.bind_socket("127.0.0.1", htons(3344)); + * listener.listen_socket(1024); + * + * co_await listener.async_accept(uring, &stream_); + * + * printf("accepted"); + * + * co_return 0; + * } + * ``` + * + * More details in `Kuro/examples`. + * */ class TcpListener { public: TcpListener(); TcpListener(int sockfd); ~TcpListener(); + /* + * Configure ip address as reusable. + * */ void set_reuseaddr(bool reuseaddr); + + /* + * Configure ip port as reusable. + * */ void set_reuseport(bool reuseport); + + /* + * Bind the socket to specific ip address and port. + * */ void bind_socket(const char* ip_addr, unsigned short int sin_port); + + /* + * Listen on the specific ip address and port. + * */ void listen_socket(int backlog); + + /* + * Asynchorous and awaitable accept a connection equal to accept(2). + * + * See examples in [`Accept`] and + * https://man7.org/linux/man-pages/man2/accept.2.html + * */ Map<__s32, Accept, int> async_accept(std::shared_ptr& uring, TcpStream* stream_); diff --git a/src/op.cc b/src/op.cc index 301cc25..2566cfc 100644 --- a/src/op.cc +++ b/src/op.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" #include "slab.h" @@ -35,7 +51,7 @@ __s32 Op::await_resume() { template Op::Op(const T val, std::shared_ptr& uring, Callback f) - : value(val), cb(f) { + : cb(f), value(val) { uring_handle = uring; } diff --git a/src/open.cc b/src/open.cc index 6800d13..5442e39 100644 --- a/src/open.cc +++ b/src/open.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" OpenAt::OpenAt(std::shared_ptr& uring, int dfd, const char* path, diff --git a/src/read.cc b/src/read.cc index ceef7b9..e58864e 100644 --- a/src/read.cc +++ b/src/read.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" Read::Read(std::shared_ptr& uring, const int fd, void* buf, diff --git a/src/recv.cc b/src/recv.cc index 6da6e9e..048e58c 100644 --- a/src/recv.cc +++ b/src/recv.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" Recv::Recv(std::shared_ptr& uring, int sockfd, void* buf, size_t len, diff --git a/src/send.cc b/src/send.cc index d77f29d..e6c5de5 100644 --- a/src/send.cc +++ b/src/send.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" Send::Send(std::shared_ptr& uring, int sockfd, const void* buf, diff --git a/src/slab.cc b/src/slab.cc index 24f7312..a76ba5a 100644 --- a/src/slab.cc +++ b/src/slab.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "slab.h" #include diff --git a/src/slab.h b/src/slab.h index b85082e..945dc42 100644 --- a/src/slab.h +++ b/src/slab.h @@ -1,4 +1,19 @@ -// todo: ref +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include #include diff --git a/src/task.cc b/src/task.cc index 0e400b2..212524e 100644 --- a/src/task.cc +++ b/src/task.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include #include "kuro.h" diff --git a/src/tcp_listener.cc b/src/tcp_listener.cc index 8646030..ee34464 100644 --- a/src/tcp_listener.cc +++ b/src/tcp_listener.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include #include diff --git a/src/tcp_stream.cc b/src/tcp_stream.cc index 7758928..70ed0fb 100644 --- a/src/tcp_stream.cc +++ b/src/tcp_stream.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" TcpStream::TcpStream(int fd) : fd(fd) {} diff --git a/src/write.cc b/src/write.cc index 17141a3..8cafadd 100644 --- a/src/write.cc +++ b/src/write.cc @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2022 SKTT1Ryze. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under License. + * */ + #include "kuro.h" Write::Write(std::shared_ptr& uring, const int fd, const void* buf,