Add new capacity function.
diff --git a/asio/include/asio/channel.hpp b/asio/include/asio/channel.hpp
index 7b322b4..710f93c 100644
--- a/asio/include/asio/channel.hpp
+++ b/asio/include/asio/channel.hpp
@@ -42,6 +42,11 @@
     service_.destroy(impl_);
   }
 
+  std::size_t capacity() const
+  {
+    return service_.capacity(impl_);
+  }
+
   bool is_open() const
   {
     return service_.is_open(impl_);
@@ -146,6 +151,11 @@
     service_.destroy(impl_);
   }
 
+  std::size_t capacity() const
+  {
+    return service_.capacity(impl_);
+  }
+
   bool is_open() const
   {
     return service_.is_open(impl_);
diff --git a/asio/include/asio/detail/channel_service.hpp b/asio/include/asio/detail/channel_service.hpp
index ec693f8..f41fd35 100644
--- a/asio/include/asio/detail/channel_service.hpp
+++ b/asio/include/asio/detail/channel_service.hpp
@@ -93,6 +93,9 @@
   // Destroy a channel implementation.
   ASIO_DECL void destroy(base_implementation_type& impl);
 
+  // Get the capacity of the channel.
+  std::size_t capacity(const base_implementation_type& impl) const;
+
   // Determine whether the channel is open.
   bool is_open(const base_implementation_type& impl) const;
 
diff --git a/asio/include/asio/detail/impl/channel_service.hpp b/asio/include/asio/detail/impl/channel_service.hpp
index 88d9688..c3256ff 100644
--- a/asio/include/asio/detail/impl/channel_service.hpp
+++ b/asio/include/asio/detail/impl/channel_service.hpp
@@ -20,6 +20,12 @@
 namespace asio {
 namespace detail {
 
+std::size_t channel_service::capacity(
+    const base_implementation_type& impl) const
+{
+  return impl.max_buffer_size_;
+}
+
 inline bool channel_service::is_open(const base_implementation_type& impl) const
 {
   return impl.put_state_ != closed;