Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: mojo/embedder/platform_channel_utils_posix.h

Issue 226263005: Mojo: Abstract out write/writev vs send/sendmsg (for Unix domain sockets). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/embedder/platform_channel_utils_posix.h
diff --git a/mojo/embedder/platform_channel_utils_posix.h b/mojo/embedder/platform_channel_utils_posix.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ec5fa50818ee4f8d2203680da8eaf7c31e0c20a
--- /dev/null
+++ b/mojo/embedder/platform_channel_utils_posix.h
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EMBEDDER_PLATFORM_CHANNEL_UTILS_POSIX_H_
+#define MOJO_EMBEDDER_PLATFORM_CHANNEL_UTILS_POSIX_H_
+
+#include <stddef.h>
+#include <sys/types.h> // For |ssize_t|.
+
+#include "mojo/embedder/platform_handle.h"
+#include "mojo/system/system_impl_export.h"
+
+struct iovec; // Declared in <sys/uio.h>.
+
+namespace mojo {
+namespace embedder {
+
+// Use these to write to a socket created using |PlatformChannelPair| (or
+// equivalent). These are like |write()| and |writev()|, but handle |EINTR| and
+// never raise |SIGPIPE|. (Note: On Mac, the suppression of |SIGPIPE| is set up
+// by |PlatformChannelPair|.)
+MOJO_SYSTEM_IMPL_EXPORT ssize_t PlatformChannelWrite(PlatformHandle h,
+ const void* bytes,
+ size_t num_bytes);
+MOJO_SYSTEM_IMPL_EXPORT ssize_t PlatformChannelWritev(PlatformHandle h,
+ struct iovec* iov,
+ size_t num_iov);
+
+} // namespace embedder
+} // namespace mojo
+
+#endif // MOJO_EMBEDDER_PLATFORM_CHANNEL_UTILS_POSIX_H_
« no previous file with comments | « mojo/embedder/platform_channel_pair_posix_unittest.cc ('k') | mojo/embedder/platform_channel_utils_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698