2012-12-17 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/puts.c: Add fp locking and use _stdout_r macro
        to refer to the stream rather than stdout.
			
			
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2012-12-17  Jeff Johnston  <jjohnstn@redhat.com> | ||||||
|  |  | ||||||
|  | 	* libc/stdio/puts.c: Add fp locking and use _stdout_r macro | ||||||
|  | 	to refer to the stream rather than stdout. | ||||||
|  |  | ||||||
| 2012-12-14  Yufeng Zhang  <yufeng.zhang@arm.com> | 2012-12-14  Yufeng Zhang  <yufeng.zhang@arm.com> | ||||||
|  |  | ||||||
| 	* libc/machine/aarch64/machine/_types.h: New file; define _ssize_t | 	* libc/machine/aarch64/machine/_types.h: New file; define _ssize_t | ||||||
|   | |||||||
| @@ -78,6 +78,7 @@ _DEFUN(_puts_r, (ptr, s), | |||||||
|        struct _reent *ptr _AND |        struct _reent *ptr _AND | ||||||
|        _CONST char * s) |        _CONST char * s) | ||||||
| { | { | ||||||
|  |   int result; | ||||||
|   size_t c = strlen (s); |   size_t c = strlen (s); | ||||||
|   struct __suio uio; |   struct __suio uio; | ||||||
|   struct __siov iov[2]; |   struct __siov iov[2]; | ||||||
| @@ -89,9 +90,14 @@ _DEFUN(_puts_r, (ptr, s), | |||||||
|   uio.uio_resid = c + 1; |   uio.uio_resid = c + 1; | ||||||
|   uio.uio_iov = &iov[0]; |   uio.uio_iov = &iov[0]; | ||||||
|   uio.uio_iovcnt = 2; |   uio.uio_iovcnt = 2; | ||||||
|  |  | ||||||
|   _REENT_SMALL_CHECK_INIT (ptr); |   _REENT_SMALL_CHECK_INIT (ptr); | ||||||
|   ORIENT (stdout, -1); |  | ||||||
|   return (__sfvwrite_r (ptr, _stdout_r (ptr), &uio) ? EOF : '\n'); |   _newlib_flockfile_start (_stdout_r (ptr)); | ||||||
|  |   ORIENT (_stdout_r (ptr), -1); | ||||||
|  |   result = (__sfvwrite_r (ptr, _stdout_r (ptr), &uio) ? EOF : '\n'); | ||||||
|  |   _newlib_flockfile_start (_stdout_r (ptr)); | ||||||
|  |   return result; | ||||||
| } | } | ||||||
|  |  | ||||||
| #ifndef _REENT_ONLY | #ifndef _REENT_ONLY | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user