common/rbuf: Handle ring buffer wrapping

Handle when the ring buffer wraps for reads and writes.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
common: Add write commit capability to ring buffer

The ring buffer requires that all data to be added
to a ring buffer be written with a single call.  As soon as
the data is written, a reader may extract it.  This behavior
can result in a caller needing to stage its data into a
temporary buffer until the write can be issued.

Instead, allow multiple writes to occur to the ring buffer
with a commit call being used to indicate that the newly
inserted data is now safe for reading.  This avoids the need
to use a temporary buffer, with the ring buffer updated directly.

Add an abort call for good measure.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
common: Add const to ringbuf write calls

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
prov/sockets: Implement transmit context

A transmit context is an abstraction over a ring buffer, with
the ability to wait on an fd if the ring buffer is empty, until
an item is inserted into it.

Items are inserted into the transmit context when a data transfer
is initiated by the application.  The progress engine pulls
operations from the transmit context for processing.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
include/fi.h: include string.h

ffsll requires string.h

Signed-off-by: Sayantan Sur <sayantan.sur@intel.com>
Merge pull request #232 from sayantansur/fi-ffsll

include/fi.h: include string.h
Merge pull request #233 from shefty/master

base socket provider TX context implementation
Makefile.am: fix "make dist"

Several files were renamed in 15352c63c239af1aad43f551123facf49448efe7
without also fixing their entries in Makefile.am.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Makefile.am: clean out EXTRA_DIST

Several header files were listed in EXTRA_DIST.  Moved them all to
their corresponding _SOURCES macros.  This keeps core/provider header
files in their own distinct sections (vs. glumping .h files from
different providers in EXTRA_DIST).  The sockets .h file was already
listed in its _SOURCES macro.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #235 from jsquyres/pr/fix-make-dist

2 fixes for "make dist"