Module Name: src Committed By: christos Date: Tue Jun 16 22:35:34 UTC 2009
Modified Files: src/tools/compat: configure configure.ac nbtool_config.h.in Added Files: src/tools/compat: fpurge.c Log Message: add fpurge; needed by awk. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/tools/compat/configure \ src/tools/compat/configure.ac cvs rdiff -u -r0 -r1.1 src/tools/compat/fpurge.c cvs rdiff -u -r1.22 -r1.23 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.69 src/tools/compat/configure:1.70 --- src/tools/compat/configure:1.69 Tue Feb 3 00:22:40 2009 +++ src/tools/compat/configure Tue Jun 16 18:35:34 2009 @@ -4980,7 +4980,7 @@ fi for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock futimes getopt getopt_long \ + esetfunc fgetln flock fpurge __fpurge futimes getopt getopt_long \ group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb pwrite \ Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.69 src/tools/compat/configure.ac:1.70 --- src/tools/compat/configure.ac:1.69 Tue Feb 3 00:22:40 2009 +++ src/tools/compat/configure.ac Tue Jun 16 18:35:34 2009 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.69 2009/02/03 05:22:40 dbj Exp $ +# $NetBSD: configure.ac,v 1.70 2009/06/16 22:35:34 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -24,7 +24,7 @@ AC_CONFIG_FILES(defs.mk) # Autoheader header and footer -AH_TOP([/* $NetBSD: configure.ac,v 1.69 2009/02/03 05:22:40 dbj Exp $ */ +AH_TOP([/* $NetBSD: configure.ac,v 1.70 2009/06/16 22:35:34 christos Exp $ */ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__]) @@ -145,7 +145,7 @@ # Library functions (where a .h check isn't enough). AC_FUNC_ALLOCA AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock futimes getopt getopt_long \ + esetfunc fgetln flock fpurge __fpurge futimes getopt getopt_long \ group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb pwrite \ Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.22 src/tools/compat/nbtool_config.h.in:1.23 --- src/tools/compat/nbtool_config.h.in:1.22 Mon Jan 5 01:11:43 2009 +++ src/tools/compat/nbtool_config.h.in Tue Jun 16 18:35:34 2009 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.22 2009/01/05 06:11:43 tnozaki Exp $ */ +/* $NetBSD: nbtool_config.h.in,v 1.23 2009/06/16 22:35:34 christos Exp $ */ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -261,6 +261,9 @@ /* Define if you have the `fparseln' function. */ #undef HAVE_FPARSELN +/* Define if you have the `fpurge' function. */ +#undef HAVE_FPURGE + /* Define if you have the `futimes' function. */ #undef HAVE_FUTIMES @@ -570,6 +573,9 @@ /* Define if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF +/* Define if you have the `__fpurge' function. */ +#undef HAVE___FPURGE + /* Path to sh(1). */ #undef PATH_BSHELL Added files: Index: src/tools/compat/fpurge.c diff -u /dev/null src/tools/compat/fpurge.c:1.1 --- /dev/null Tue Jun 16 18:35:34 2009 +++ src/tools/compat/fpurge.c Tue Jun 16 18:35:34 2009 @@ -0,0 +1,49 @@ +/* $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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. + * + * 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. + */ + +/* + * Pretend... + */ + +#include "nbtool_config.h" + +#if !HAVE_FPURGE +#include <stdio.h> +#include <fcntl.h> + +void +fpurge(FILE *fp) +{ +#if HAVE___FPURGE + __fpurge(fp); +#endif +} +#endif