Date: Thu, 7 Aug 2003 17:38:38 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 35755 for review Message-ID: <200308080038.h780ccLj035593@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=35755 Change 35755 by marcel@marcel_nfs on 2003/08/07 17:38:14 IFC @35753 Affected files ... .. //depot/projects/ia64/bin/setfacl/setfacl.1#4 integrate .. //depot/projects/ia64/bin/setfacl/setfacl.c#6 integrate .. //depot/projects/ia64/contrib/isc-dhcp/FREEBSD-upgrade#6 integrate .. //depot/projects/ia64/contrib/isc-dhcp/client/dhclient.c#10 integrate .. //depot/projects/ia64/contrib/isc-dhcp/includes/dhcpd.h#8 integrate .. //depot/projects/ia64/etc/newsyslog.conf#10 integrate .. //depot/projects/ia64/etc/rc.d/initdiskless#9 integrate .. //depot/projects/ia64/lib/libc/locale/btowc.c#2 integrate .. //depot/projects/ia64/lib/libc/locale/mblen.c#3 integrate .. //depot/projects/ia64/lib/libc/locale/mbstowcs.c#5 integrate .. //depot/projects/ia64/lib/libc/locale/mbtowc.c#4 integrate .. //depot/projects/ia64/lib/libc/locale/wcstombs.c#4 integrate .. //depot/projects/ia64/lib/libc/locale/wctob.c#2 integrate .. //depot/projects/ia64/lib/libc/locale/wctomb.c#3 integrate .. //depot/projects/ia64/lib/libpthread/arch/ia64/ia64/context.S#3 integrate .. //depot/projects/ia64/lib/libpthread/arch/ia64/include/pthread_md.h#6 integrate .. //depot/projects/ia64/release/Makefile#67 integrate .. //depot/projects/ia64/sbin/ccdconfig/Makefile#5 integrate .. //depot/projects/ia64/sbin/ccdconfig/ccdconfig.c#9 integrate .. //depot/projects/ia64/sys/alpha/alpha/pmap.c#38 integrate .. //depot/projects/ia64/sys/boot/i386/libi386/biosacpi.c#5 integrate .. //depot/projects/ia64/sys/boot/i386/libi386/biospnp.c#4 integrate .. //depot/projects/ia64/sys/conf/NOTES#61 integrate .. //depot/projects/ia64/sys/conf/files#91 integrate .. //depot/projects/ia64/sys/conf/kern.post.mk#36 integrate .. //depot/projects/ia64/sys/conf/options#61 integrate .. //depot/projects/ia64/sys/contrib/dev/acpica/acfreebsd.h#12 integrate .. //depot/projects/ia64/sys/contrib/dev/acpica/common/adisasm.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/common/getopt.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslanalyze.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslcodegen.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslcompile.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslcompiler.h#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslcompiler.l#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslcompiler.y#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslerror.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslfiles.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslfold.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslglobal.h#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asllength.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asllisting.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslload.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asllookup.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslmain.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslmap.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslopcodes.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asloperands.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslopt.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslresource.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslrestype1.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslrestype2.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslstubs.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asltransform.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asltree.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/asltypes.h#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/compiler/aslutils.c#1 branch .. //depot/projects/ia64/sys/contrib/dev/acpica/osunixxf.c#1 branch .. //depot/projects/ia64/sys/dev/aac/aacvar.h#18 integrate .. //depot/projects/ia64/sys/dev/acpica/acpi_pcib_acpi.c#7 integrate .. //depot/projects/ia64/sys/dev/ct/ct.c#3 integrate .. //depot/projects/ia64/sys/dev/dgb/dgreg.h#2 integrate .. //depot/projects/ia64/sys/dev/digi/digi.c#15 integrate .. //depot/projects/ia64/sys/dev/digi/digi.h#6 integrate .. //depot/projects/ia64/sys/dev/digi/digireg.h#2 integrate .. //depot/projects/ia64/sys/dev/ed/if_ed.c#12 integrate .. //depot/projects/ia64/sys/dev/ed/if_ed_pccard.c#17 integrate .. //depot/projects/ia64/sys/dev/en/midwayvar.h#9 integrate .. //depot/projects/ia64/sys/dev/fatm/if_fatm.c#7 integrate .. //depot/projects/ia64/sys/dev/fatm/if_fatmvar.h#3 integrate .. //depot/projects/ia64/sys/dev/hatm/if_hatm.c#6 integrate .. //depot/projects/ia64/sys/dev/hatm/if_hatm_ioctl.c#6 integrate .. //depot/projects/ia64/sys/dev/hatm/if_hatm_tx.c#5 integrate .. //depot/projects/ia64/sys/dev/hatm/if_hatmvar.h#5 integrate .. //depot/projects/ia64/sys/dev/md/md.c#33 integrate .. //depot/projects/ia64/sys/dev/patm/if_patm.c#3 integrate .. //depot/projects/ia64/sys/dev/patm/if_patm_ioctl.c#4 integrate .. //depot/projects/ia64/sys/dev/patm/if_patmvar.h#3 integrate .. //depot/projects/ia64/sys/dev/pccard/pccarddevs#33 integrate .. //depot/projects/ia64/sys/dev/pccard/pccarddevs.h#33 integrate .. //depot/projects/ia64/sys/dev/pccbb/pccbb.c#31 integrate .. //depot/projects/ia64/sys/dev/ppbus/ppbconf.h#2 integrate .. //depot/projects/ia64/sys/dev/rc/rc.c#7 integrate .. //depot/projects/ia64/sys/dev/snc/dp83932.c#8 integrate .. //depot/projects/ia64/sys/fs/udf/udf_vfsops.c#13 integrate .. //depot/projects/ia64/sys/ia64/ia64/mp_machdep.c#35 integrate .. //depot/projects/ia64/sys/ia64/ia64/pmap.c#73 integrate .. //depot/projects/ia64/sys/ia64/include/cpu.h#19 integrate .. //depot/projects/ia64/sys/isofs/cd9660/cd9660_vfsops.c#20 integrate .. //depot/projects/ia64/sys/kern/kern_ktrace.c#21 integrate .. //depot/projects/ia64/sys/kern/kern_thread.c#62 integrate .. //depot/projects/ia64/sys/kern/sysv_msg.c#12 integrate .. //depot/projects/ia64/sys/kern/sysv_sem.c#15 integrate .. //depot/projects/ia64/sys/kern/sysv_shm.c#13 integrate .. //depot/projects/ia64/sys/kern/vfs_subr.c#53 integrate .. //depot/projects/ia64/sys/kern/vfs_syscalls.c#52 integrate .. //depot/projects/ia64/sys/netinet/in.h#19 integrate .. //depot/projects/ia64/sys/netinet/in_pcb.c#25 integrate .. //depot/projects/ia64/sys/netinet/in_proto.c#8 integrate .. //depot/projects/ia64/sys/netinet/ip_mroute.c#21 integrate .. //depot/projects/ia64/sys/netinet/ip_mroute.h#4 integrate .. //depot/projects/ia64/sys/netinet/ip_output.c#29 integrate .. //depot/projects/ia64/sys/netinet/ip_var.h#13 integrate .. //depot/projects/ia64/sys/netinet/pim.h#1 branch .. //depot/projects/ia64/sys/netinet/pim_var.h#1 branch .. //depot/projects/ia64/sys/netinet/raw_ip.c#24 integrate .. //depot/projects/ia64/sys/nfsclient/bootp_subr.c#15 integrate .. //depot/projects/ia64/sys/sys/namei.h#8 integrate .. //depot/projects/ia64/sys/ufs/ffs/ffs_vnops.c#31 integrate .. //depot/projects/ia64/usr.bin/netstat/inet.c#8 integrate .. //depot/projects/ia64/usr.bin/netstat/main.c#7 integrate .. //depot/projects/ia64/usr.bin/netstat/mroute.c#4 integrate .. //depot/projects/ia64/usr.bin/netstat/netstat.1#4 integrate .. //depot/projects/ia64/usr.bin/netstat/netstat.h#4 integrate .. //depot/projects/ia64/usr.sbin/acpi/Makefile.inc#3 integrate .. //depot/projects/ia64/usr.sbin/acpi/acpidb/Makefile#1 branch .. //depot/projects/ia64/usr.sbin/acpi/acpidb/acpidb.8#1 branch .. //depot/projects/ia64/usr.sbin/acpi/acpidb/acpidb.c#1 branch .. //depot/projects/ia64/usr.sbin/acpi/iasl/Makefile#1 branch .. //depot/projects/ia64/usr.sbin/acpi/iasl/iasl.8#1 branch Differences ... ==== //depot/projects/ia64/bin/setfacl/setfacl.1#4 (text+ko) ==== @@ -23,7 +23,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/bin/setfacl/setfacl.1,v 1.8 2002/12/30 15:36:29 rwatson Exp $ +.\" $FreeBSD: src/bin/setfacl/setfacl.1,v 1.9 2003/08/07 14:52:17 rwatson Exp $ .\" .Dd January 7, 2001 .Dt SETFACL 1 @@ -185,6 +185,24 @@ .Dq Li group ACL entries in the resulting ACL. .Pp +Traditional POSIX interfaces acting on file system object modes have +modified semantics in the presence of POSIX.1e extended ACLs. +When a mask entry is present on the access ACL of an object, the mask +entry is substituted for the group bits; this occurs in programs such +as +.Xr stat 1 +or +.Xr ls 1 . +When the mode is modified on an object that has a mask entry, the +changes applied to the group bits will actually be applied to the +mask entry. +These semantics provide for greater application compatibility: +applications modifying the mode instead of the ACL will see +conservative behavior, limiting the effective rights granted by all +of the additional user and group entries; this occurs in programs +such as +.Xr chmod 1 . +.Pp ACL entries applied from a file using the .Fl M or ==== //depot/projects/ia64/bin/setfacl/setfacl.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/bin/setfacl/setfacl.c,v 1.8 2003/07/18 16:00:26 rwatson Exp $"); +__FBSDID("$FreeBSD: src/bin/setfacl/setfacl.c,v 1.9 2003/08/07 14:43:43 rwatson Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -96,7 +96,7 @@ usage(void) { - fprintf(stderr, "usage: setfacl [-bdhknv] [-m entries] [-M file1] " + fprintf(stderr, "usage: setfacl [-bdhkn] [-m entries] [-M file1] " "[-x entries] [-X file2] [file ...]\n"); exit(1); } ==== //depot/projects/ia64/contrib/isc-dhcp/FREEBSD-upgrade#6 (text+ko) ==== @@ -1,5 +1,5 @@ # ex:ts=8 -$FreeBSD: src/contrib/isc-dhcp/FREEBSD-upgrade,v 1.16 2003/07/28 08:30:11 mbr Exp $ +$FreeBSD: src/contrib/isc-dhcp/FREEBSD-upgrade,v 1.17 2003/08/07 15:00:55 mbr Exp $ ISC DHCP client 3.0.1rc11 originals can be found at: ftp://ftp.isc.org/isc/dhcp/ @@ -47,6 +47,9 @@ r1.6 - document -D option. - remove dhcpd from SEE ALSO section. client/dhclient.c + r1.29 - interface polling + r1.28 - interface polling + r1.27 - interface polling r1.26 - interface polling r1.25 - correct release lease option r1.19 - connect std{in,out,err}. @@ -59,9 +62,12 @@ r1.2 - note that hostname is only set if not already set. - Remove dhcpd from SEE ALSO section. common/dispatch.c - r1.2 - polling mode + r1.2 - interface polling includes/dhcpd.h - r1.2 - polling mode + r1.5 - interface polling + r1.4 - interface polling + r1.3 - interface polling + r1.2 - interface polling (see CVS logs for complete details) murray@FreeBSD.org ==== //depot/projects/ia64/contrib/isc-dhcp/client/dhclient.c#10 (text+ko) ==== @@ -42,7 +42,7 @@ #ifndef lint static char ocopyright[] = "$Id: dhclient.c,v 1.129.2.12 2002/11/07 23:26:38 dhankins Exp $ Copyright (c) 1995-2002 Internet Software Consortium. All rights reserved.\n" -"$FreeBSD: src/contrib/isc-dhcp/client/dhclient.c,v 1.29 2003/08/07 07:27:14 mbr Exp $\n"; +"$FreeBSD: src/contrib/isc-dhcp/client/dhclient.c,v 1.30 2003/08/07 14:58:46 mbr Exp $\n"; #endif /* not lint */ #include "dhcpd.h" @@ -260,8 +260,13 @@ #ifdef __FreeBSD__ set_ieee80211 (tmp); #endif + /* Init some interface vars, enable polling */ +#ifdef ENABLE_POLLING_MODE tmp -> forcediscover = 0; tmp -> linkstate = 0; + tmp -> polling = 1; +#endif /* ifdef ENABLE_POLLING_MODE */ + if (interfaces) { interface_reference (&tmp -> next, interfaces, MDL); @@ -944,8 +949,10 @@ (long)(client -> active -> renewal - cur_time)); client -> state = S_BOUND; #ifdef ENABLE_POLLING_MODE + /* Init some interface vars, enable polling */ client -> interface -> linkstate = HAVELINK; client -> interface -> forcediscover = 0; + client -> interface -> polling = 1; #endif /* ifdef ENABLE_POLLING_MODE */ reinitialize_interfaces (); go_daemon (); @@ -1409,6 +1416,11 @@ int interval; int increase = 1; +#ifdef ENABLE_POLLING_MODE + /* Disable polling for this interface */ + client -> interface -> polling = 0; +#endif + /* Figure out how long it's been since we started transmitting. */ interval = cur_time - client -> first_sending; @@ -1552,6 +1564,10 @@ log_info ("bound: renewal in %ld %s.", (long)(client -> active -> renewal - cur_time), "seconds"); +#ifdef ENABLE_POLLING_MODE + /* Enable polling for thsi interface */ + client -> interface -> polling = 1; +#endif add_timeout (client -> active -> renewal, state_bound, client, 0, 0); } else { @@ -1609,6 +1625,12 @@ } log_info ("No working leases in persistent database - sleeping."); + +#ifdef ENABLE_POLLING_MODE + /* Enable polling for this interface */ + client -> interface -> polling = 1; +#endif + script_init (client, "FAIL", (struct string_list *)0); if (client -> alias) script_write_params (client, "alias_", client -> alias); @@ -3341,12 +3363,11 @@ struct interface_info *ip; struct client_state *client; -#ifdef DEBUG - printf ("Polling interface status\n"); -#endif for (ip = interfaces; ip; ip = ip -> next) { - + if (! ip -> polling) + continue; #ifdef DEBUG + printf ("%s: Polling interface state\n", ip -> name); for (client = ip -> client; client; client = client -> next) { printf ("%s: client state of %d\n", ip -> name, ip -> client -> state); ==== //depot/projects/ia64/contrib/isc-dhcp/includes/dhcpd.h#8 (text+ko) ==== @@ -40,7 +40,7 @@ * see ``http://www.vix.com''. To learn more about Nominum, Inc., see * ``http://www.nominum.com''. * - * $FreeBSD: src/contrib/isc-dhcp/includes/dhcpd.h,v 1.5 2003/08/07 07:27:14 mbr Exp $ + * $FreeBSD: src/contrib/isc-dhcp/includes/dhcpd.h,v 1.6 2003/08/07 14:58:46 mbr Exp $ */ #ifndef __CYGWIN32__ @@ -786,6 +786,7 @@ int ieee80211; /* True if media is ieee802.11 */ int havemedia; /* True if we have a media table */ int linkstate; /* True if we have link */ + int polling; /* True if polling is enabled */ int forcediscover; /* True if a discover is needed */ int index; /* Its index. */ int rfdesc; /* Its read file descriptor. */ ==== //depot/projects/ia64/etc/newsyslog.conf#10 (text+ko) ==== @@ -1,10 +1,10 @@ # configuration file for newsyslog -# $FreeBSD: src/etc/newsyslog.conf,v 1.46 2003/05/05 19:08:33 gad Exp $ +# $FreeBSD: src/etc/newsyslog.conf,v 1.47 2003/08/07 21:04:40 fjoe Exp $ # # Entries which do not specify the '/pid_file' field will cause the # syslogd process to be signalled when that log file is rotated. This # action is only appropriate for log files which are written to by the -# syslogd process (ie, files listed in /etc/syslogd.conf). If there +# syslogd process (ie, files listed in /etc/syslog.conf). If there # is no process which needs to be signalled when a given log file is # rotated, then the entry for that file should include the 'N' flag. # ==== //depot/projects/ia64/etc/rc.d/initdiskless#9 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 1999 Matt Dillion +# Copyright (c) 1999 Matt Dillon # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/etc/rc.d/initdiskless,v 1.24 2003/06/30 21:47:06 brooks Exp $ +# $FreeBSD: src/etc/rc.d/initdiskless,v 1.25 2003/08/07 21:06:32 fjoe Exp $ # # PROVIDE: initdiskless # KEYWORD: FreeBSD ==== //depot/projects/ia64/lib/libc/locale/btowc.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Tim J. Robbins. + * Copyright (c) 2002, 2003 Tim J. Robbins. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,21 +25,31 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/btowc.c,v 1.1 2002/08/03 13:49:55 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/btowc.c,v 1.2 2003/08/07 07:45:35 tjr Exp $"); -#include <rune.h> +#include <stdio.h> +#include <string.h> #include <wchar.h> wint_t btowc(int c) { - rune_t r; char cc; + wchar_t wc; if (c == EOF) return (WEOF); cc = (char)c; - if ((r = sgetrune(&cc, 1, NULL)) == _INVALID_RUNE) + /* + * We expect mbrtowc() to return 0 or 1, hence the check for n > 1 + * which detects error return values as well as "impossible" byte + * counts. + * + * We pass NULL as the state pointer to mbrtowc() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + if (mbrtowc(&wc, &cc, 1, NULL) > 1) return (WEOF); - return (r); + return (wc); } ==== //depot/projects/ia64/lib/libc/locale/mblen.c#3 (text+ko) ==== @@ -1,9 +1,6 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,18 +10,11 @@ * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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) @@ -35,24 +25,17 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/mblen.c,v 1.4 2002/10/28 08:24:46 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/mblen.c,v 1.5 2003/08/07 09:34:51 tjr Exp $"); -#include <errno.h> -#include <stddef.h> #include <stdlib.h> -#include <rune.h> int mblen(const char *s, size_t n) { - const char *e; - if (s == NULL) - /* No support for state dependent encodings. */ - return (0); - if (sgetrune(s, n, &e) == _INVALID_RUNE) { - errno = EILSEQ; - return (-1); - } - return (*s == '\0' ? 0 : e - s); + /* + * Calling mbtowc() is only legal because we don't support + * state-dependent encodings. + */ + return (mbtowc(NULL, s, n)); } ==== //depot/projects/ia64/lib/libc/locale/mbstowcs.c#5 (text+ko) ==== @@ -1,10 +1,7 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,18 +10,11 @@ * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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) @@ -35,54 +25,20 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/mbstowcs.c,v 1.6 2002/11/09 04:13:26 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/mbstowcs.c,v 1.7 2003/08/07 08:04:01 tjr Exp $"); -#include <errno.h> #include <stdlib.h> -#include <limits.h> -#include <stddef.h> -#include <rune.h> +#include <string.h> +#include <wchar.h> size_t mbstowcs(wchar_t * __restrict pwcs, const char * __restrict s, size_t n) { - const char *e; - int cnt; - rune_t r; - if (s == NULL) { - errno = EINVAL; - return (-1); - } - - if (pwcs == NULL) { - /* Convert and count only, do not store. */ - cnt = 0; - while ((r = sgetrune(s, MB_LEN_MAX, &e)) != _INVALID_RUNE && - r != 0) { - s = e; - cnt++; - } - if (r == _INVALID_RUNE) { - errno = EILSEQ; - return (-1); - } - return (cnt); - } - - /* Convert, store and count characters. */ - cnt = 0; - while (n-- > 0) { - *pwcs = sgetrune(s, MB_LEN_MAX, &e); - if (*pwcs == _INVALID_RUNE) { - errno = EILSEQ; - return (-1); - } - if (*pwcs++ == L'\0') - break; - s = e; - ++cnt; - } - - return (cnt); + /* + * We pass NULL as the state pointer to mbsrtowcs() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + return (mbsrtowcs(pwcs, &s, n, NULL)); } ==== //depot/projects/ia64/lib/libc/locale/mbtowc.c#4 (text+ko) ==== @@ -1,9 +1,6 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,18 +10,11 @@ * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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) @@ -35,27 +25,33 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/mbtowc.c,v 1.6 2002/10/28 08:24:46 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/mbtowc.c,v 1.7 2003/08/07 07:59:36 tjr Exp $"); #include <errno.h> +#include <limits.h> #include <stdlib.h> -#include <stddef.h> -#include <rune.h> +#include <string.h> +#include <wchar.h> int mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n) { - const char *e; - rune_t r; + size_t rval; if (s == NULL) /* No support for state dependent encodings. */ - return (0); - if ((r = sgetrune(s, n, &e)) == _INVALID_RUNE) { - errno = EILSEQ; + return (0); + /* + * We pass NULL as the state pointer to mbrtowc() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + rval = mbrtowc(pwc, s, n, NULL); + if (rval == (size_t)-1 || rval == (size_t)-2) + return (-1); + if (rval > INT_MAX) { + errno = ERANGE; return (-1); } - if (pwc != NULL) - *pwc = r; - return (r == 0 ? 0 : e - s); + return ((int)rval); } ==== //depot/projects/ia64/lib/libc/locale/wcstombs.c#4 (text+ko) ==== @@ -1,9 +1,6 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,18 +10,11 @@ * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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) @@ -35,57 +25,20 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/wcstombs.c,v 1.5 2002/10/27 10:41:21 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wcstombs.c,v 1.6 2003/08/07 08:04:01 tjr Exp $"); -#include <errno.h> #include <stdlib.h> -#include <limits.h> -#include <stddef.h> -#include <rune.h> +#include <string.h> +#include <wchar.h> size_t wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) { - char buf[MB_LEN_MAX]; - char *e; - int cnt, nb; - if (pwcs == NULL || n > INT_MAX) { - errno = EINVAL; - return (-1); - } - - cnt = 0; - - if (s == NULL) { - /* Convert and count only, do not store. */ - while (*pwcs != L'\0') { - if (sputrune(*pwcs++, buf, MB_LEN_MAX, &e) == 0) { - errno = EILSEQ; - return (-1); - } - cnt += e - buf; - } - return (cnt); - } - - /* Convert, store and count characters. */ - nb = n; - while (nb > 0) { - if (*pwcs == L'\0') { - *s = '\0'; - break; - } - if (sputrune(*pwcs++, s, nb, &e) == 0) { - errno = EILSEQ; - return (-1); - } - if (e == NULL) /* too long */ - return (cnt); - cnt += e - s; - nb -= e - s; - s = e; - } - - return (cnt); + /* + * We pass NULL as the state pointer to wcsrtombs() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + return (wcsrtombs(s, &pwcs, n, NULL)); } ==== //depot/projects/ia64/lib/libc/locale/wctob.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 Tim J. Robbins. + * Copyright (c) 2002, 2003 Tim J. Robbins. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,17 +25,24 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/wctob.c,v 1.1 2002/08/03 13:49:55 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wctob.c,v 1.2 2003/08/07 07:45:35 tjr Exp $"); -#include <rune.h> +#include <limits.h> +#include <stdio.h> +#include <string.h> #include <wchar.h> int wctob(wint_t c) { - char cc; + char buf[MB_LEN_MAX]; - if (c == WEOF || sputrune(c, &cc, 1, NULL) != 1) + /* + * We pass NULL as the state pointer to wcrtomb() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + if (c == WEOF || wcrtomb(buf, c, NULL) != 1) return (EOF); - return ((unsigned char)cc); + return ((unsigned char)*buf); } ==== //depot/projects/ia64/lib/libc/locale/wctomb.c#3 (text+ko) ==== @@ -1,9 +1,6 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. + * Copyright (c) 2002, 2003 Tim J. Robbins. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,18 +10,11 @@ * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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) @@ -35,32 +25,35 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/locale/wctomb.c,v 1.3 2002/10/27 10:41:21 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/wctomb.c,v 1.4 2003/08/07 07:59:36 tjr Exp $"); #include <errno.h> +#include <limits.h> #include <stdlib.h> -#include <limits.h> -#include <stddef.h> -#include <rune.h> +#include <string.h> +#include <wchar.h> int wctomb(char *s, wchar_t wchar) { - char *e; + char buf[MB_LEN_MAX]; + size_t rval; if (s == NULL) /* No support for state dependent encodings. */ - return (0); - - if (wchar == L'\0') { - *s = '\0'; - return (1); - } - - sputrune(wchar, s, MB_CUR_MAX, &e); - if (e == NULL) { - errno = EILSEQ; + return (0); + if (s == NULL) + s = buf; + /* + * We pass NULL as the state pointer to wcrtomb() because we don't + * support state-dependent encodings and don't want to waste time + * creating a zeroed mbstate_t that will not be used. + */ + if ((rval = wcrtomb(s, wchar, NULL)) == (size_t)-1) + return (-1); + if (rval > INT_MAX) { + errno = ERANGE; return (-1); } - return (e - s); + return ((int)rval); } ==== //depot/projects/ia64/lib/libpthread/arch/ia64/ia64/context.S#3 (text+ko) ==== @@ -25,7 +25,9 @@ */ #include <machine/asm.h> -__FBSDID("$FreeBSD: src/lib/libpthread/arch/ia64/ia64/context.S,v 1.3 2003/08/05 19:33:01 marcel Exp $"); +__FBSDID("$FreeBSD: src/lib/libpthread/arch/ia64/ia64/context.S,v 1.4 2003/08/07 08:03:05 marcel Exp $"); + +#include <sys/syscall.h> #define SIZEOF_SPECIAL (18*8) @@ -335,3 +337,15 @@ ;; } END(_ia64_save_context) + +/* + * void _ia64_break_setcontext(ucontext_t *ucp); + */ +ENTRY(_ia64_break_setcontext, 1) +{ .mib + mov r15=SYS_setcontext + break 0x100000 + br.ret.sptk rp + ;; +} +END(_ia64_break_setcontext) ==== //depot/projects/ia64/lib/libpthread/arch/ia64/include/pthread_md.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * (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/libpthread/arch/ia64/include/pthread_md.h,v 1.8 2003/08/06 06:12:54 deischen Exp $ + * $FreeBSD: src/lib/libpthread/arch/ia64/include/pthread_md.h,v 1.9 2003/08/07 08:03:05 marcel Exp $ */ #ifndef _PTHREAD_MD_H_ @@ -34,8 +34,14 @@ #include <ucontext.h> #define THR_GETCONTEXT(ucp) _ia64_save_context(&(ucp)->uc_mcontext) -#define THR_SETCONTEXT(ucp) _ia64_restore_context(&(ucp)->uc_mcontext, \ - 0, NULL) +#define THR_SETCONTEXT(ucp) \ + do { \ + if ((ucp)->uc_mcontext.mc_flags & _MC_FLAGS_ASYNC_CONTEXT) \ + _ia64_break_setcontext(ucp); \ + else \ + _ia64_restore_context(&(ucp)->uc_mcontext, 0, \ + NULL); \ + } while (0) #define PER_THREAD @@ -194,6 +200,7 @@ return (_tcb->tcb_curkcb->kcb_kse); } +void _ia64_break_setcontext(ucontext_t *ucp); void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack, size_t stacksz); int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc); @@ -218,14 +225,25 @@ static __inline int _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox) { + mcontext_t *mc; + _tcb_set(kcb, tcb); - if (setmbox != 0) - _ia64_restore_context(&tcb->tcb_tmbx.tm_context.uc_mcontext, - (intptr_t)&tcb->tcb_tmbx, - (intptr_t *)&kcb->kcb_kmbx.km_curthread); - else - _ia64_restore_context(&tcb->tcb_tmbx.tm_context.uc_mcontext, - 0, NULL); + mc = &tcb->tcb_tmbx.tm_context.uc_mcontext; + if (mc->mc_flags & _MC_FLAGS_ASYNC_CONTEXT) { + if (setmbox) { + mc->mc_flags |= _MC_FLAGS_KSE_SET_MBOX; + mc->mc_special.ifa = + (intptr_t)&kcb->kcb_kmbx.km_curthread; + mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx; + } + _ia64_break_setcontext(&tcb->tcb_tmbx.tm_context); + } else { + if (setmbox) + _ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx, + (intptr_t *)&kcb->kcb_kmbx.km_curthread); + else + _ia64_restore_context(mc, 0, NULL); + } /* We should not reach here. */ return (-1); } ==== //depot/projects/ia64/release/Makefile#67 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/Makefile,v 1.814 2003/08/06 08:09:40 ru Exp $ +# $FreeBSD: src/release/Makefile,v 1.815 2003/08/07 18:22:34 ru Exp $ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308080038.h780ccLj035593>