audk/StdLib/LibC
Daryl McDaniel 86f2165dc3 StdLib: Fix IIO_Write() to return the number of bytes consumed, not characters output.
Depending upon termios settings, writing to a terminal device may result in
many more characters being output than were in the buffer provided to the
IIO_Write() function.

IIO_Write() is supposed to return the number of BYTES written, not characters.
Since the provided buffer contains MBCS characters, there can be up to three
bytes per character.  Due to the expansion that may occur, "BYTES written"
is interpreted to mean the number of BYTES consumed from the MBCS buffer
provided as a parameter to IIO_Write.

These changes ensure that the correct number of characters are consumed from
the internal Output buffer and the correct number of BYTES consumed from the
buffer parameter are counted and returned.

Update copyright.
Fix some indentation and white space issues.
Improve comments for IIO_Write().
Add debugging instrumentation to count unconsumed data in the Input and Output buffers.
Modify IIO_Write() to:
  Accurately count input bytes CONSUMED.
  Consume only as many expanded (cooked) characters from the output buffer
  as were actually sent to the device.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19589 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 00:44:24 +00:00
..
CRT StdLib: Add a runtime helper function for VC++ 64-bit right shift on Ia32 target architectures. 2014-08-20 20:38:43 +00:00
Containers StdLib: Fix GCC warnings/errors caused by variables being set but not used. 2014-10-30 01:05:22 +00:00
Ctype StdLib: Add isDirSep character classification macro and function. Implement several Posix functions and clean up EfiSysCall.h. Align file mode handling with UEFI file protocol flags. 2011-11-30 00:52:45 +00:00
Locale StdLib: Clarify and improve comments. 2016-01-06 00:31:42 +00:00
Main StdLib/LibC: Provide missing ARM symbols 2015-07-30 09:50:58 +00:00
Math Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
NetUtil Add Socket Libraries. 2011-07-30 00:30:44 +00:00
Signal Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
Softfloat StdLib: Add support for AArch64 2015-07-30 09:51:04 +00:00
StdLib StdLib: Move libraries from ShellPkg into MdeModulePkg and MdePkg. 2015-01-13 23:35:33 +00:00
Stdio StdLib: reinstate the use of va_arg() to handle long double arguments in vfscanf. 2014-08-20 23:20:54 +00:00
String StdLib: Do not define memcpy for AARCH64 builds 2015-07-26 08:07:20 +00:00
Time StdLib: Add isDirSep character classification macro and function. Implement several Posix functions and clean up EfiSysCall.h. Align file mode handling with UEFI file protocol flags. 2011-11-30 00:52:45 +00:00
Uefi StdLib: Fix IIO_Write() to return the number of bytes consumed, not characters output. 2016-01-06 00:44:24 +00:00
Wchar StdLib: Update Copyright Notices. 2013-12-10 22:16:57 +00:00
gdtoa StdLib: Add support for AArch64 2015-07-30 09:51:04 +00:00
LibC.inf StdLib: Add support for AArch64 2015-07-30 09:51:04 +00:00