CVS commit: src/sys/kern
Module Name:src Committed By: msaitoh Date: Fri Apr 26 09:04:44 UTC 2013 Modified Files: src/sys/kern: kern_drvctl.c Log Message: Fix memory leak on the following cases when device attached or detached: - No one open drvctl. - kmem_alloc() failed in devmon_insert(). XXX pullup to both netbsd-5 and netbsd-6. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/kern/kern_drvctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_drvctl.c diff -u src/sys/kern/kern_drvctl.c:1.33 src/sys/kern/kern_drvctl.c:1.34 --- src/sys/kern/kern_drvctl.c:1.33 Sat Oct 27 17:18:39 2012 +++ src/sys/kern/kern_drvctl.c Fri Apr 26 09:04:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_drvctl.c,v 1.33 2012/10/27 17:18:39 chs Exp $ */ +/* $NetBSD: kern_drvctl.c,v 1.34 2013/04/26 09:04:43 msaitoh Exp $ */ /* * Copyright (c) 2004 @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_drvctl.c,v 1.33 2012/10/27 17:18:39 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_drvctl.c,v 1.34 2013/04/26 09:04:43 msaitoh Exp $); #include sys/param.h #include sys/systm.h @@ -115,6 +115,7 @@ devmon_insert(const char *event, prop_di mutex_enter(drvctl_lock); if (drvctl_nopen == 0) { + prop_object_release(ev); mutex_exit(drvctl_lock); return; } @@ -128,6 +129,7 @@ devmon_insert(const char *event, prop_di dce = kmem_alloc(sizeof(*dce), KM_SLEEP); if (dce == NULL) { + prop_object_release(ev); mutex_exit(drvctl_lock); return; }
CVS commit: src/include
Module Name:src Committed By: joerg Date: Fri Apr 26 10:58:22 UTC 2013 Modified Files: src/include: stdbool.h Log Message: Do not define bool/true/false for C++. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/include/stdbool.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdbool.h diff -u src/include/stdbool.h:1.3 src/include/stdbool.h:1.4 --- src/include/stdbool.h:1.3 Mon Apr 28 20:22:54 2008 +++ src/include/stdbool.h Fri Apr 26 10:58:22 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: stdbool.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ +/* $NetBSD: stdbool.h,v 1.4 2013/04/26 10:58:22 joerg Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,13 +37,8 @@ #define true 1 #define false 0 -#else -#define bool bool - -#define true true -#define false false -#endif /* __cplusplus */ #define __bool_true_false_are_defined 1 +#endif /* __cplusplus */ #endif /* _STDBOOL_H_ */
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: rkujawa Date: Fri Apr 26 15:31:05 UTC 2013 Modified Files: src/sys/dev/i2c: tps65217pmic.c tps65217pmicreg.h Log Message: Add sanity, flexibility and readability to TPS65217 driver. In preparation to add envsys support. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/tps65217pmic.c \ src/sys/dev/i2c/tps65217pmicreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/tps65217pmic.c diff -u src/sys/dev/i2c/tps65217pmic.c:1.1 src/sys/dev/i2c/tps65217pmic.c:1.2 --- src/sys/dev/i2c/tps65217pmic.c:1.1 Thu Apr 25 20:55:34 2013 +++ src/sys/dev/i2c/tps65217pmic.c Fri Apr 26 15:31:03 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tps65217pmic.c,v 1.1 2013/04/25 20:55:34 rkujawa Exp $ */ +/* $NetBSD: tps65217pmic.c,v 1.2 2013/04/26 15:31:03 rkujawa Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -29,8 +29,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ +/* + * Texas Instruments TPS65217 Power Management IC driver. + * TODO: battery, sequencer + */ + #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tps65217pmic.c,v 1.1 2013/04/25 20:55:34 rkujawa Exp $); +__KERNEL_RCSID(0, $NetBSD: tps65217pmic.c,v 1.2 2013/04/26 15:31:03 rkujawa Exp $); #include sys/param.h #include sys/systm.h @@ -52,32 +57,75 @@ struct tps65217pmic_softc { uint8_t sc_revision; }; + +#define NTPS_REG 7 +/* Voltage regulators */ +enum tps_reg_num { + TPS65217PMIC_LDO1, + TPS65217PMIC_LDO2, + TPS65217PMIC_LDO3LS, + TPS65217PMIC_LDO4LS, + TPS65217PMIC_DCDC1, + TPS65217PMIC_DCDC2, + TPS65217PMIC_DCDC3 +}; + +struct tps_reg_param { + /* parameters configured statically */ + + const char* name; + uint16_t voltage_min; /* in mV */ + uint16_t voltage_max; /* in mV */ + const uint16_t *voltages; /* all possible voltage settings */ + uint8_t nvoltages; /* number of voltage settings */ + + bool can_track; /* regulator can track U of other r. */ + struct tps_reg_param *tracked_reg; /* ptr to tracked regulator */ + bool can_xadj; /* voltage can be adjusted externally */ + bool can_ls; /* can be a load switch instead of r. */ + + uint8_t defreg_num; /* DEF register */ + uint8_t enable_bit; /* position in ENABLE register */ + + /* + * Run-time parameters configured during attachment and later, these + * probably should be split into separate struct that would be a part + * of softc. But since we can have only one TPS chip, that should be + * okay for now. + */ + + bool is_enabled; /* regulator is enabled */ + bool is_pg; /* regulator is power good */ + bool is_tracking; /* voltage is tracking other reg. */ + bool is_ls; /* is a load switch */ + bool is_xadj; /* voltage is adjusted externally */ + + uint16_t current_voltage; /* in mV */ + +}; + static int tps65217pmic_match(device_t, cfdata_t, void *); static void tps65217pmic_attach(device_t, device_t, void *); static uint8_t tps65217pmic_reg_read(struct tps65217pmic_softc *sc, -uint8_t reg); +uint8_t regno); + +static void tps65217pmic_refresh(struct tps65217pmic_softc *sc); static uint16_t tps65217pmic_ppath_max_usb_current(uint8_t ppath); static uint16_t tps65217pmic_ppath_max_ac_current(uint8_t ppath); -static void tps65217pmic_print_status(struct tps65217pmic_softc *sc); +static void tps65217pmic_regulator_read_config(struct tps65217pmic_softc +*sc, struct tps_reg_param *regulator); + +static void tps65217pmic_print_ppath(struct tps65217pmic_softc *sc); +static void tps65217pmic_print_ldos(struct tps65217pmic_softc *sc); + static void tps65217pmic_version(struct tps65217pmic_softc *sc); CFATTACH_DECL_NEW(tps65217pmic, sizeof (struct tps65217pmic_softc), tps65217pmic_match, tps65217pmic_attach, NULL, NULL); -/* Voltage regulators */ -enum tpsreg { - TPS65217PMIC_LDO1, - TPS65217PMIC_LDO2, - TPS65217PMIC_LDO3LS, - TPS65217PMIC_LDO4LS, - TPS65217PMIC_DCDC1, - TPS65217PMIC_DCDC2, - TPS65217PMIC_DCDC3 -}; - /* Possible settings of LDO1 in mV. */ static const uint16_t ldo1voltages[] = { 1000, 1100, 1200, 1250, 1300, 1350, 1400, 1500, 1600, 1800, 2500, 2750, 2800, 3000, 3100, 3300 }; @@ -90,17 +138,120 @@ static const uint16_t ldo2voltages[] = { 3200, 3300, 3300, 3300, 3300, 3300, 3300, 3300, 3300 }; /* Possible settings of LDO3, LDO4 in mV. */ static const uint16_t ldo3voltages[] = { 1500, 1550, 1600, 1650, 1700, 1750, -1800, 1850,1900, 2000, 2100, 2200, 2300, 2400, 2450, 2500,2550, 2600, +1800, 1850, 1900, 2000, 2100, 2200, 2300, 2400, 2450, 2500, 2550, 2600, 2650, 2700, 2750, 2800, 2850, 2900,2950, 3000, 3050, 3100, 3150, 3200, 3250, 3300 }; +static struct tps_reg_param tps_regulators[] = { + { + .name = LDO1, + .voltage_min = 1000, + .voltage_max = 3300, + .voltages = ldo1voltages, + .nvoltages = 16, + .can_track = false, + .tracked_reg = NULL, + .can_xadj = false, + .can_ls = false, +
CVS commit: src/external/gpl3/gcc
Module Name:src Committed By: skrll Date: Fri Apr 26 15:56:46 UTC 2013 Modified Files: src/external/gpl3/gcc/lib/libgomp/arch/earm: config.h src/external/gpl3/gcc/lib/libiberty/arch/earm: config.h src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm: c++config.h config.h src/external/gpl3/gcc/usr.bin/gcc/arch/earm: auto-host.h configargs.h Log Message: Re-run gcc mknative for earm To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h \ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h cvs rdiff -u -r1.3 -r1.4 \ src/external/gpl3/gcc/usr.bin/gcc/arch/earm/auto-host.h cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/gcc/usr.bin/gcc/arch/earm/configargs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h diff -u src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h:1.1 src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h:1.2 --- src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h:1.1 Sun Aug 5 17:03:31 2012 +++ src/external/gpl3/gcc/lib/libgomp/arch/earm/config.h Fri Apr 26 15:56:45 2013 @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.66 2012/01/10 12:27:54 skrll Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ /* config.h. Generated from config.h.in by configure. */ Index: src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h diff -u src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h:1.1 src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h:1.2 --- src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h:1.1 Sun Aug 5 17:03:31 2012 +++ src/external/gpl3/gcc/lib/libiberty/arch/earm/config.h Fri Apr 26 15:56:45 2013 @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.66 2012/01/10 12:27:54 skrll Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ /* config.h. Generated from config.in by configure. */ Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h:1.3 src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h:1.4 --- src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h:1.3 Thu Apr 25 15:07:16 2013 +++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h Fri Apr 26 15:56:46 2013 @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.68 2012/09/25 06:55:10 skrll Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ // Predefined symbols and macros -*- C++ -*- @@ -499,7 +499,7 @@ _GLIBCXX_END_NAMESPACE /* #undef _GLIBCXX_HAVE_FABSL */ /* Define to 1 if you have the fenv.h header file. */ -#define _GLIBCXX_HAVE_FENV_H 1 +/* #undef _GLIBCXX_HAVE_FENV_H */ /* Define to 1 if you have the `finite' function. */ #define _GLIBCXX_HAVE_FINITE 1 @@ -1143,7 +1143,7 @@ _GLIBCXX_END_NAMESPACE /* Define if C99 functions or macros in math.h should be imported in tr1/cmath in namespace std::tr1. */ -/* #undef _GLIBCXX_USE_C99_MATH_TR1 */ +#define _GLIBCXX_USE_C99_MATH_TR1 1 /* Define if C99 types in stdint.h should be imported in tr1/cstdint in namespace std::tr1. */ Index: src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h diff -u src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h:1.3 src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h:1.4 --- src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h:1.3 Thu Apr 25 15:07:16 2013 +++ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earm/config.h Fri Apr 26 15:56:46 2013 @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-gcc,v 1.68 2012/09/25 06:55:10 skrll Exp */ +/* Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ /* config.h. Generated from config.h.in by configure. */ @@ -120,7 +120,7 @@ /* #undef HAVE_FABSL */ /* Define to 1 if you have the fenv.h header file. */ -#define HAVE_FENV_H 1 +/* #undef HAVE_FENV_H */ /* Define to 1 if you have the `finite' function. */ #define HAVE_FINITE 1 @@ -765,7 +765,7 @@ /* Define if C99 functions
CVS commit: src/external/gpl3/gcc
Module Name:src Committed By: skrll Date: Fri Apr 26 16:00:13 UTC 2013 Modified Files: src/external/gpl3/gcc/lib/crtstuff/arch: earmeb.mk src/external/gpl3/gcc/lib/libgcc/arch: earmeb.mk src/external/gpl3/gcc/lib/libgomp/arch/earmeb: config.h src/external/gpl3/gcc/lib/libiberty/arch/earmeb: config.h src/external/gpl3/gcc/lib/libobjc/arch/earmeb: defs.mk src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb: c++config.h config.h defs.mk src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb: auto-host.h configargs.h defs.mk Log Message: Re-run gcc mknative for earm To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/lib/libgomp/arch/earmeb/config.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/lib/libiberty/arch/earmeb/config.h cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/lib/libobjc/arch/earmeb/defs.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/c++config.h \ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/config.h \ src/external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/defs.mk cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb/auto-host.h \ src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb/configargs.h \ src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb/defs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk diff -u src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk:1.1 src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk:1.2 --- src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk:1.1 Wed Apr 17 08:55:12 2013 +++ src/external/gpl3/gcc/lib/crtstuff/arch/earmeb.mk Fri Apr 26 16:00:12 2013 @@ -1,9 +1,9 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-gcc,v 1.68 2012/09/25 06:55:10 skrll Exp +# Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp # Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp # -G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf -G_CRTSTUFF_CFLAGS=-O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize +G_INCLUDES=-I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I/usr/src/tools/gcc/../../external/lgpl3/gmp/lib/libgmp/arch/earmeb -I/usr/src/tools/gcc/../../external/lgpl3/mpfr/dist -I/usr/src/tools/gcc/../../external/lgpl2/mpc/dist/src -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf +G_CRTSTUFF_CFLAGS=-O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I${GNUHOSTDIST}/gcc -I${GNUHOSTDIST}/gcc/. -I${GNUHOSTDIST}/gcc/../include -I./../intl -I${GNUHOSTDIST}/gcc/../libcpp/include -I/usr/src/tools/gcc/../../external/lgpl3/gmp/lib/libgmp/arch/earmeb -I/usr/src/tools/gcc/../../external/lgpl3/mpfr/dist -I/usr/src/tools/gcc/../../external/lgpl2/mpc/dist/src -I${GNUHOSTDIST}/gcc/../libdecnumber -I${GNUHOSTDIST}/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/include/libelf -g0 -finhibit-size-directive -fno-inline -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize G_CRTSTUFF_T_CFLAGS= G_CRTSTUFF_T_CFLAGS_S= -fPIC G_tm_defines=NETBSD_ENABLE_PTHREADS TARGET_BIG_ENDIAN_DEFAULT=1 Index: src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk diff -u src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk:1.1 src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk:1.2 --- src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk:1.1 Wed Apr 17 08:55:12 2013 +++ src/external/gpl3/gcc/lib/libgcc/arch/earmeb.mk Fri Apr 26 16:00:12 2013 @@ -1,16 +1,16 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-gcc,v 1.68 2012/09/25 06:55:10 skrll Exp +# Generated from: NetBSD: mknative-gcc,v 1.69 2013/04/25 16:18:43 skrll Exp # Generated from: NetBSD:
CVS commit: src/include
Module Name:src Committed By: joerg Date: Fri Apr 26 17:35:52 UTC 2013 Modified Files: src/include: ctype.h Log Message: Do not define the ctype(3) interface via macros for C++. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/include/ctype.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/ctype.h diff -u src/include/ctype.h:1.32 src/include/ctype.h:1.33 --- src/include/ctype.h:1.32 Tue Apr 16 11:29:12 2013 +++ src/include/ctype.h Fri Apr 26 17:35:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ctype.h,v 1.32 2013/04/16 11:29:12 joerg Exp $ */ +/* $NetBSD: ctype.h,v 1.33 2013/04/26 17:35:52 joerg Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -92,7 +92,8 @@ int isblank(int); #endif __END_DECLS -#if defined(_NETBSD_SOURCE) !defined(_CTYPE_NOINLINE) +#if defined(_NETBSD_SOURCE) !defined(_CTYPE_NOINLINE) \ +!defined(__cplusplus) #include sys/ctype_inline.h #endif
CVS commit: src/include
Module Name:src Committed By: joerg Date: Fri Apr 26 17:36:24 UTC 2013 Modified Files: src/include: stdlib.h Log Message: Provide the long long routines for C++11 code. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/include/stdlib.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdlib.h diff -u src/include/stdlib.h:1.104 src/include/stdlib.h:1.105 --- src/include/stdlib.h:1.104 Fri Apr 19 14:35:31 2013 +++ src/include/stdlib.h Fri Apr 26 17:36:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.104 2013/04/19 14:35:31 joerg Exp $ */ +/* $NetBSD: stdlib.h,v 1.105 2013/04/26 17:36:24 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -65,7 +65,7 @@ typedef struct { #if !defined(_ANSI_SOURCE) \ (defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) = 199901L || \ - defined(_NETBSD_SOURCE)) + (__cplusplus - 0) = 201103L || defined(_NETBSD_SOURCE)) typedef struct { /* LONGLONG */ long long int quot; /* quotient */ @@ -207,7 +207,8 @@ char *ptsname(int); * ISO C99 */ #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) = 199901L || \ -defined(_NETBSD_SOURCE) +defined(_NETBSD_SOURCE) || (__cplusplus - 0) = 201103L + /* LONGLONG */ long long int atoll(const char *); /* LONGLONG */
CVS commit: src/include
Module Name:src Committed By: joerg Date: Fri Apr 26 17:37:07 UTC 2013 Modified Files: src/include: stdio.h Log Message: Don't pollute the name space with the various stdio macros for C++. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/include/stdio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdio.h diff -u src/include/stdio.h:1.86 src/include/stdio.h:1.87 --- src/include/stdio.h:1.86 Fri Apr 19 23:42:26 2013 +++ src/include/stdio.h Fri Apr 26 17:37:06 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: stdio.h,v 1.86 2013/04/19 23:42:26 joerg Exp $ */ +/* $NetBSD: stdio.h,v 1.87 2013/04/26 17:37:06 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -485,7 +485,7 @@ static __inline int __sputc(int _c, FILE #define __sfileno(p) \ ((p)-_file == -1 ? -1 : (int)(unsigned short)(p)-_file) -#ifndef __lint__ +#if !defined(__lint__) !defined(__cplusplus) #if !defined(_REENTRANT) !defined(_PTHREADS) #define feof(p) __sfeof(p) #define ferror(p) __sferror(p) @@ -494,17 +494,18 @@ static __inline int __sputc(int _c, FILE #define getc(fp) __sgetc(fp) #define putc(x, fp) __sputc(x, fp) #endif /* !_REENTRANT !_PTHREADS */ -#endif /* __lint__ */ #define getchar() getc(stdin) #define putchar(x) putc(x, stdout) -#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ -defined(_NETBSD_SOURCE) +#endif /* !__lint__ !__cplusplus */ + +#if (defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ +defined(_NETBSD_SOURCE)) !defined(__cplusplus) #if !defined(_REENTRANT) !defined(_PTHREADS) #define fileno(p) __sfileno(p) #endif /* !_REENTRANT !_PTHREADS */ -#endif /* !_ANSI_SOURCE */ +#endif /* !_ANSI_SOURCE !__cplusplus*/ #if (_POSIX_C_SOURCE - 0) = 200809L || defined(_NETBSD_SOURCE) int vdprintf(int, const char * __restrict, __va_list) @@ -514,7 +515,7 @@ int dprintf(int, const char * __restric #endif /* (_POSIX_C_SOURCE - 0) = 200809L || defined(_NETBSD_SOURCE) */ #if (_POSIX_C_SOURCE - 0) = 199506L || (_XOPEN_SOURCE - 0) = 500 || \ -defined(_REENTRANT) || defined(_NETBSD_SOURCE) +defined(_REENTRANT) || defined(_NETBSD_SOURCE) !defined(__cplusplus) #define getc_unlocked(fp) __sgetc(fp) #define putc_unlocked(x, fp) __sputc(x, fp)
CVS commit: src/include
Module Name:src Committed By: joerg Date: Fri Apr 26 17:41:34 UTC 2013 Modified Files: src/include: stdbool.h Log Message: Define __bool_true_false_are_defined for C++ as well. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/include/stdbool.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdbool.h diff -u src/include/stdbool.h:1.4 src/include/stdbool.h:1.5 --- src/include/stdbool.h:1.4 Fri Apr 26 10:58:22 2013 +++ src/include/stdbool.h Fri Apr 26 17:41:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: stdbool.h,v 1.4 2013/04/26 10:58:22 joerg Exp $ */ +/* $NetBSD: stdbool.h,v 1.5 2013/04/26 17:41:34 joerg Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,8 @@ #define true 1 #define false 0 -#define __bool_true_false_are_defined 1 #endif /* __cplusplus */ +#define __bool_true_false_are_defined 1 + #endif /* _STDBOOL_H_ */
CVS commit: src/include
Module Name:src Committed By: christos Date: Fri Apr 26 18:07:43 UTC 2013 Modified Files: src/include: stdlib.h Log Message: add at_quick_exit and quick_exit To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/include/stdlib.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdlib.h diff -u src/include/stdlib.h:1.105 src/include/stdlib.h:1.106 --- src/include/stdlib.h:1.105 Fri Apr 26 13:36:24 2013 +++ src/include/stdlib.h Fri Apr 26 14:07:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.105 2013/04/26 17:36:24 joerg Exp $ */ +/* $NetBSD: stdlib.h,v 1.106 2013/04/26 18:07:43 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -224,6 +224,12 @@ float strtof(const char * __restrict, c long double strtold(const char * __restrict, char ** __restrict); #endif +#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) = 201101L || \ +defined(_NETBSD_SOURCE) || (__cplusplus - 0) = 201103L +int at_quick_exit(void (*)(void)); +__dead void quick_exit(int); +#endif + /* * The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX) */
CVS commit: src/lib/libm/man
Module Name:src Committed By: njoly Date: Fri Apr 26 18:18:22 UTC 2013 Modified Files: src/lib/libm/man: atan2.3 Log Message: Kill some extra backslashes. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/lib/libm/man/atan2.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/man/atan2.3 diff -u src/lib/libm/man/atan2.3:1.17 src/lib/libm/man/atan2.3:1.18 --- src/lib/libm/man/atan2.3:1.17 Tue Jan 29 02:54:30 2013 +++ src/lib/libm/man/atan2.3 Fri Apr 26 18:18:22 2013 @@ -26,7 +26,7 @@ .\ SUCH DAMAGE. .\ .\ from: @(#)atan2.3 5.1 (Berkeley) 5/2/91 -.\ $NetBSD: atan2.3,v 1.17 2013/01/29 02:54:30 matt Exp $ +.\ $NetBSD: atan2.3,v 1.18 2013/04/26 18:18:22 njoly Exp $ .\ .Dd January 29, 2013 .Dt ATAN2 3 @@ -84,7 +84,7 @@ if .Ar x \*[Gt] 0, .It Ta sign( Ns Ar y Ns )*(\*(Pi - -.Fn atan \\*(Bay/x\\*(Ba ) Ta +.Fn atan \*(Bay/x\*(Ba ) Ta if .Ar x \*[Lt] 0, @@ -92,7 +92,7 @@ if .No 0 Ta if x = y = 0, or .It Ta -.Pf sign( Ar y Ns )*\\*(Pi/2 Ta +.Pf sign( Ar y Ns )*\*(Pi/2 Ta if .Ar x = 0 \*(!=
CVS commit: src/sys/sys
Module Name:src Committed By: christos Date: Fri Apr 26 18:29:07 UTC 2013 Modified Files: src/sys/sys: featuretest.h Log Message: comment about ISOC11 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/sys/featuretest.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/featuretest.h diff -u src/sys/sys/featuretest.h:1.9 src/sys/sys/featuretest.h:1.10 --- src/sys/sys/featuretest.h:1.9 Mon May 4 12:44:14 2009 +++ src/sys/sys/featuretest.h Fri Apr 26 14:29:06 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: featuretest.h,v 1.9 2009/05/04 16:44:14 ginsbach Exp $ */ +/* $NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $ */ /* * Written by Klaus Klein kle...@netbsd.org, February 2, 1998. @@ -56,6 +56,7 @@ * * _REENTRANT * _ISOC99_SOURCE + * _ISOC11_SOURCE * _LARGEFILE_SOURCE Large File Support * http://ftp.sas.com/standards/large.file/x_open.20Mar96.html */
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: christos Date: Fri Apr 26 18:29:55 UTC 2013 Modified Files: src/lib/libc/stdlib: Makefile.inc atexit.3 atexit.c exit.3 Added Files: src/lib/libc/stdlib: at_quick_exit.3 quick_exit.3 quick_exit.c Log Message: add {at_,}quick_exit(3) from FreeBSD To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/lib/libc/stdlib/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/stdlib/at_quick_exit.3 \ src/lib/libc/stdlib/quick_exit.3 src/lib/libc/stdlib/quick_exit.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/stdlib/atexit.3 cvs rdiff -u -r1.24 -r1.25 src/lib/libc/stdlib/atexit.c cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdlib/exit.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/Makefile.inc diff -u src/lib/libc/stdlib/Makefile.inc:1.78 src/lib/libc/stdlib/Makefile.inc:1.79 --- src/lib/libc/stdlib/Makefile.inc:1.78 Wed Sep 14 19:33:51 2011 +++ src/lib/libc/stdlib/Makefile.inc Fri Apr 26 14:29:55 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.78 2011/09/14 23:33:51 christos Exp $ +# $NetBSD: Makefile.inc,v 1.79 2013/04/26 18:29:55 christos Exp $ # from: @(#)Makefile.inc 8.3 (Berkeley) 2/4/95 # stdlib sources @@ -11,7 +11,7 @@ SRCS+= _env.c _rand48.c \ hcreate.c heapsort.c imaxdiv.c insque.c jrand48.c l64a.c lldiv.c \ lcong48.c lrand48.c lsearch.c merge.c mi_vector_hash.c mrand48.c \ nrand48.c putenv.c qabs.c qdiv.c qsort.c posix_openpt.c pty.c \ - radixsort.c rand.c rand_r.c random.c remque.c \ + quick_exit.c radixsort.c rand.c rand_r.c random.c remque.c \ seed48.c setenv.c srand48.c strsuftoll.c \ strtoimax.c strtol.c strtoll.c strtoq.c strtoul.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c \ @@ -38,6 +38,7 @@ CPPFLAGS.strtouq.c+= -I${LIBCDIR}/../../ .include ${ARCHDIR}/stdlib/Makefile.inc MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 atoll.3 \ + at_quick_exit.3 \ bsearch.3 \ div.3 \ exit.3 \ @@ -48,7 +49,7 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atex lsearch.3 \ malloc.3 memory.3 mi_vector_hash.3 \ posix_memalign.3 posix_openpt.3 ptsname.3 \ - qabs.3 qdiv.3 qsort.3 \ + qabs.3 qdiv.3 quick_exit.3 qsort.3 \ radixsort.3 rand48.3 rand.3 random.3 \ strfmon.3 strsuftoll.3 strtod.3 strtol.3 strtoul.3 system.3 \ tsearch.3 \ Index: src/lib/libc/stdlib/atexit.3 diff -u src/lib/libc/stdlib/atexit.3:1.9 src/lib/libc/stdlib/atexit.3:1.10 --- src/lib/libc/stdlib/atexit.3:1.9 Thu Aug 7 12:43:38 2003 +++ src/lib/libc/stdlib/atexit.3 Fri Apr 26 14:29:55 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: atexit.3,v 1.9 2003/08/07 16:43:38 agc Exp $ +.\ $NetBSD: atexit.3,v 1.10 2013/04/26 18:29:55 christos Exp $ .\ .\ Copyright (c) 1990, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -68,7 +68,9 @@ No memory was available to add the funct The existing list of functions is unmodified. .El .Sh SEE ALSO +.Xr at_quick_exit 3 .Xr exit 3 +.Xr quick_exit 3 .Sh STANDARDS The .Fn atexit Index: src/lib/libc/stdlib/atexit.c diff -u src/lib/libc/stdlib/atexit.c:1.24 src/lib/libc/stdlib/atexit.c:1.25 --- src/lib/libc/stdlib/atexit.c:1.24 Thu Oct 8 12:33:45 2009 +++ src/lib/libc/stdlib/atexit.c Fri Apr 26 14:29:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: atexit.c,v 1.24 2009/10/08 16:33:45 pooka Exp $ */ +/* $NetBSD: atexit.c,v 1.25 2013/04/26 18:29:55 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: atexit.c,v 1.24 2009/10/08 16:33:45 pooka Exp $); +__RCSID($NetBSD: atexit.c,v 1.25 2013/04/26 18:29:55 christos Exp $); #endif /* LIBC_SCCS and not lint */ #include reentrant.h @@ -74,7 +74,7 @@ static struct atexit_handler *atexit_han #ifdef _REENTRANT /* ..and a mutex to protect it all. */ -static mutex_t atexit_mutex; +mutex_t __atexit_mutex; #endif /* _REENTRANT */ void __libc_atexit_init(void) __attribute__ ((visibility(hidden))); @@ -85,7 +85,7 @@ void __libc_atexit_init(void) __attribut * if possible. cxa_atexit handlers are never allocated from the static * pool. * - * atexit_mutex must be held. + * __atexit_mutex must be held. */ static struct atexit_handler * atexit_handler_alloc(void *dso) @@ -105,7 +105,7 @@ atexit_handler_alloc(void *dso) /* * Either no static slot was free, or this is a cxa_atexit - * handler. Allocate a new one. We keep the atexit_mutex + * handler. Allocate a new one. We keep the __atexit_mutex * held to prevent handlers from being run while we (potentially) * block in malloc(). */ @@ -114,7 +114,7 @@ atexit_handler_alloc(void *dso) } /* - * Initialize atexit_mutex with the PTHREAD_MUTEX_RECURSIVE attribute. + * Initialize __atexit_mutex with the PTHREAD_MUTEX_RECURSIVE attribute. * Note that __cxa_finalize may generate calls to __cxa_atexit.
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: christos Date: Fri Apr 26 18:32:43 UTC 2013 Modified Files: src/distrib/sets/lists/comp: mi Log Message: add {at_,}quick_exit To generate a diff of this commit: cvs rdiff -u -r1.1816 -r1.1817 src/distrib/sets/lists/comp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1816 src/distrib/sets/lists/comp/mi:1.1817 --- src/distrib/sets/lists/comp/mi:1.1816 Thu Apr 11 20:55:12 2013 +++ src/distrib/sets/lists/comp/mi Fri Apr 26 14:32:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1816 2013/04/12 00:55:12 christos Exp $ +# $NetBSD: mi,v 1.1817 2013/04/26 18:32:41 christos Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -4674,6 +4674,7 @@ ./usr/share/man/cat3/asprintf.0 comp-c-catman .cat ./usr/share/man/cat3/assert.0 comp-c-catman .cat ./usr/share/man/cat3/assume_default_colors.0 comp-c-catman .cat +./usr/share/man/cat3/at_quick_exit.0 comp-c-catman .cat ./usr/share/man/cat3/atan.0 comp-c-catman .cat ./usr/share/man/cat3/atan2.0 comp-c-catman .cat ./usr/share/man/cat3/atan2f.0 comp-c-catman .cat @@ -7630,6 +7631,7 @@ ./usr/share/man/cat3/qiflush.0 comp-c-catman .cat ./usr/share/man/cat3/qsort.0 comp-c-catman .cat ./usr/share/man/cat3/queue.0 comp-c-catman .cat +./usr/share/man/cat3/quick_exit.0 comp-c-catman .cat ./usr/share/man/cat3/quota_close.0 comp-c-catman .cat ./usr/share/man/cat3/quota_delete.0 comp-c-catman .cat ./usr/share/man/cat3/quota_get.0 comp-c-catman .cat @@ -11262,6 +11264,7 @@ ./usr/share/man/html3/asprintf.html comp-c-htmlman html ./usr/share/man/html3/assert.html comp-c-htmlman html ./usr/share/man/html3/assume_default_colors.html comp-c-htmlman html +./usr/share/man/html3/at_quick_exit.html comp-c-htmlman html ./usr/share/man/html3/atan.html comp-c-htmlman html ./usr/share/man/html3/atan2.html comp-c-htmlman html ./usr/share/man/html3/atan2f.html comp-c-htmlman html @@ -14120,6 +14123,7 @@ ./usr/share/man/html3/qiflush.html comp-c-htmlman html ./usr/share/man/html3/qsort.html comp-c-htmlman html ./usr/share/man/html3/queue.html comp-c-htmlman html +./usr/share/man/html3/quick_exit.html comp-c-htmlman html ./usr/share/man/html3/quota_close.html comp-c-htmlman html ./usr/share/man/html3/quota_delete.html comp-c-htmlman html ./usr/share/man/html3/quota_get.html comp-c-htmlman html @@ -17652,6 +17656,7 @@ ./usr/share/man/man3/asprintf.3 comp-c-man .man ./usr/share/man/man3/assert.3 comp-c-man .man ./usr/share/man/man3/assume_default_colors.3 comp-c-man .man +./usr/share/man/man3/at_quick_exit.3 comp-c-man .man ./usr/share/man/man3/atan.3 comp-c-man .man ./usr/share/man/man3/atan2.3 comp-c-man .man ./usr/share/man/man3/atan2f.3 comp-c-man .man @@ -20608,6 +20613,7 @@ ./usr/share/man/man3/qiflush.3 comp-c-man .man ./usr/share/man/man3/qsort.3 comp-c-man .man ./usr/share/man/man3/queue.3 comp-c-man .man +./usr/share/man/man3/quick_exit.3 comp-c-man .man ./usr/share/man/man3/quota_close.3 comp-c-man .man ./usr/share/man/man3/quota_delete.3 comp-c-man .man ./usr/share/man/man3/quota_get.3 comp-c-man .man
CVS commit: src/sys/arch/evbmips/conf
Module Name:src Committed By: christos Date: Fri Apr 26 18:35:43 UTC 2013 Modified Files: src/sys/arch/evbmips/conf: majors.evbmips Log Message: spiflash is mi now To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/evbmips/conf/majors.evbmips Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/majors.evbmips diff -u src/sys/arch/evbmips/conf/majors.evbmips:1.27 src/sys/arch/evbmips/conf/majors.evbmips:1.28 --- src/sys/arch/evbmips/conf/majors.evbmips:1.27 Thu Jun 30 16:09:29 2011 +++ src/sys/arch/evbmips/conf/majors.evbmips Fri Apr 26 14:35:43 2013 @@ -1,4 +1,4 @@ -# $NetBSD: majors.evbmips,v 1.27 2011/06/30 20:09:29 wiz Exp $ +# $NetBSD: majors.evbmips,v 1.28 2013/04/26 18:35:43 christos Exp $ # # Device majors for evbmips # @@ -80,7 +80,6 @@ device-major uart char 77 uart device-major nsmb char 98 nsmb device-major athflash char 99 athflash -device-major spiflash char 100 block 19 spiflash # Majors up to 143 are reserved for machine-dependent drivers. # New machine-independent driver majors are assigned in
CVS commit: src/bin/rm
Module Name:src Committed By: christos Date: Fri Apr 26 18:43:23 UTC 2013 Modified Files: src/bin/rm: rm.1 rm.c Log Message: PR/47770: Eitan Adler: add x flag to rm to avoid cross mount points To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/bin/rm/rm.1 cvs rdiff -u -r1.52 -r1.53 src/bin/rm/rm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/rm/rm.1 diff -u src/bin/rm/rm.1:1.25 src/bin/rm/rm.1:1.26 --- src/bin/rm/rm.1:1.25 Sat Oct 13 10:18:16 2012 +++ src/bin/rm/rm.1 Fri Apr 26 14:43:22 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: rm.1,v 1.25 2012/10/13 14:18:16 njoly Exp $ +.\ $NetBSD: rm.1,v 1.26 2013/04/26 18:43:22 christos Exp $ .\ .\ Copyright (c) 1990, 1993, 1994, 2003 .\ The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\ .\ @(#)rm.1 8.5 (Berkeley) 12/5/94 .\ -.Dd August 25, 2006 +.Dd April 26, 2013 .Dt RM 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl f | Fl i -.Op Fl dPRrvW +.Op Fl dPRrvWx .Ar .Sh DESCRIPTION The @@ -110,6 +110,8 @@ to be verbose, showing files as they are Attempts to undelete the named files. Currently, this option can only be used to recover files covered by whiteouts. +.It Fl x +When removing a hierarchy, do not cross mount points. .El .Pp The @@ -189,7 +191,9 @@ utility is expected to be compatible. The .Fl v -option is an extension. +and +.Fl x +options are extensions. .Pp The .Fl P Index: src/bin/rm/rm.c diff -u src/bin/rm/rm.c:1.52 src/bin/rm/rm.c:1.53 --- src/bin/rm/rm.c:1.52 Wed Jun 13 03:35:37 2012 +++ src/bin/rm/rm.c Fri Apr 26 14:43:22 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rm.c,v 1.52 2012/06/13 07:35:37 dholland Exp $ */ +/* $NetBSD: rm.c,v 1.53 2013/04/26 18:43:22 christos Exp $ */ /*- * Copyright (c) 1990, 1993, 1994, 2003 @@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1990, 19 #if 0 static char sccsid[] = @(#)rm.c 8.8 (Berkeley) 4/27/95; #else -__RCSID($NetBSD: rm.c,v 1.52 2012/06/13 07:35:37 dholland Exp $); +__RCSID($NetBSD: rm.c,v 1.53 2013/04/26 18:43:22 christos Exp $); #endif #endif /* not lint */ @@ -61,6 +61,7 @@ __RCSID($NetBSD: rm.c,v 1.52 2012/06/13 #include unistd.h static int dflag, eval, fflag, iflag, Pflag, stdin_ok, vflag, Wflag; +static int xflag; static sig_atomic_t pinfo; static int check(char *, char *, struct stat *); @@ -94,8 +95,8 @@ main(int argc, char *argv[]) setprogname(argv[0]); (void)setlocale(LC_ALL, ); - Pflag = rflag = 0; - while ((ch = getopt(argc, argv, dfiPRrvW)) != -1) + Pflag = rflag = xflag = 0; + while ((ch = getopt(argc, argv, dfiPRrvWx)) != -1) switch (ch) { case 'd': dflag = 1; @@ -118,6 +119,9 @@ main(int argc, char *argv[]) case 'v': vflag = 1; break; + case 'x': + xflag = 1; + break; case 'W': Wflag = 1; break; @@ -175,6 +179,8 @@ rm_tree(char **argv) flags |= FTS_NOSTAT; if (Wflag) flags |= FTS_WHITEOUT; + if (xflag) + flags |= FTS_XDEV; if ((fts = fts_open(argv, flags, NULL)) == NULL) err(1, fts_open failed); while ((p = fts_read(fts)) != NULL) { @@ -591,7 +597,7 @@ static void usage(void) { - (void)fprintf(stderr, usage: %s [-f|-i] [-dPRrvW] file ...\n, + (void)fprintf(stderr, usage: %s [-f|-i] [-dPRrvWx] file ...\n, getprogname()); exit(1); /* NOTREACHED */
CVS commit: src/bin/rm
Module Name:src Committed By: wiz Date: Fri Apr 26 19:34:34 UTC 2013 Modified Files: src/bin/rm: rm.1 Log Message: Sort sections. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/bin/rm/rm.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/rm/rm.1 diff -u src/bin/rm/rm.1:1.26 src/bin/rm/rm.1:1.27 --- src/bin/rm/rm.1:1.26 Fri Apr 26 18:43:22 2013 +++ src/bin/rm/rm.1 Fri Apr 26 19:34:34 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: rm.1,v 1.26 2013/04/26 18:43:22 christos Exp $ +.\ $NetBSD: rm.1,v 1.27 2013/04/26 19:34:34 wiz Exp $ .\ .\ Copyright (c) 1990, 1993, 1994, 2003 .\ The Regents of the University of California. All rights reserved. @@ -146,31 +146,6 @@ can be accomplished as follows: or .Pp .Ic rm ./-file -.Sh SEE ALSO -.Xr rmdir 1 , -.Xr undelete 2 , -.Xr unlink 2 , -.Xr fts 3 , -.Xr getopt 3 , -.Xr symlink 7 -.Sh BUGS -The -.Fl P -option assumes that the underlying file system is a fixed-block file -system. -FFS is a fixed-block file system, LFS is not. -In addition, only regular files are overwritten, other types of files -are not. -Recent research indicates that as many as 35 overwrite passes with -carefully chosen data patterns may be necessary to actually prevent -recovery of data from a magnetic disk. -Thus the -.Fl P -option is likely both insufficient for its design purpose and far -too costly for default operation. -However, it will at least prevent the recovery of data from FFS -volumes with -.Xr fsdb 8 . .Sh COMPATIBILITY The .Nm @@ -183,6 +158,13 @@ Also, historical .Bx implementations prompted on the standard output, not the standard error output. +.Sh SEE ALSO +.Xr rmdir 1 , +.Xr undelete 2 , +.Xr unlink 2 , +.Xr fts 3 , +.Xr getopt 3 , +.Xr symlink 7 .Sh STANDARDS The .Nm @@ -208,3 +190,21 @@ magnetic disk. .Em Because these requirements are not met, the .Fl P .Em option does not conform to the standard . +.Sh BUGS +The +.Fl P +option assumes that the underlying file system is a fixed-block file +system. +FFS is a fixed-block file system, LFS is not. +In addition, only regular files are overwritten, other types of files +are not. +Recent research indicates that as many as 35 overwrite passes with +carefully chosen data patterns may be necessary to actually prevent +recovery of data from a magnetic disk. +Thus the +.Fl P +option is likely both insufficient for its design purpose and far +too costly for default operation. +However, it will at least prevent the recovery of data from FFS +volumes with +.Xr fsdb 8 .
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: wiz Date: Fri Apr 26 19:36:47 UTC 2013 Modified Files: src/lib/libc/stdlib: quick_exit.3 Log Message: Bump date after adding function to NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libc/stdlib/quick_exit.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/quick_exit.3 diff -u src/lib/libc/stdlib/quick_exit.3:1.1 src/lib/libc/stdlib/quick_exit.3:1.2 --- src/lib/libc/stdlib/quick_exit.3:1.1 Fri Apr 26 18:29:55 2013 +++ src/lib/libc/stdlib/quick_exit.3 Fri Apr 26 19:36:47 2013 @@ -1,7 +1,7 @@ -.\ $NetBSD: quick_exit.3,v 1.1 2013/04/26 18:29:55 christos Exp $ +.\ $NetBSD: quick_exit.3,v 1.2 2013/04/26 19:36:47 wiz Exp $ .\ Copyright (c) 2011 David Chisnall .\ All rights reserved. -.\ +.\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions .\ are met: @@ -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. -.\ +.\ .\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 @@ -22,10 +22,10 @@ .\ 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. -.\ +.\ .\ $FreeBSD: src/lib/libc/stdlib/quick_exit.3,v 1.4 2012/11/17 01:49:41 svnexp Exp $ .\ -.Dd December 7, 2011 +.Dd April 26, 2013 .Dt QUICK_EXIT 3 .Os .Sh NAME
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: wiz Date: Fri Apr 26 19:37:04 UTC 2013 Modified Files: src/lib/libc/stdlib: atexit.3 Log Message: Add commas in list. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdlib/atexit.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/atexit.3 diff -u src/lib/libc/stdlib/atexit.3:1.10 src/lib/libc/stdlib/atexit.3:1.11 --- src/lib/libc/stdlib/atexit.3:1.10 Fri Apr 26 18:29:55 2013 +++ src/lib/libc/stdlib/atexit.3 Fri Apr 26 19:37:04 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: atexit.3,v 1.10 2013/04/26 18:29:55 christos Exp $ +.\ $NetBSD: atexit.3,v 1.11 2013/04/26 19:37:04 wiz Exp $ .\ .\ Copyright (c) 1990, 1991, 1993 .\ The Regents of the University of California. All rights reserved. @@ -68,8 +68,8 @@ No memory was available to add the funct The existing list of functions is unmodified. .El .Sh SEE ALSO -.Xr at_quick_exit 3 -.Xr exit 3 +.Xr at_quick_exit 3 , +.Xr exit 3 , .Xr quick_exit 3 .Sh STANDARDS The
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: wiz Date: Fri Apr 26 19:37:18 UTC 2013 Modified Files: src/lib/libc/stdlib: at_quick_exit.3 Log Message: Bump date for adding the function to NetBSD. Fix xref. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libc/stdlib/at_quick_exit.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/at_quick_exit.3 diff -u src/lib/libc/stdlib/at_quick_exit.3:1.1 src/lib/libc/stdlib/at_quick_exit.3:1.2 --- src/lib/libc/stdlib/at_quick_exit.3:1.1 Fri Apr 26 18:29:55 2013 +++ src/lib/libc/stdlib/at_quick_exit.3 Fri Apr 26 19:37:18 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: at_quick_exit.3,v 1.1 2013/04/26 18:29:55 christos Exp $ +.\ $NetBSD: at_quick_exit.3,v 1.2 2013/04/26 19:37:18 wiz Exp $ .\ Copyright (c) 2011 David Chisnall .\ All rights reserved. .\ @@ -25,7 +25,7 @@ .\ .\ $FreeBSD: src/lib/libc/stdlib/at_quick_exit.3,v 1.5 2012/11/17 01:49:41 svnexp Exp $ .\ -.Dd December 7, 2011 +.Dd April 26, 2013 .Dt AT_QUICK_EXIT 3 .Os .Sh NAME @@ -46,7 +46,7 @@ result of calling The cleanup functions are called in the reverse order and will not be called if the program exits by calling .Xr exit 3 , -.Xr _Exit 3 , +.Xr _Exit 2 , or .Xr abort 3 . .Sh RETURN VALUES
CVS commit: src/share/man/man4
Module Name:src Committed By: rkujawa Date: Fri Apr 26 20:08:53 UTC 2013 Modified Files: src/share/man/man4: Makefile Added Files: src/share/man/man4: tps65217pmic.4 Log Message: Add man page for TPS65217 PMIC. To generate a diff of this commit: cvs rdiff -u -r1.597 -r1.598 src/share/man/man4/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man4/tps65217pmic.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/Makefile diff -u src/share/man/man4/Makefile:1.597 src/share/man/man4/Makefile:1.598 --- src/share/man/man4/Makefile:1.597 Sat Mar 30 02:38:58 2013 +++ src/share/man/man4/Makefile Fri Apr 26 20:08:53 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.597 2013/03/30 02:38:58 christos Exp $ +# $NetBSD: Makefile,v 1.598 2013/04/26 20:08:53 rkujawa Exp $ # @(#)Makefile 8.1 (Berkeley) 6/18/93 MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \ @@ -121,7 +121,7 @@ MAN+= sc.4 si.4 MAN+= fwohci.4 fwip.4 sbp.4 # machine-independent I2C devices -MAN+= dbcool.4 g760a.4 lmtemp.4 sdtemp.4 smscmon.4 spdmem.4 +MAN+= dbcool.4 g760a.4 lmtemp.4 sdtemp.4 smscmon.4 spdmem.4 tps65217pmic.4 # machine-independent SPI devices MAN += m25p.4 tm121temp.4 Added files: Index: src/share/man/man4/tps65217pmic.4 diff -u /dev/null src/share/man/man4/tps65217pmic.4:1.1 --- /dev/null Fri Apr 26 20:08:53 2013 +++ src/share/man/man4/tps65217pmic.4 Fri Apr 26 20:08:53 2013 @@ -0,0 +1,67 @@ +.\ $NetBSD: tps65217pmic.4,v 1.1 2013/04/26 20:08:53 rkujawa Exp $ +.\ +.\ Copyright (c) 2013 The NetBSD Foundation, Inc. +.\ All rights reserved. +.\ +.\ This code is derived from software contributed to The NetBSD Foundation +.\ by Radoslaw Kujawa. +.\ +.\ 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. +.\ +.Dd April 26, 2013 +.Dt TPS65217PMIC 4 +.Os +.Sh NAME +.Nm tps65217pmic +.Nd Texas Instruments TPS65217 Power Management IC driver +.Sh SYNOPSIS +.Cd tps65217pmic0 at iic? addr 0x24 +.Sh DESCRIPTION +The +.Nm +driver provides minimal support for the TPS65217 chip and allows reporting +regulated voltages through +.Xr envsys 4 +API. +.Sh SEE ALSO +.Xr envsys 4 +.Sh HISTORY +The +.Nm +device first appeared in +.Nx 7.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Radoslaw Kujawa Aq radoslaw.kuj...@gmail.com . +.Sh CAVEATS +The driver can only report current voltage regulator settings. +It can not measure the real voltage, as TPS65217 chip lacks hardware to do +that. + +Modifying voltage regulator parameters was deliberately left unimplemented, as +these parameters should only be set at the firmware level. +Setting wrong parameters may result in permanent hardware damange. +.Sh BUGS +Battery and interrupt support is not implemented.
CVS commit: src/distrib/sets/lists/man
Module Name:src Committed By: rkujawa Date: Fri Apr 26 20:10:57 UTC 2013 Modified Files: src/distrib/sets/lists/man: mi Log Message: Add tps65217pmic(4) page to dist list. To generate a diff of this commit: cvs rdiff -u -r1.1426 -r1.1427 src/distrib/sets/lists/man/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1426 src/distrib/sets/lists/man/mi:1.1427 --- src/distrib/sets/lists/man/mi:1.1426 Tue Apr 9 13:31:08 2013 +++ src/distrib/sets/lists/man/mi Fri Apr 26 20:10:56 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1426 2013/04/09 13:31:08 njoly Exp $ +# $NetBSD: mi,v 1.1427 2013/04/26 20:10:56 rkujawa Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -1703,6 +1703,7 @@ ./usr/share/man/cat4/tp.0 man-obsolete obsolete ./usr/share/man/cat4/tpm.0 man-sys-catman .cat ./usr/share/man/cat4/tprof.0 man-sys-catman .cat +./usr/share/man/cat4/tps65217pmic.0 man-sys-catman .cat ./usr/share/man/cat4/tqphy.0 man-sys-catman .cat ./usr/share/man/cat4/tr.0 man-sys-catman .cat ./usr/share/man/cat4/tra.0 man-sys-catman .cat @@ -4591,6 +4592,7 @@ ./usr/share/man/html4/tp.html man-obsolete obsolete ./usr/share/man/html4/tpm.html man-sys-htmlman html ./usr/share/man/html4/tprof.html man-sys-htmlman html +./usr/share/man/html4/tps65217pmic.html man-sys-htmlman html ./usr/share/man/html4/tqphy.html man-sys-htmlman html ./usr/share/man/html4/tr.html man-sys-htmlman html ./usr/share/man/html4/tra.html man-sys-htmlman html @@ -7397,6 +7399,7 @@ ./usr/share/man/man4/tp.4 man-obsolete obsolete ./usr/share/man/man4/tpm.4 man-sys-man .man ./usr/share/man/man4/tprof.4 man-sys-man .man +./usr/share/man/man4/tps65217pmic.4 man-sys-man .man ./usr/share/man/man4/tqphy.4 man-sys-man .man ./usr/share/man/man4/tr.4 man-sys-man .man ./usr/share/man/man4/tra.4 man-sys-man .man
CVS commit: src/share/man/man4
Module Name:src Committed By: wiz Date: Fri Apr 26 20:57:48 UTC 2013 Modified Files: src/share/man/man4: tps65217pmic.4 Log Message: Minor fixes. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/tps65217pmic.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/tps65217pmic.4 diff -u src/share/man/man4/tps65217pmic.4:1.1 src/share/man/man4/tps65217pmic.4:1.2 --- src/share/man/man4/tps65217pmic.4:1.1 Fri Apr 26 20:08:53 2013 +++ src/share/man/man4/tps65217pmic.4 Fri Apr 26 20:57:48 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: tps65217pmic.4,v 1.1 2013/04/26 20:08:53 rkujawa Exp $ +.\ $NetBSD: tps65217pmic.4,v 1.2 2013/04/26 20:57:48 wiz Exp $ .\ .\ Copyright (c) 2013 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -31,7 +31,7 @@ .Dt TPS65217PMIC 4 .Os .Sh NAME -.Nm tps65217pmic +.Nm tps65217pmic .Nd Texas Instruments TPS65217 Power Management IC driver .Sh SYNOPSIS .Cd tps65217pmic0 at iic? addr 0x24 @@ -39,8 +39,8 @@ The .Nm driver provides minimal support for the TPS65217 chip and allows reporting -regulated voltages through -.Xr envsys 4 +regulated voltages through the +.Xr envsys 4 API. .Sh SEE ALSO .Xr envsys 4 @@ -57,11 +57,11 @@ driver was written by .An Radoslaw Kujawa Aq radoslaw.kuj...@gmail.com . .Sh CAVEATS The driver can only report current voltage regulator settings. -It can not measure the real voltage, as TPS65217 chip lacks hardware to do +It can not measure the real voltage, as the TPS65217 chip lacks hardware to do that. - +.Pp Modifying voltage regulator parameters was deliberately left unimplemented, as these parameters should only be set at the firmware level. -Setting wrong parameters may result in permanent hardware damange. +Setting wrong parameters may result in permanent hardware damage. .Sh BUGS Battery and interrupt support is not implemented.
CVS commit: src
Module Name:src Committed By: joerg Date: Fri Apr 26 21:20:48 UTC 2013 Modified Files: src/common/lib/libc/stdlib: _strtol.h _strtoul.h src/lib/libc/citrus: citrus_bcs_strtol.c citrus_bcs_strtoul.c Log Message: Restore standalone strtol/strtoul for citrus for now. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/stdlib/_strtol.h \ src/common/lib/libc/stdlib/_strtoul.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_bcs_strtol.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_bcs_strtoul.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/stdlib/_strtol.h diff -u src/common/lib/libc/stdlib/_strtol.h:1.5 src/common/lib/libc/stdlib/_strtol.h:1.6 --- src/common/lib/libc/stdlib/_strtol.h:1.5 Tue Apr 16 21:44:06 2013 +++ src/common/lib/libc/stdlib/_strtol.h Fri Apr 26 21:20:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: _strtol.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */ +/* $NetBSD: _strtol.h,v 1.6 2013/04/26 21:20:48 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ * __INT_MIN : lower limit of the return type * __INT_MAX : upper limit of the return type */ -#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) +#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY) __INT _FUNCNAME(const char *nptr, char **endptr, int base) #else @@ -82,7 +82,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const * assume decimal; if base is already 16, allow 0x. */ s = nptr; -#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) +#if defined(_KERNEL) || defined(_STANDALONE) || \ +defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY) do { c = *s++; } while (isspace(c)); @@ -186,7 +187,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const return(acc); } -#if !defined(_KERNEL) !defined(_STANDALONE) !defined(HAVE_NBTOOL_CONFIG_H) +#if !defined(_KERNEL) !defined(_STANDALONE) \ +!defined(HAVE_NBTOOL_CONFIG_H) !defined(BCS_ONLY) __INT _FUNCNAME(const char *nptr, char **endptr, int base) { Index: src/common/lib/libc/stdlib/_strtoul.h diff -u src/common/lib/libc/stdlib/_strtoul.h:1.5 src/common/lib/libc/stdlib/_strtoul.h:1.6 --- src/common/lib/libc/stdlib/_strtoul.h:1.5 Tue Apr 16 21:44:06 2013 +++ src/common/lib/libc/stdlib/_strtoul.h Fri Apr 26 21:20:48 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: _strtoul.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */ +/* $NetBSD: _strtoul.h,v 1.6 2013/04/26 21:20:48 joerg Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -40,7 +40,8 @@ * __UINT : return type * __UINT_MAX : upper limit of the return type */ -#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) +#if defined(_KERNEL) || defined(_STANDALONE) || \ +defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY) __UINT _FUNCNAME(const char *nptr, char **endptr, int base) #else @@ -78,7 +79,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const * assume decimal; if base is already 16, allow 0x. */ s = nptr; -#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) +#if defined(_KERNEL) || defined(_STANDALONE) || \ +defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY) do { c = *s++; } while (isspace(c)); @@ -145,7 +147,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const return(acc); } -#if !defined(_KERNEL) !defined(_STANDALONE) !defined(HAVE_NBTOOL_CONFIG_H) +#if !defined(_KERNEL) !defined(_STANDALONE) \ +!defined(HAVE_NBTOOL_CONFIG_H) !defined(BCS_ONLY) __UINT _FUNCNAME(const char *nptr, char **endptr, int base) { Index: src/lib/libc/citrus/citrus_bcs_strtol.c diff -u src/lib/libc/citrus/citrus_bcs_strtol.c:1.3 src/lib/libc/citrus/citrus_bcs_strtol.c:1.4 --- src/lib/libc/citrus/citrus_bcs_strtol.c:1.3 Tue Apr 16 21:44:07 2013 +++ src/lib/libc/citrus/citrus_bcs_strtol.c Fri Apr 26 21:20:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_bcs_strtol.c,v 1.3 2013/04/16 21:44:07 joerg Exp $ */ +/* $NetBSD: citrus_bcs_strtol.c,v 1.4 2013/04/26 21:20:47 joerg Exp $ */ /*- * Copyright (c) 2005 The DragonFly Project. All rights reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: citrus_bcs_strtol.c,v 1.3 2013/04/16 21:44:07 joerg Exp $); +__RCSID($NetBSD: citrus_bcs_strtol.c,v 1.4 2013/04/26 21:20:47 joerg Exp $); #include assert.h #include errno.h @@ -39,12 +39,23 @@ __RCSID($NetBSD: citrus_bcs_strtol.c,v #include citrus_namespace.h #include citrus_bcs.h -long int -_bcs_strtol(const char * __restrict nptr, char ** __restrict endptr, int base) -{ -#if defined(HAVE_NBTOOL_CONFIG_H) - return strtol(nptr, endptr, base); -#else - return strtol_l(nptr, endptr, base, 0); -#endif -} +#define BCS_ONLY + +#define _FUNCNAME _bcs_strtol +#define __INT long int +#define __INT_MIN LONG_MIN +#define __INT_MAX LONG_MAX + +#undef isspace +#define
CVS commit: src/sys
Module Name:src Committed By: mlelstv Date: Fri Apr 26 22:27:17 UTC 2013 Modified Files: src/sys/kern: vfs_mount.c src/sys/sys: mount.h Log Message: Correct umount semantics to return EBUSY when a filesystem is busy instead of failing filesystem operations with EBUSY when attempting an umount. This fixes kern/38141. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/kern/vfs_mount.c cvs rdiff -u -r1.208 -r1.209 src/sys/sys/mount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_mount.c diff -u src/sys/kern/vfs_mount.c:1.17 src/sys/kern/vfs_mount.c:1.18 --- src/sys/kern/vfs_mount.c:1.17 Wed Feb 13 14:03:48 2013 +++ src/sys/kern/vfs_mount.c Fri Apr 26 22:27:16 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_mount.c,v 1.17 2013/02/13 14:03:48 hannken Exp $ */ +/* $NetBSD: vfs_mount.c,v 1.18 2013/04/26 22:27:16 mlelstv Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.17 2013/02/13 14:03:48 hannken Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_mount.c,v 1.18 2013/04/26 22:27:16 mlelstv Exp $); #include sys/param.h #include sys/kernel.h @@ -139,7 +139,7 @@ vfs_mountalloc(struct vfsops *vfsops, vn mp-mnt_op = vfsops; mp-mnt_refcnt = 1; TAILQ_INIT(mp-mnt_vnodelist); - rw_init(mp-mnt_unmounting); + mutex_init(mp-mnt_unmounting, MUTEX_DEFAULT, IPL_NONE); mutex_init(mp-mnt_renamelock, MUTEX_DEFAULT, IPL_NONE); mutex_init(mp-mnt_updating, MUTEX_DEFAULT, IPL_NONE); error = vfs_busy(mp, NULL); @@ -263,7 +263,7 @@ vfs_destroy(struct mount *mp) */ KASSERT(mp-mnt_refcnt == 0); specificdata_fini(mount_specificdata_domain, mp-mnt_specdataref); - rw_destroy(mp-mnt_unmounting); + mutex_destroy(mp-mnt_unmounting); mutex_destroy(mp-mnt_updating); mutex_destroy(mp-mnt_renamelock); if (mp-mnt_op != NULL) { @@ -276,6 +276,9 @@ vfs_destroy(struct mount *mp) * Mark a mount point as busy, and gain a new reference to it. Used to * prevent the file system from being unmounted during critical sections. * + * vfs_busy can be called multiple times and by multiple threads + * and must be accompanied by the same number of vfs_unbusy calls. + * * = The caller must hold a pre-existing reference to the mount. * = Will fail if the file system is being unmounted, or is unmounted. */ @@ -285,21 +288,18 @@ vfs_busy(struct mount *mp, struct mount KASSERT(mp-mnt_refcnt 0); - if (__predict_false(!rw_tryenter(mp-mnt_unmounting, RW_READER))) { - if (nextp != NULL) { - KASSERT(mutex_owned(mountlist_lock)); - *nextp = CIRCLEQ_NEXT(mp, mnt_list); - } - return EBUSY; - } + mutex_enter(mp-mnt_unmounting); if (__predict_false((mp-mnt_iflag IMNT_GONE) != 0)) { - rw_exit(mp-mnt_unmounting); + mutex_exit(mp-mnt_unmounting); if (nextp != NULL) { KASSERT(mutex_owned(mountlist_lock)); *nextp = CIRCLEQ_NEXT(mp, mnt_list); } return ENOENT; } + ++mp-mnt_busynest; + KASSERT(mp-mnt_busynest != 0); + mutex_exit(mp-mnt_unmounting); if (nextp != NULL) { mutex_exit(mountlist_lock); } @@ -310,6 +310,8 @@ vfs_busy(struct mount *mp, struct mount /* * Unbusy a busy filesystem. * + * Every successful vfs_busy() call must be undone by a vfs_unbusy() call. + * * = If keepref is true, preserve reference added by vfs_busy(). * = If nextp != NULL, acquire mountlist_lock. */ @@ -322,7 +324,10 @@ vfs_unbusy(struct mount *mp, bool keepre if (nextp != NULL) { mutex_enter(mountlist_lock); } - rw_exit(mp-mnt_unmounting); + mutex_enter(mp-mnt_unmounting); + KASSERT(mp-mnt_busynest != 0); + mp-mnt_busynest--; + mutex_exit(mp-mnt_unmounting); if (!keepref) { vfs_destroy(mp); } @@ -796,9 +801,22 @@ dounmount(struct mount *mp, int flags, s * mount point. See dounmount() for details. */ mutex_enter(syncer_mutex); - rw_enter(mp-mnt_unmounting, RW_WRITER); + + /* + * Abort unmount attempt when the filesystem is in use + */ + mutex_enter(mp-mnt_unmounting); + if (mp-mnt_busynest != 0) { + mutex_exit(mp-mnt_unmounting); + mutex_exit(syncer_mutex); + return EBUSY; + } + + /* + * Abort unmount attempt when the filesystem is not mounted + */ if ((mp-mnt_iflag IMNT_GONE) != 0) { - rw_exit(mp-mnt_unmounting); + mutex_exit(mp-mnt_unmounting); mutex_exit(syncer_mutex); return ENOENT; } @@ -821,6 +839,7 @@ dounmount(struct mount *mp, int flags, s mutex_exit(syncer_mutex); } mp-mnt_iflag |= IMNT_UNMOUNT; + mutex_enter(mp-mnt_updating); async = mp-mnt_flag MNT_ASYNC; mp-mnt_flag = ~MNT_ASYNC; cache_purgevfs(mp); /* remove cache entries for this file sys */ @@ -835,15 +854,17 @@ dounmount(struct mount *mp, int flags, s error = VFS_UNMOUNT(mp, flags); } if (error) { + mp-mnt_iflag = ~IMNT_UNMOUNT; + mutex_exit(mp-mnt_unmounting); if ((mp-mnt_flag (MNT_RDONLY | MNT_ASYNC)) == 0) (void)