From owner-p4-projects Fri Oct 11 16:50:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 467EF37B404; Fri, 11 Oct 2002 16:50:25 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D084237B401 for ; Fri, 11 Oct 2002 16:50:24 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B3FE43E77 for ; Fri, 11 Oct 2002 16:50:24 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BNo3Mt051186 for ; Fri, 11 Oct 2002 16:50:03 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.3/Submit) id g9BNo38B051181 for perforce@freebsd.org; Fri, 11 Oct 2002 16:50:03 -0700 (PDT) Date: Fri, 11 Oct 2002 16:50:03 -0700 (PDT) Message-Id: <200210112350.g9BNo38B051181@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 19107 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=19107 Change 19107 by peter@peter_daintree on 2002/10/11 16:49:39 IFC @19106 Affected files ... .. //depot/projects/ia64/include/stdio.h#9 integrate .. //depot/projects/ia64/lib/libc/Makefile#4 integrate .. //depot/projects/ia64/lib/libc/stdio/findfp.c#4 integrate .. //depot/projects/ia64/lib/libc/stdlib/strfmon.3#3 integrate .. //depot/projects/ia64/lib/libc/stdlib/strfmon.c#6 integrate .. //depot/projects/ia64/sys/ia64/ia64/pmap.c#40 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/cdrom.c#3 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/disks.c#5 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/install.c#7 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/label.c#6 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/main.c#3 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/menus.c#15 integrate .. //depot/projects/ia64/usr.sbin/sysinstall/system.c#3 integrate Differences ... ==== //depot/projects/ia64/include/stdio.h#9 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)stdio.h 8.5 (Berkeley) 4/29/95 - * $FreeBSD: src/include/stdio.h,v 1.47 2002/10/06 22:16:12 mike Exp $ + * $FreeBSD: src/include/stdio.h,v 1.48 2002/10/11 22:38:17 peter Exp $ */ #ifndef _STDIO_H_ @@ -138,7 +138,6 @@ } FILE; __BEGIN_DECLS -extern FILE __sF[]; extern FILE *__stdinp; extern FILE *__stdoutp; extern FILE *__stderrp; @@ -204,16 +203,9 @@ #define SEEK_END 2 /* set file offset to EOF plus offset */ #endif -/* To be removed by 5.0-RELEASE */ -#if (defined(__i386__) || defined(__alpha__)) && defined(_OLD_STDIO) -#define stdin (&__sF[0]) -#define stdout (&__sF[1]) -#define stderr (&__sF[2]) -#else #define stdin __stdinp #define stdout __stdoutp #define stderr __stderrp -#endif __BEGIN_DECLS /* ==== //depot/projects/ia64/lib/libc/Makefile#4 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 -# $FreeBSD: src/lib/libc/Makefile,v 1.35 2002/09/28 00:25:28 peter Exp $ +# $FreeBSD: src/lib/libc/Makefile,v 1.36 2002/10/11 22:38:16 peter Exp $ # # All library objects contain FreeBSD revision strings by default; they may be # excluded as a space-saving measure. To produce a library that does @@ -10,7 +10,6 @@ # system call stubs. LIB=c SHLIB_MAJOR= 5 -CFLAGS+=-DLIBC_MAJOR=${SHLIB_MAJOR} CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include AINC= -I${.CURDIR}/${MACHINE_ARCH} CLEANFILES+=tags ==== //depot/projects/ia64/lib/libc/stdio/findfp.c#4 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.21 2002/08/13 09:30:41 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.22 2002/10/11 22:38:17 peter Exp $"); #include #include @@ -69,10 +69,7 @@ static struct __sFILEX __sFX[3]; -#if LIBC_MAJOR >= 6 -static -#endif -FILE __sF[3] = { +static FILE __sF[3] = { std(__SRD, STDIN_FILENO), std(__SWR, STDOUT_FILENO), std(__SWR|__SNBF, STDERR_FILENO) ==== //depot/projects/ia64/lib/libc/stdlib/strfmon.3#3 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc/stdlib/strfmon.3,v 1.4 2002/09/20 08:24:01 mike Exp $ +.\" $FreeBSD: src/lib/libc/stdlib/strfmon.3,v 1.5 2002/10/11 23:17:17 tjr Exp $ .\" -.Dd September 7, 2001 +.Dd October 12, 2002 .Dt STRFMON 3 .Os .Sh NAME @@ -46,6 +46,73 @@ No more than .Fa maxsize bytes are placed into the array. +.Pp +The format string is composed of zero or more directives: +ordinary characters (not +.Cm % Ns ), +which are copied unchanged to the output stream; and conversion +specifications, each of which results in fetching zero or more subsequent +arguments. +Each conversion specification is introduced by the +.Cm % +character. +After the +.Cm % , +the following appear in sequence: +.Bl -bullet +.It +Zero or more of the following flags: +.Bl -tag -width "XXX" +.It Cm = Ns Ar f +A +.Sq Cm = +character followed by another character +.Ar f +which is used as the numeric fill character. +.It Cm ^ +Do not use grouping characters, regardless of the current locale default. +.It Cm + +Represent positive values by prefixing them with a positive sign, +and negative values by prefixing them with a negative sign. +This is the default. +.It Cm ( +Enclose negative values in parentheses. +.It Cm ! +Do not include a currency symbol in the output. +.It Cm \- +Left justify the result. +Only valid when a field width is specified. +.El +.It +An optional minimum field width as a decimal number. +By default, there is no minimum width. +.It +A +.Sq Cm # +sign followed by a decimal number specifying the maximum +expected number of digits after the radix character. +.It +A +.Sq Cm \&. +character followed by a decimal number specifying the number +the number of digits after the radix character. +.It +One of the following conversion specifiers: +.Bl -tag -width "XXX" +.It Cm i +The +.Vt double +argument is formatted as an international monetary amount. +.It Cm n +The +.Vt double +argument is formatted as a national monetary amount. +.It Cm % +A +.Sq Li % +character is written. +.El +.El .Sh RETURN VALUES If the total number of resulting bytes including the terminating .Dv NULL @@ -57,7 +124,7 @@ not including the terminating .Dv NULL byte. -Otherwise, \-1 is returned, +Otherwise, -1 is returned, the contents of the array are indeterminate, and .Va errno @@ -69,6 +136,10 @@ .Bl -tag -width Er .It Bq Er E2BIG Conversion stopped due to lack of space in the buffer. +.It Bq Er EINVAL +The format string is invalid. +.It Bq Er ENOMEM +Not enough memory for temporary buffers. .El .Sh SEE ALSO .Xr localeconv 3 @@ -77,9 +148,7 @@ .Fn strfmon function conforms to -.St -xpg4 -and -.St -susv2 . +.St -p1003.1-2001 . .Sh AUTHORS .An -nosplit The ==== //depot/projects/ia64/lib/libc/stdlib/strfmon.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdlib/strfmon.c,v 1.7 2002/09/20 08:24:01 mike Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/strfmon.c,v 1.11 2002/10/11 23:31:50 tjr Exp $"); #include #include @@ -114,6 +114,7 @@ char *tmpptr; /* temporary vars */ int *ntmp; + int sverrno; va_start(ap, format); @@ -174,18 +175,6 @@ case '-': /* alignment (left) */ flags |= LEFT_JUSTIFY; continue; - case '#': /* left || right precision */ - case '.': - if (*fmt == '#') - ntmp = &left_prec; - else - ntmp = &right_prec; - - if (!isdigit((unsigned char)*++fmt)) - goto format_error; - GET_NUMBER(*ntmp); - fmt--; - continue; default: break; } @@ -201,7 +190,21 @@ if (dst + width >= s + maxsize) goto e2big_error; } - + + /* Left precision */ + if (*fmt == '#') { + if (!isdigit((unsigned char)*++fmt)) + goto format_error; + GET_NUMBER(left_prec); + } + + /* Right precision */ + if (*fmt == '.') { + if (!isdigit((unsigned char)*++fmt)) + goto format_error; + GET_NUMBER(right_prec); + } + /* Conversion Characters */ switch (*fmt++) { case 'i': /* use internaltion currency format */ @@ -289,12 +292,8 @@ while (pad_size-- > 0) PRINT(' '); - if (sign_posn == 0) { - if (flags & IS_NEGATIVE) - PRINT('('); - else - PRINT(' '); - } + if (sign_posn == 0 && (flags & IS_NEGATIVE)) + PRINT('('); if (cs_precedes == 1) { if (sign_posn == 1 || sign_posn == 3) { @@ -379,10 +378,12 @@ errno = EINVAL; end_error: + sverrno = errno; if (asciivalue != NULL) free(asciivalue); if (currency_symbol != NULL) free(currency_symbol); + errno = sverrno; va_end(ap); return (-1); } @@ -393,7 +394,18 @@ struct lconv *lc = localeconv(); - if (flags & IS_NEGATIVE) { + if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { + *cs_precedes = lc->int_n_cs_precedes; + *sep_by_space = lc->int_n_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; + *signstr = (lc->negative_sign == '\0') ? "-" + : lc->negative_sign; + } else if (flags & USE_INTL_CURRENCY) { + *cs_precedes = lc->int_p_cs_precedes; + *sep_by_space = lc->int_p_sep_by_space; + *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn; + *signstr = lc->positive_sign; + } else if (flags & IS_NEGATIVE) { *cs_precedes = lc->n_cs_precedes; *sep_by_space = lc->n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; ==== //depot/projects/ia64/sys/ia64/ia64/pmap.c#40 (text+ko) ==== @@ -43,7 +43,7 @@ * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp * with some ideas from NetBSD's alpha pmap - * $FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.79 2002/10/11 21:41:53 peter Exp $ + * $FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.80 2002/10/11 22:29:22 peter Exp $ */ /* ==== //depot/projects/ia64/usr.sbin/sysinstall/cdrom.c#3 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/cdrom.c,v 1.51 2002/04/13 12:44:18 murray Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/cdrom.c,v 1.52 2002/10/11 22:30:08 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -155,6 +155,8 @@ if (strcmp(cp, "any") && #ifdef __alpha__ strcmp(cp, "alpha")) { +#elif defined(__sparc64__) + strcmp(cp, "sparc64")) { #else strcmp(cp, "x86")) { #endif ==== //depot/projects/ia64/usr.sbin/sysinstall/disks.c#5 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/disks.c,v 1.133 2002/07/24 22:15:51 peter Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/disks.c,v 1.134 2002/10/11 22:30:09 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -368,7 +368,7 @@ case 'A': case 'F': /* Undocumented magic Dangerously Dedicated mode */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) rv = 1; #else /* The rest is only relevant on x86 */ cp = variable_get(VAR_DEDICATE_DISK); @@ -442,7 +442,7 @@ partitiontype = fat; else partitiontype = unknown; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) if (partitiontype == freebsd && size == chunk_info[current_chunk]->size) All_FreeBSD(d, 1); else @@ -816,20 +816,20 @@ for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; static u_char *boot1; -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) static u_char *boot2; #endif if (!devs[i]->enabled) continue; -#ifdef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (!boot1) boot1 = bootalloc("boot1", NULL); - Set_Boot_Blocks(d, boot1, NULL); + if (!boot2) boot2 = bootalloc("boot2", NULL); + Set_Boot_Blocks(d, boot1, boot2); #else if (!boot1) boot1 = bootalloc("boot1", NULL); - if (!boot2) boot2 = bootalloc("boot2", NULL); - Set_Boot_Blocks(d, boot1, boot2); + Set_Boot_Blocks(d, boot1, NULL); #endif msgNotify("Writing partition information to drive %s", d->name); ==== //depot/projects/ia64/usr.sbin/sysinstall/install.c#7 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/install.c,v 1.322 2002/09/28 17:06:07 matusita Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/install.c,v 1.323 2002/10/11 22:30:09 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -518,7 +518,7 @@ dialog_clear_norefresh(); variable_set2(SYSTEM_STATE, "express", 0); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif @@ -546,7 +546,7 @@ variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" "to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n" @@ -566,16 +566,16 @@ } #endif -#ifdef __alpha__ - msgConfirm("Now you need to create BSD partitions on the disk which you are\n" - "installing to. If you have a reasonable amount of disk space (200MB or more)\n" +#if defined(__i386__) || defined(__ia64__) + msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" + "just created. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); #else - msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" - "just created. If you have a reasonable amount of disk space (200MB or more)\n" + msgConfirm("Now you need to create BSD partitions on the disk which you are\n" + "installing to. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" ==== //depot/projects/ia64/usr.sbin/sysinstall/label.c#6 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/label.c,v 1.118 2002/06/07 15:32:05 jhb Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/label.c,v 1.119 2002/10/11 22:30:09 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -59,7 +59,7 @@ /* * Minimum partition sizes */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) #define ROOT_MIN_SIZE 40 #else #define ROOT_MIN_SIZE 30 @@ -679,7 +679,7 @@ print_label_chunks(); } -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) /* * If there isn't a freebsd chunk already (i.e. there is no label), @@ -712,7 +712,7 @@ PartInfo *p, *oldp; PartType type; Device **devs; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) int i; #endif WINDOW *w = savescr(); @@ -729,7 +729,7 @@ } labeling = TRUE; keypad(stdscr, TRUE); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) for (i = 0; devs[i]; i++) { maybe_dedicate((Disk*) devs[i]->private); } @@ -1381,7 +1381,7 @@ d = dev->private; else d = devs[0]->private; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) maybe_dedicate(d); #endif record_label_chunks(devs, dev); ==== //depot/projects/ia64/usr.sbin/sysinstall/main.c#3 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/main.c,v 1.67 2002/03/29 23:03:17 murray Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/main.c,v 1.68 2002/10/11 22:30:09 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -162,7 +162,7 @@ choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" ==== //depot/projects/ia64/usr.sbin/sysinstall/menus.c#15 (text+ko) ==== @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "$FreeBSD: src/usr.sbin/sysinstall/menus.c,v 1.349 2002/07/24 22:16:11 peter Exp $"; + "$FreeBSD: src/usr.sbin/sysinstall/menus.c,v 1.350 2002/10/11 22:30:09 obrien Exp $"; #endif #include "sysinstall.h" @@ -1182,7 +1182,7 @@ "INSTALL", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Options", "View/Set various installation options", NULL, optionsEditor }, -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) { "3 Label", "Label disk partitions", NULL, diskLabelEditor }, { "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, @@ -1320,14 +1320,17 @@ dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, -#ifdef __i386__ { " linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, +#ifdef __i386__ + { " SCO", "This host wants to be able to run IBCS2 binaries.", + dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, +#endif +#if defined(__i386__) || defined(__sparc64__) { " SVR4", "This host wants to be able to run SVR4 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, - { " SCO", "This host wants to be able to run IBCS2 binaries.", - dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, -#elif __alpha__ +#endif +#ifdef __alpha__ { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "osf1_enable=YES" }, #endif ==== //depot/projects/ia64/usr.sbin/sysinstall/system.c#3 (text+ko) ==== @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $FreeBSD: src/usr.sbin/sysinstall/system.c,v 1.120 2002/08/09 07:44:43 jhay Exp $ + * $FreeBSD: src/usr.sbin/sysinstall/system.c,v 1.121 2002/10/11 22:30:09 obrien Exp $ * * Jordan Hubbard * @@ -253,7 +253,7 @@ if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) reboot(RB_HALT); #else reboot(0); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message