am 349ef893: Merge "Pull upstream FreeBSD revision 249810."

* commit '349ef893e82f37632a705f39efc47c0d440f63c7':
  Pull upstream FreeBSD revision 249810.
This commit is contained in:
Elliott Hughes 2013-05-14 16:25:49 -07:00 committed by Android Git Automerger
commit 20516923f5
31 changed files with 80 additions and 84 deletions

View File

@ -2053,6 +2053,35 @@ SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 1992, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-------------------------------------------------------------------
Copyright (c) 1992, 1993
The Regents of the University of California. All rights reserved.

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$");
#undef clearerr_unlocked
void
clearerr(fp)
FILE *fp;
clearerr(FILE *fp)
{
FLOCKFILE(fp);
__sclearerr(fp);

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$");
#include "local.h"
FILE *
fdopen(fd, mode)
int fd;
const char *mode;
fdopen(int fd, const char *mode)
{
FILE *fp;
int flags, oflags, fdflags, tmp;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -115,7 +115,7 @@ fgetln(FILE *fp, size_t *lenp)
* As a bonus, though, we can leave off the __SMOD.
*
* OPTIMISTIC is length that we (optimistically) expect will
* accomodate the `rest' of the string, on each trip through the
* accommodate the `rest' of the string, on each trip through the
* loop below.
*/
#define OPTIMISTIC 80

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -49,10 +49,7 @@ __FBSDID("$FreeBSD$");
* Return first argument, or NULL if no characters were read.
*/
char *
fgets(buf, n, fp)
char *buf;
int n;
FILE *fp;
fgets(char * __restrict buf, int n, FILE * __restrict fp)
{
size_t len;
char *s;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
* Return 0 on error.
*/
int
__sflags(mode, optr)
const char *mode;
int *optr;
__sflags(const char *mode, int *optr)
{
int ret, m, o;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
#include "local.h"
FILE *
fopen(file, mode)
const char * __restrict file;
const char * __restrict mode;
fopen(const char * __restrict file, const char * __restrict mode)
{
FILE *fp;
int f;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$");
* given FILE's buffer empty.
*/
int
fpurge(fp)
FILE *fp;
fpurge(FILE *fp)
{
int retval;
FLOCKFILE(fp);

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
* Write the given string to the given file.
*/
int
fputs(s, fp)
const char * __restrict s;
FILE * __restrict fp;
fputs(const char * __restrict s, FILE * __restrict fp)
{
int retval;
struct __suio uio;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
* fsetpos: like fseek.
*/
int
fsetpos(iop, pos)
FILE *iop;
const fpos_t *pos;
fsetpos(FILE *iop, const fpos_t *pos)
{
return (fseeko(iop, (off_t)*pos, SEEK_SET));
}

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$");
#include "glue.h"
int
_fwalk(function)
int (*function)(FILE *);
_fwalk(int (*function)(FILE *))
{
FILE *fp;
int n, ret;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$");
* Return the number of whole objects written.
*/
size_t
fwrite(buf, size, count, fp)
const void * __restrict buf;
size_t size, count;
FILE * __restrict fp;
fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict fp)
{
size_t n;
struct __suio uio;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$");
#undef putc_unlocked
int
putc(c, fp)
int c;
FILE *fp;
putc(int c, FILE *fp)
{
int retval;
FLOCKFILE(fp);

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$");
* A subroutine version of the macro putchar
*/
int
putchar(c)
int c;
putchar(int c)
{
int retval;
FILE *so = stdout;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -48,8 +48,7 @@ __FBSDID("$FreeBSD$");
* Write the given string to stdout, appending a newline.
*/
int
puts(s)
char const *s;
puts(char const *s)
{
int retval;
size_t c = strlen(s);

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
putw(w, fp)
int w;
FILE *fp;
putw(int w, FILE *fp)
{
int retval;
struct __suio uio;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
int
remove(file)
const char *file;
remove(const char *file)
{
struct stat sb;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
void
setbuffer(fp, buf, size)
FILE *fp;
char *buf;
int size;
setbuffer(FILE *fp, char *buf, int size)
{
(void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, (size_t)size);
@ -52,8 +49,7 @@ setbuffer(fp, buf, size)
* set line buffering
*/
int
setlinebuf(fp)
FILE *fp;
setlinebuf(FILE *fp)
{
return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0));

View File

@ -10,7 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -47,8 +47,7 @@ __warn_references(tempnam,
extern char *_mktemp(char *);
char *
tempnam(dir, pfx)
const char *dir, *pfx;
tempnam(const char *dir, const char *pfx)
{
int sverrno;
char *f, *name;

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -47,8 +47,7 @@ __warn_references(tmpnam,
extern char *_mktemp(char *);
char *
tmpnam(s)
char *s;
tmpnam(char *s)
{
static u_long tmpcount;
static char buf[L_tmpnam];

View File

@ -13,7 +13,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$");
* _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno.
*/
int
__swsetup(fp)
FILE *fp;
__swsetup(FILE *fp)
{
/* make sure stdio is set up */
if (!__sdidinit)