Add a putc_unlocked().

This commit is contained in:
thorpej 2003-03-14 03:38:42 +00:00
parent 1ff45ded4f
commit 241ed6a4c1
5 changed files with 66 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.21 2003/03/13 05:00:28 thorpej Exp $
# $NetBSD: Makefile,v 1.22 2003/03/14 03:38:42 thorpej Exp $
HOSTLIB= nbcompat
@ -6,12 +6,12 @@ SRCS= basename.c dirname.c fgetln.c flock.c fparseln.c \
getmode.c getopt_long.c gettemp.c issetugid.c \
lchflags.c lchmod.c lchown.c libyywrap.c \
md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c mkdtemp.c \
mkstemp.c pread.c pwcache.c pwrite.c pw_scan.c rmd160.c \
rmd160hl.c setenv.c setgroupent.c setpassent.c setprogname.c \
sha1.c sha1hl.c snprintf.c strlcat.c strlcpy.c strmode.c \
strsep.c strsuftoll.c strtoll.c unvis.c vis.c \
_err.c _errx.c _verr.c _verrx.c _vwarn.c _vwarnx.c \
_warn.c _warnx.c __fts13.c __glob13.c
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
pw_scan.c rmd160.c rmd160hl.c setenv.c setgroupent.c \
setpassent.c setprogname.c sha1.c sha1hl.c snprintf.c \
strlcat.c strlcpy.c strmode.c strsep.c strsuftoll.c \
strtoll.c unvis.c vis.c _err.c _errx.c _verr.c _verrx.c \
_vwarn.c _vwarnx.c _warn.c _warnx.c __fts13.c __glob13.c
BUILD_OSTYPE!= uname -s

View File

@ -1,4 +1,4 @@
/* $NetBSD: config.h.in,v 1.27 2003/03/13 04:30:39 thorpej Exp $ */
/* $NetBSD: config.h.in,v 1.28 2003/03/14 03:38:42 thorpej Exp $ */
#ifndef __NETBSD_COMPAT_CONFIG_H__
#define __NETBSD_COMPAT_CONFIG_H__
@ -68,6 +68,7 @@
#undef HAVE_MKDTEMP
#undef HAVE_POLL
#undef HAVE_PREAD
#undef HAVE_PUTC_UNLOCKED
#undef HAVE_PWCACHE_USERDB
#undef HAVE_PWRITE
#undef HAVE_RANDOM

View File

@ -4541,8 +4541,8 @@ fi
for ac_func in asprintf asnprintf basename dirfd dirname \
fgetln flock fparseln futimes getopt getopt_long \
isblank issetugid lchflags lchmod lchown lutimes mkstemp mkdtemp \
poll pread pwcache_userdb pwrite random setenv setgroupent \
setprogname setpassent snprintf strlcat strlcpy strsep \
poll pread putc_unlocked pwcache_userdb pwrite random setenv \
setgroupent setprogname setpassent snprintf strlcat strlcpy strsep \
strsuftoll strtoll \
user_from_uid vasprintf vasnprintf vsnprintf
do

View File

@ -1,4 +1,4 @@
# $NetBSD: configure.ac,v 1.35 2003/03/13 16:27:04 thorpej Exp $
# $NetBSD: configure.ac,v 1.36 2003/03/14 03:38:42 thorpej Exp $
#
# Autoconf definition file for libnbcompat.
#
@ -99,8 +99,8 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(asprintf asnprintf basename dirfd dirname \
fgetln flock fparseln futimes getopt getopt_long \
isblank issetugid lchflags lchmod lchown lutimes mkstemp mkdtemp \
poll pread pwcache_userdb pwrite random setenv setgroupent \
setprogname setpassent snprintf strlcat strlcpy strsep \
poll pread putc_unlocked pwcache_userdb pwrite random setenv \
setgroupent setprogname setpassent snprintf strlcat strlcpy strsep \
strsuftoll strtoll \
user_from_uid vasprintf vasnprintf vsnprintf)

View File

@ -0,0 +1,52 @@
/* $NetBSD: putc_unlocked.c,v 1.1 2003/03/14 03:38:42 thorpej Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
/* Emulate putc_unlocked(). */
#include "config.h"
#if !HAVE_PUTC_UNLOCKED
#include <stdio.h>
int
putc_unlocked(int c, FILE *stream)
{
putc(c, stream);
}
#endif