Re: svn commit: r225892 - head/sys/mips/mips
Hi Adrian, On Sat, Oct 1, 2011 at 11:26 AM, Adrian Chadd adr...@freebsd.org wrote: Author: adrian Date: Sat Oct 1 05:56:25 2011 New Revision: 225892 URL: http://svn.freebsd.org/changeset/base/225892 Log: Disable using wait in cpu_idle() until a better solution to timer and interrupt handling can be implemented. Taking out the whole thing looks like an overkill here - this is especially bad on XLR where busy wait on a hardware thread will take away cycles from the other hardware threads. The better workaround would be to revert to the version before r216862, which does not have the critical_enter/cpu_idleclock. JC. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225892 - head/sys/mips/mips
Reverting it unfortunately doesn't help; it messes up the event timer stuff. I'd like to see a more permanent solution. What I suggest we do moving forward is: * create a function pointer setup, like what i386 does * override it per-platform and per-chipset, once we know what the correct behaviour should be. Are you able to figure out how to achieve correct timer/interrupt/wait handling on XLR? Adrian ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225892 - head/sys/mips/mips
On Sat, Oct 1, 2011 at 12:39 PM, Adrian Chadd adr...@freebsd.org wrote: Reverting it unfortunately doesn't help; it messes up the event timer stuff. I would like to understand this, reverting r216862 would take out the critical_enter() and cpu_idleclock() which would keep the timer interrupts coming is as usual, this should not affect the event timer. I'd like to see a more permanent solution. What I suggest we do moving forward is: * create a function pointer setup, like what i386 does * override it per-platform and per-chipset, once we know what the correct behaviour should be. Are you able to figure out how to achieve correct timer/interrupt/wait handling on XLR? I'm not aware of any platforms which provide an equivalent of 'sti', so going for an implementation per platform may not help. JC. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225892 - head/sys/mips/mips
On 1 October 2011 15:21, Jayachandran C. jchan...@freebsd.org wrote: I would like to understand this, reverting r216862 would take out the critical_enter() and cpu_idleclock() which would keep the timer interrupts coming is as usual, this should not affect the event timer. Because the fundamental problem still exists w/out preemption - netisr/taskqueue scheduling doesn't happen if it happens just before the wait call. I haven't verified that mav's timer stuff does the correct thing by configuring the clock timer to occur every 1000hz in this instance. I kinda hope so. If I flip on preemption, then this may be fixed, but flipping on preemption causes other issues on the single-core MIPS boards that I've used when doing high-throughput 11n NIC testing. I don't (yet) know why. In any case, I think it's worth writing per-platform/per-chip cpu_idle() functions and set it up at boot/probe time. I'll happy do it if you're happy to do the digging with XLR to ensure this is all handled accurately in that instance. I just don't have the deep MIPS clue needed to ensure this is all correct and noone really piped up to come up with a better solution. I really want to see this all work correctly. :) Adrian ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225892 - head/sys/mips/mips
.. and somehow linux mips code does do a variety of WAIT-y things; how is it they don't have the interrupt handling issues we do? Is it because they're doing preemption? If so, how do they accurately handle hz clock pulses when an interrupt may preempt things just before that wait instruction occurs? Adrian ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225893 - head/usr.bin/fstat
Author: ed Date: Sat Oct 1 09:16:07 2011 New Revision: 225893 URL: http://svn.freebsd.org/changeset/base/225893 Log: Correct column with for device numbers made in previous change. The device number should be displayed using only five columns -- not eight. Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c == --- head/usr.bin/fstat/fstat.c Sat Oct 1 05:56:25 2011(r225892) +++ head/usr.bin/fstat/fstat.c Sat Oct 1 09:16:07 2011(r225893) @@ -441,7 +441,7 @@ print_vnode_info(struct procstat *procst } if (nflg) - printf( %#8jx, (uintmax_t)vn.vn_fsid); + printf( %#5jx, (uintmax_t)vn.vn_fsid); else if (vn.vn_mntdir != NULL) (void)printf( %-8s, vn.vn_mntdir); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225894 - in head/sys: kern sys
Author: kib Date: Sat Oct 1 10:18:55 2011 New Revision: 225894 URL: http://svn.freebsd.org/changeset/base/225894 Log: The sigwait(3) function shall not return EINTR, according to the POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7 contains the wrapper sigwait(3) which hides EINTR from callers. The EINTR return is used by libthr to handle required cancellation point in the sigwait(3). To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and earlier, to have right ABI for sigwait(3), transform EINTR return from sigwait(2) into ERESTART. Discussed with: davidxu MFC after:1 week Modified: head/sys/kern/kern_sig.c head/sys/sys/param.h Modified: head/sys/kern/kern_sig.c == --- head/sys/kern/kern_sig.cSat Oct 1 09:16:07 2011(r225893) +++ head/sys/kern/kern_sig.cSat Oct 1 10:18:55 2011(r225894) @@ -1094,6 +1094,8 @@ sys_sigwait(struct thread *td, struct si error = kern_sigtimedwait(td, set, ksi, NULL); if (error) { + if (error == EINTR td-td_proc-p_osrel P_OSREL_SIGWAIT) + error = ERESTART; if (error == ERESTART) return (error); td-td_retval[0] = error; Modified: head/sys/sys/param.h == --- head/sys/sys/param.hSat Oct 1 09:16:07 2011(r225893) +++ head/sys/sys/param.hSat Oct 1 10:18:55 2011(r225894) @@ -61,6 +61,7 @@ #define __FreeBSD_version 100 /* Master, propagated to newvers */ #ifdef _KERNEL +#defineP_OSREL_SIGWAIT 70 #defineP_OSREL_SIGSEGV 74 #defineP_OSREL_MAP_ANON800104 #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225894 - in head/sys: kern sys
On Sat, Oct 01, 2011 at 10:18:55AM +, Konstantin Belousov wrote: Author: kib Date: Sat Oct 1 10:18:55 2011 New Revision: 225894 URL: http://svn.freebsd.org/changeset/base/225894 Log: The sigwait(3) function shall not return EINTR, according to the POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7 contains the wrapper sigwait(3) which hides EINTR from callers. The r212405 will be merged to stable/8 shortly. EINTR return is used by libthr to handle required cancellation point in the sigwait(3). To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and earlier, to have right ABI for sigwait(3), transform EINTR return from sigwait(2) into ERESTART. This leaves the static binaries linked against libc.a from a system with libc.so.N, where N 7 or N == 7 and does not contain r212405, with the broken sigwait(). More intrusive change is to allocate new syscall number for sigwait(2), and change old sigwait(2) to never return EINTR. Then, the static binaries linked on HEAD and stable/9 prior to introduction of the new sigwait syscall numbers will have broken cancellation at sigwait. I had this done, but sort of agreement we reached is to go with less intrusive commit you see. And before you ask, the story started from the real user report of a broken binary-only program that is not prepared to handle EINTR there. pgpVn0lUwyt0V.pgp Description: PGP signature
Re: svn commit: r225892 - head/sys/mips/mips
Adrian Chadd wrote: .. and somehow linux mips code does do a variety of WAIT-y things; how is it they don't have the interrupt handling issues we do? Is it because they're doing preemption? If so, how do they accurately handle hz clock pulses when an interrupt may preempt things just before that wait instruction occurs? I may be wrong, it was time ago, but I think I've seen they doing some timer stuff within each interrupt handler. FreeBSD neither has unified place to do it now, nor I much like to add some overhead to every possible interrupt in a system. Present implementation supposed to be a compromise. -- Alexander Motin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225892 - head/sys/mips/mips
Adrian Chadd wrote: On 1 October 2011 15:21, Jayachandran C. jchan...@freebsd.org wrote: I would like to understand this, reverting r216862 would take out the critical_enter() and cpu_idleclock() which would keep the timer interrupts coming is as usual, this should not affect the event timer. I haven't verified that mav's timer stuff does the correct thing by configuring the clock timer to occur every 1000hz in this instance. I kinda hope so. When setting kern.eventtimer.idletick=1, you were effectively disabling cpu_idleclock()/cpu_activeclock() and you've properly received about 1127 timer interrupts per second (mix of 1000 of hz and 127 of stathz). Also when CPU is busy or has high interrupt/context switch rate, that happen automatically, so it definitely works. If you are talking about programming hardware timer for periodic 1000Hz rate, it doesn't happen automatically, because I doubt benefits it gives worth strict aliasing of hardclock() and statclock() it causes. If you like, you can do it manually via kern.eventtimer.periodic=1. -- Alexander Motin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225895 - stable/8/lib/libthr/thread
Author: kib Date: Sat Oct 1 11:49:24 2011 New Revision: 225895 URL: http://svn.freebsd.org/changeset/base/225895 Log: MFC r211526: Reduce redundant code. Modified: stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_sig.c == --- stable/8/lib/libthr/thread/thr_sig.cSat Oct 1 10:18:55 2011 (r225894) +++ stable/8/lib/libthr/thread/thr_sig.cSat Oct 1 11:49:24 2011 (r225895) @@ -233,23 +233,26 @@ _pthread_sigmask(int how, const sigset_t __weak_reference(__sigsuspend, sigsuspend); -int -_sigsuspend(const sigset_t * set) +static const sigset_t * +thr_remove_thr_signals(const sigset_t *set, sigset_t *newset) { - sigset_t newset; const sigset_t *pset; - int ret; if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; + *newset = *set; + SIGDELSET(*newset, SIGCANCEL); + pset = newset; } else pset = set; + return (pset); +} - ret = __sys_sigsuspend(pset); +int +_sigsuspend(const sigset_t * set) +{ + sigset_t newset; - return (ret); + return (__sys_sigsuspend(thr_remove_thr_signals(set, newset))); } int @@ -257,18 +260,10 @@ __sigsuspend(const sigset_t * set) { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigsuspend(pset); + ret = __sys_sigsuspend(thr_remove_thr_signals(set, newset)); _thr_cancel_leave(curthread); return (ret); @@ -283,17 +278,9 @@ _sigtimedwait(const sigset_t *set, sigin const struct timespec * timeout) { sigset_t newset; - const sigset_t *pset; - int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; - ret = __sys_sigtimedwait(pset, info, timeout); - return (ret); + return (__sys_sigtimedwait(thr_remove_thr_signals(set, newset), info, + timeout)); } int @@ -302,17 +289,11 @@ __sigtimedwait(const sigset_t *set, sigi { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; _thr_cancel_enter(curthread); - ret = __sys_sigtimedwait(pset, info, timeout); + ret = __sys_sigtimedwait(thr_remove_thr_signals(set, newset), info, + timeout); _thr_cancel_leave(curthread); return (ret); } @@ -321,18 +302,8 @@ int _sigwaitinfo(const sigset_t *set, siginfo_t *info) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; - ret = __sys_sigwaitinfo(pset, info); - return (ret); + return (__sys_sigwaitinfo(thr_remove_thr_signals(set, newset), info)); } int @@ -340,18 +311,10 @@ __sigwaitinfo(const sigset_t *set, sigin { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigwaitinfo(pset, info); + ret = __sys_sigwaitinfo(thr_remove_thr_signals(set, newset), info); _thr_cancel_leave(curthread); return (ret); } @@ -360,18 +323,8 @@ int _sigwait(const sigset_t *set, int *sig) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = newset; - } else - pset = set; - ret = __sys_sigwait(pset, sig); - return (ret); + return (__sys_sigwait(thr_remove_thr_signals(set, newset), sig)); } int @@ -379,18 +332,10 @@ __sigwait(const sigset_t *set, int *sig) { struct pthread *curthread = _get_curthread(); sigset_t newset; -
svn commit: r225896 - in stable/8/lib: libc/stdlib libc/sys libthr/thread
Author: kib Date: Sat Oct 1 11:59:45 2011 New Revision: 225896 URL: http://svn.freebsd.org/changeset/base/225896 Log: MFC r212405 (by davidxu): Because POSIX does not allow EINTR to be returned from sigwait(), add a wrapper for it in libc and rework the code in libthr, the system call still can return EINTR, we keep this feature. Discussed with: davidxu Added: stable/8/lib/libc/sys/sigwait.c - copied unchanged from r212405, head/lib/libc/sys/sigwait.c Modified: stable/8/lib/libc/stdlib/Makefile.inc stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libc/stdlib/Makefile.inc == --- stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -9,7 +9,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \ merge.c ptsname.c qsort.c qsort_r.c radixsort.c rand.c random.c \ - reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ + reallocf.c realpath.c remque.c sigwait.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c Modified: stable/8/lib/libc/sys/Makefile.inc == --- stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -23,6 +23,9 @@ SRCS+=stack_protector.c stack_protector SRCS+= fcntl.c ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c PSEUDO+= _fcntl.o .endif +SRCS+= sigwait.c +NOASM+= sigwait.o +PSEUDO+= _sigwait.o # Add machine dependent asm sources: SRCS+=${MDASM} Modified: stable/8/lib/libc/sys/Symbol.map == --- stable/8/lib/libc/sys/Symbol.mapSat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Symbol.mapSat Oct 1 11:59:45 2011 (r225896) @@ -917,6 +917,7 @@ FBSDprivate_1.0 { _sigtimedwait; __sys_sigtimedwait; _sigwait; + __sigwait; __sys_sigwait; _sigwaitinfo; __sys_sigwaitinfo; Copied: stable/8/lib/libc/sys/sigwait.c (from r212405, head/lib/libc/sys/sigwait.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/sigwait.c Sat Oct 1 11:59:45 2011 (r225896, copy of r212405, head/lib/libc/sys/sigwait.c) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2010 davi...@freebsd.org + * + * 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 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 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) + * 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. + */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include errno.h +#include signal.h + +int __sys_sigwait(const sigset_t * restrict, int * restrict); + +__weak_reference(__sigwait, sigwait); + +int +__sigwait(const sigset_t * restrict set, int * restrict sig) +{ + int ret; + + /* POSIX does not allow EINTR to be returned */ + do { + ret = __sys_sigwait(set, sig); + } while (ret == EINTR); + return (ret); +} Modified: stable/8/lib/libthr/thread/thr_sig.c
svn commit: r225897 - head/lib/libc/gen
Author: ed Date: Sat Oct 1 12:19:48 2011 New Revision: 225897 URL: http://svn.freebsd.org/changeset/base/225897 Log: Reimplement ctermid(). Even though POSIX allows us to return simply /dev/tty as a pathname identifying the controlling terminal of the running process, it is nicer if this function were actually useful, by returning the actual pathname of the controlling terminal. Implement ctermid() by using the kern.devname sysctl to resolve the actual name of /dev/tty. Don't use devname(3), since it may return bogus strings like #C:0x123. Modified: head/lib/libc/gen/ctermid.3 head/lib/libc/gen/ctermid.c Modified: head/lib/libc/gen/ctermid.3 == --- head/lib/libc/gen/ctermid.3 Sat Oct 1 11:59:45 2011(r225896) +++ head/lib/libc/gen/ctermid.3 Sat Oct 1 12:19:48 2011(r225897) @@ -28,7 +28,7 @@ .\ @(#)ctermid.3 8.1 (Berkeley) 6/4/93 .\ $FreeBSD$ .\ -.Dd June 4, 1993 +.Dd October 1, 2011 .Dt CTERMID 3 .Os .Sh NAME @@ -77,7 +77,8 @@ pointer, .Dv NULL is returned. .Pp -The current implementation simply returns +If no suitable lookup of the controlling terminal name can be performed, +this implementation returns .Ql /dev/tty . .Sh RETURN VALUES Upon successful completion, a Modified: head/lib/libc/gen/ctermid.c == --- head/lib/libc/gen/ctermid.c Sat Oct 1 11:59:45 2011(r225896) +++ head/lib/libc/gen/ctermid.c Sat Oct 1 12:19:48 2011(r225897) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2011 Ed Schouten e...@freebsd.org + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +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. - * 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) @@ -27,31 +24,47 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) !defined(lint) -static char sccsid[] = @(#)ctermid.c 8.1 (Berkeley) 6/4/93; -#endif /* LIBC_SCCS and not lint */ #include sys/cdefs.h __FBSDID($FreeBSD$); -#include stdio.h +#include sys/param.h +#include sys/stat.h +#include sys/sysctl.h + +#include errno.h #include paths.h +#include stdio.h #include string.h +#defineLEN_PATH_DEV(sizeof(_PATH_DEV) - 1) + char * ctermid(char *s) { - static char def[] = _PATH_TTY; - - if (s) { - bcopy(def, s, sizeof(_PATH_TTY)); - return(s); - } - return(def); + static char def[sizeof(_PATH_DEV) + SPECNAMELEN]; + struct stat sb; + size_t dlen; + int sverrno; + + if (s == NULL) { + s = def; + dlen = sizeof(def) - LEN_PATH_DEV; + } else + dlen = L_ctermid - LEN_PATH_DEV; + strcpy(s, _PATH_TTY); + + /* Attempt to perform a lookup of the actual TTY pathname. */ + sverrno = errno; + if (stat(_PATH_TTY, sb) == 0 S_ISCHR(sb.st_mode)) + (void)sysctlbyname(kern.devname, s + LEN_PATH_DEV, + dlen, sb.st_rdev, sizeof(sb.st_rdev)); + errno = sverrno; + return (s); } - char * ctermid_r(char *s) { - return (s) ? ctermid(s) : NULL; + + return (s != NULL ? ctermid(s) : NULL); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225898 - stable/8/lib/libc/sys
Author: kib Date: Sat Oct 1 12:35:09 2011 New Revision: 225898 URL: http://svn.freebsd.org/changeset/base/225898 Log: MFC r225172: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Modified: stable/8/lib/libc/sys/sigwait.2 stable/8/lib/libc/sys/sigwaitinfo.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigwait.2 == --- stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait Modified: stable/8/lib/libc/sys/sigwaitinfo.2 == --- stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGTIMEDWAIT 2 .Os .Sh NAME @@ -116,6 +116,16 @@ except that the selected signal number s member, and the cause of the signal shall be stored in the .Va si_code member. +Besides this, the +.Fn sigwaitinfo +and +.Fn sigtimedwait +system calls may return +.Er EINTR +if interrupted by signal, which is not allowed for the +.Fn sigwait +function. +.Pp If any value is queued to the selected signal, the first such queued value is dequeued and, if the info argument is .Pf non- Dv NULL , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
On Fri Sep 30 11, Edward Tomasz Napiera?a wrote: Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 20:57: On Thu Sep 29 11, Edward Tomasz Napiera?a wrote: Wiadomo?? napisana przez Alexander Best w dniu 29 wrz 2011, o godz. 14:14: On Thu Sep 29 11, Edward Tomasz Napierala wrote: Author: trasz Date: Thu Sep 29 06:31:42 2011 New Revision: 225868 URL: http://svn.freebsd.org/changeset/base/225868 Log: Make ps(1) automatically size its column widths. cool to see this committed. :) i think i wrote you about the two spaces between the TT and TIME field some time ago. you said that the TT entry can contain a postfix -. can you describe a situation, where this can occur? i've never seen the TT field contain an entry larger than 2 chars. Login via ssh, run nohup sleep 1000 , then logout. maybe it would also be possible to introduce unit symbols for the vsz and rss fields. they are getting really huge on systems with a long uptime (*cough* mem leaks) and kilobyte granularity isn't really that great when those fields are nearing 1GB. I thought about it, but the -h option is already taken. maybe making unit symbols the default behavior and introducing a -k flag, which toggles between the unit symbol mode and the traditional kilobyte mode? we could then add an envar $PS, so users can set PS=-k to restore the historic ps(1) behavior. a note to the BUGS section could then be added, similar to the note in top(1)'s BUGS section regarding the -I flag, which explains that ps(1)es semantics were changed, but can be restored via PS=-k. cheers. alex -- If you cut off my head, what would I say? Me and my head, or me and my body? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
* Alexander Best arun...@freebsd.org, 20110929 14:14: i think i wrote you about the two spaces between the TT and TIME field some time ago. you said that the TT entry can contain a postfix -. can you describe a situation, where this can occur? i've never seen the TT field contain an entry larger than 2 chars. Also, it would be better if we replaced the ?? string with -. When we print ??, it actually means: this process has no controlling terminal, not that we don't know which TTY it is. -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ pgpiCiwTte4MN.pgp Description: PGP signature
svn commit: r225899 - head/sys/sparc64/sparc64
Author: marius Date: Sat Oct 1 13:11:29 2011 New Revision: 225899 URL: http://svn.freebsd.org/changeset/base/225899 Log: Also allocate space for the PIL counters. Given that no machine actually uses IV_MAX interrupt vectors this wasn't a problem in practice though. Modified: head/sys/sparc64/sparc64/exception.S Modified: head/sys/sparc64/sparc64/exception.S == --- head/sys/sparc64/sparc64/exception.SSat Oct 1 12:35:09 2011 (r225898) +++ head/sys/sparc64/sparc64/exception.SSat Oct 1 13:11:29 2011 (r225899) @@ -373,15 +373,15 @@ END(rsf_fatal) _ALIGN_DATA .globl intrnames, sintrnames intrnames: - .space IV_MAX * (MAXCOMLEN + 1) + .space (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) sintrnames: - .quad IV_MAX * (MAXCOMLEN + 1) + .quad (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) .globl intrcnt, sintrcnt intrcnt: - .space IV_MAX * 8 + .space (IV_MAX + PIL_MAX) * 8 sintrcnt: - .quad IV_MAX * 8 + .quad (IV_MAX + PIL_MAX) * 8 .text ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225900 - head/sys/sparc64/sparc64
Author: marius Date: Sat Oct 1 13:16:01 2011 New Revision: 225900 URL: http://svn.freebsd.org/changeset/base/225900 Log: Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any purpose. Modified: head/sys/sparc64/sparc64/genassym.c Modified: head/sys/sparc64/sparc64/genassym.c == --- head/sys/sparc64/sparc64/genassym.c Sat Oct 1 13:11:29 2011 (r225899) +++ head/sys/sparc64/sparc64/genassym.c Sat Oct 1 13:16:01 2011 (r225900) @@ -43,9 +43,7 @@ __FBSDID($FreeBSD$); #include vm/vm_page.h #include vm/vm_map.h -#ifdef SUN4U #include machine/cache.h -#endif #include machine/pcb.h #include machine/setjmp.h #include machine/smp.h @@ -62,9 +60,7 @@ ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); ASSYM(_NCPUBITS, _NCPUBITS); -#ifdef SUN4U ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL); -#endif ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); @@ -82,21 +78,17 @@ ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M); #ifdef SMP ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); -#ifdef SUN4U ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); ASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick)); ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); #endif -#endif -#ifdef SUN4U ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size)); ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize)); ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size)); ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize)); -#endif ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); @@ -112,7 +104,6 @@ ASSYM(KTR_PARM5, offsetof(struct ktr_ent ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5])); ASSYM(TTE_SHIFT, TTE_SHIFT); -#ifdef SUN4U ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); @@ -132,7 +123,6 @@ ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MA ASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); -#endif ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); @@ -146,14 +136,12 @@ ASSYM(PC_IRFREE, offsetof(struct pcpu, p ASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt)); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); -#ifdef SUN4U ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap)); ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); -#endif ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next)); ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func)); @@ -161,7 +149,7 @@ ASSYM(IR_ARG, offsetof(struct intr_reque ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri)); ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec)); -#if defined(SUN4U) defined(SMP) +#ifdef SMP ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa)); ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask)); @@ -239,14 +227,12 @@ ASSYM(TF_FPRS, offsetof(struct trapframe ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr)); ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); -#ifdef SUN4U ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); -#endif ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225901 - head/sys/sparc64/sparc64
Author: marius Date: Sat Oct 1 13:33:14 2011 New Revision: 225901 URL: http://svn.freebsd.org/changeset/base/225901 Log: Remove obsolete macros. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c == --- head/sys/sparc64/sparc64/pmap.c Sat Oct 1 13:16:01 2011 (r225900) +++ head/sys/sparc64/sparc64/pmap.c Sat Oct 1 13:33:14 2011 (r225901) @@ -100,12 +100,6 @@ __FBSDID($FreeBSD$); #include machine/tsb.h #include machine/ver.h -#definePMAP_DEBUG - -#ifndefPMAP_SHPGPERPROC -#definePMAP_SHPGPERPROC200 -#endif - /* XXX */ #include opt_sched.h #ifndef SCHED_4BSD ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225902 - stable/9/share/man/man4
Author: gabor Date: Sat Oct 1 13:47:50 2011 New Revision: 225902 URL: http://svn.freebsd.org/changeset/base/225902 Log: MFC: r225775 - Move misplaced reference - Sort references - s/Since/Because/ Approved by: re (kib) Modified: stable/9/share/man/man4/smp.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/smp.4 == --- stable/9/share/man/man4/smp.4 Sat Oct 1 13:33:14 2011 (r225901) +++ stable/9/share/man/man4/smp.4 Sat Oct 1 13:47:50 2011 (r225902) @@ -120,25 +120,24 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hyperthreading_allowed tunable to zero. -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , .Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225903 - stable/8/share/man/man4
Author: gabor Date: Sat Oct 1 13:54:48 2011 New Revision: 225903 URL: http://svn.freebsd.org/changeset/base/225903 Log: MFC: r225775 - Move misplaced reference - Sort references - s/Since/Because/ Modified: stable/8/share/man/man4/smp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/smp.4 == --- stable/8/share/man/man4/smp.4 Sat Oct 1 13:47:50 2011 (r225902) +++ stable/8/share/man/man4/smp.4 Sat Oct 1 13:54:48 2011 (r225903) @@ -120,25 +120,25 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hlt_logical_cpus sysctl to one. Note that this operation is different from the mechanism used by the -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , +.Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225898 - stable/8/lib/libc/sys
On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Sat Oct 1 12:35:09 2011 New Revision: 225898 URL: http://svn.freebsd.org/changeset/base/225898 Log: MFC r225172: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Modified: stable/8/lib/libc/sys/sigwait.2 stable/8/lib/libc/sys/sigwaitinfo.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigwait.2 == --- stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait I thought the sys_sigwait rename was only on head/stable-9? -Ben Kaduk +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
On Sat Oct 1 11, Ed Schouten wrote: * Alexander Best arun...@freebsd.org, 20110929 14:14: i think i wrote you about the two spaces between the TT and TIME field some time ago. you said that the TT entry can contain a postfix -. can you describe a situation, where this can occur? i've never seen the TT field contain an entry larger than 2 chars. Also, it would be better if we replaced the ?? string with -. When we print ??, it actually means: this process has no controlling terminal, not that we don't know which TTY it is. good point. also i was thinking: if a process had a controlling terminal, but that terminal has been revoked, are users really interested to know what the name of that revoked terminal was? can't we just use -? is it important to know whether a process never had a controlling terminal, or had one at some point, but not anymore? also the ps(1) man page claims that a process running on console has a TT entry of con. i've never seen such an entry. is this still correct? and the last point i'd like to make: looking at 'ps alx' on freebsd 7.x makes it easy to distinguish between ttys and pts'es, because they are names ttyvX and ttypX. looking at the same output under HEAD, all pts terminal descriptors have moved to /dev/pts/X. so they will not show up as pX, but merely as X. can't we tell ps to prefix anything coming from /dev/pts with a p? in this output: 1001 1780 1778 1 16 0 15956 3136 pauseIs00:00,02 /usr/local/bin/zsh users are supposed to know that the 0 stands for /dev/pts/0. imho 1001 1780 1778 1 16 0 15956 3136 pauseIs p00:00,02 /usr/local/bin/zsh would be much better here (like under freebsd 7.x). cheers. alex -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225898 - stable/8/lib/libc/sys
On Sat, Oct 01, 2011 at 11:05:34AM -0400, Ben Kaduk wrote: On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov k...@freebsd.org wrote: Author: kib Date: Sat Oct 1 12:35:09 2011 New Revision: 225898 URL: http://svn.freebsd.org/changeset/base/225898 Log: MFC r225172: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Modified: stable/8/lib/libc/sys/sigwait.2 stable/8/lib/libc/sys/sigwaitinfo.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigwait.2 == --- stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait I thought the sys_sigwait rename was only on head/stable-9? I merged the wrapper sigwait(3) several commits earlier, see r225896. pgpGsqEep9v2K.pgp Description: PGP signature
svn commit: r225906 - head/contrib/sendmail/src
Author: ume Date: Sat Oct 1 18:20:10 2011 New Revision: 225906 URL: http://svn.freebsd.org/changeset/base/225906 Log: Shut up warnings with Cyrus SASL 2.1.25. Spotted by: ache Tested by:ache Modified: head/contrib/sendmail/src/main.c head/contrib/sendmail/src/sendmail.h head/contrib/sendmail/src/usersmtp.c Modified: head/contrib/sendmail/src/main.c == --- head/contrib/sendmail/src/main.cSat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/main.cSat Oct 1 18:20:10 2011 (r225906) @@ -109,8 +109,8 @@ GIDSET_TInitialGidSet[NGROUPS_MAX]; #if SASL static sasl_callback_t srvcallbacks[] = { - { SASL_CB_VERIFYFILE, safesaslfile, NULL}, - { SASL_CB_PROXY_POLICY, proxy_policy, NULL}, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)safesaslfile, NULL}, + { SASL_CB_PROXY_POLICY, (sasl_callback_ft)proxy_policy, NULL}, { SASL_CB_LIST_END, NULL, NULL} }; #endif /* SASL */ Modified: head/contrib/sendmail/src/sendmail.h == --- head/contrib/sendmail/src/sendmail.hSat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/sendmail.hSat Oct 1 18:20:10 2011 (r225906) @@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = @(#) # if SASL == 2 || SASL = 2 # include sasl/sasl.h +# include sasl/saslplug.h # include sasl/saslutil.h +# if SASL_VERSION_FULL 0x020119 +typedef int (*sasl_callback_ft)(void); +# endif # else /* SASL == 2 || SASL = 2 */ # include sasl.h # include saslutil.h +typedef int (*sasl_callback_ft)(void); # endif /* SASL == 2 || SASL = 2 */ # if defined(SASL_VERSION_MAJOR) defined(SASL_VERSION_MINOR) defined(SASL_VERSION_STEP) # define SASL_VERSION (SASL_VERSION_MAJOR * 1) + (SASL_VERSION_MINOR * 100) + SASL_VERSION_STEP Modified: head/contrib/sendmail/src/usersmtp.c == --- head/contrib/sendmail/src/usersmtp.cSat Oct 1 16:08:03 2011 (r225905) +++ head/contrib/sendmail/src/usersmtp.cSat Oct 1 18:20:10 2011 (r225906) @@ -524,15 +524,15 @@ static int attemptauth__P((MAILER *, MC static sasl_callback_t callbacks[] = { - { SASL_CB_GETREALM, saslgetrealm, NULL}, + { SASL_CB_GETREALM, (sasl_callback_ft)saslgetrealm, NULL}, #define CB_GETREALM_IDX0 - { SASL_CB_PASS, getsecret, NULL}, + { SASL_CB_PASS, (sasl_callback_ft)getsecret, NULL }, #define CB_PASS_IDX1 - { SASL_CB_USER, getsimple, NULL}, + { SASL_CB_USER, (sasl_callback_ft)getsimple, NULL }, #define CB_USER_IDX2 - { SASL_CB_AUTHNAME, getsimple, NULL}, + { SASL_CB_AUTHNAME, (sasl_callback_ft)getsimple, NULL }, #define CB_AUTHNAME_IDX3 - { SASL_CB_VERIFYFILE, safesaslfile, NULL}, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)safesaslfile, NULL}, #define CB_SAFESASL_IDX4 { SASL_CB_LIST_END, NULL, NULL} }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225907 - stable/9/contrib/sendmail/src
Author: ume Date: Sat Oct 1 19:58:35 2011 New Revision: 225907 URL: http://svn.freebsd.org/changeset/base/225907 Log: MFC r225906: Shut up warnings with Cyrus SASL 2.1.25. Approved by: re (kib) Modified: stable/9/contrib/sendmail/src/main.c stable/9/contrib/sendmail/src/sendmail.h stable/9/contrib/sendmail/src/usersmtp.c Directory Properties: stable/9/contrib/sendmail/ (props changed) Modified: stable/9/contrib/sendmail/src/main.c == --- stable/9/contrib/sendmail/src/main.cSat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/main.cSat Oct 1 19:58:35 2011 (r225907) @@ -109,8 +109,8 @@ GIDSET_TInitialGidSet[NGROUPS_MAX]; #if SASL static sasl_callback_t srvcallbacks[] = { - { SASL_CB_VERIFYFILE, safesaslfile, NULL}, - { SASL_CB_PROXY_POLICY, proxy_policy, NULL}, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)safesaslfile, NULL}, + { SASL_CB_PROXY_POLICY, (sasl_callback_ft)proxy_policy, NULL}, { SASL_CB_LIST_END, NULL, NULL} }; #endif /* SASL */ Modified: stable/9/contrib/sendmail/src/sendmail.h == --- stable/9/contrib/sendmail/src/sendmail.hSat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/sendmail.hSat Oct 1 19:58:35 2011 (r225907) @@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = @(#) # if SASL == 2 || SASL = 2 # include sasl/sasl.h +# include sasl/saslplug.h # include sasl/saslutil.h +# if SASL_VERSION_FULL 0x020119 +typedef int (*sasl_callback_ft)(void); +# endif # else /* SASL == 2 || SASL = 2 */ # include sasl.h # include saslutil.h +typedef int (*sasl_callback_ft)(void); # endif /* SASL == 2 || SASL = 2 */ # if defined(SASL_VERSION_MAJOR) defined(SASL_VERSION_MINOR) defined(SASL_VERSION_STEP) # define SASL_VERSION (SASL_VERSION_MAJOR * 1) + (SASL_VERSION_MINOR * 100) + SASL_VERSION_STEP Modified: stable/9/contrib/sendmail/src/usersmtp.c == --- stable/9/contrib/sendmail/src/usersmtp.cSat Oct 1 18:20:10 2011 (r225906) +++ stable/9/contrib/sendmail/src/usersmtp.cSat Oct 1 19:58:35 2011 (r225907) @@ -524,15 +524,15 @@ static int attemptauth__P((MAILER *, MC static sasl_callback_t callbacks[] = { - { SASL_CB_GETREALM, saslgetrealm, NULL}, + { SASL_CB_GETREALM, (sasl_callback_ft)saslgetrealm, NULL}, #define CB_GETREALM_IDX0 - { SASL_CB_PASS, getsecret, NULL}, + { SASL_CB_PASS, (sasl_callback_ft)getsecret, NULL }, #define CB_PASS_IDX1 - { SASL_CB_USER, getsimple, NULL}, + { SASL_CB_USER, (sasl_callback_ft)getsimple, NULL }, #define CB_USER_IDX2 - { SASL_CB_AUTHNAME, getsimple, NULL}, + { SASL_CB_AUTHNAME, (sasl_callback_ft)getsimple, NULL }, #define CB_AUTHNAME_IDX3 - { SASL_CB_VERIFYFILE, safesaslfile, NULL}, + { SASL_CB_VERIFYFILE, (sasl_callback_ft)safesaslfile, NULL}, #define CB_SAFESASL_IDX4 { SASL_CB_LIST_END, NULL, NULL} }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
On Sat, Oct 01, 2011 at 05:14:01PM +, Alexander Best wrote: On Sat Oct 1 11, Ed Schouten wrote: Also, it would be better if we replaced the ?? string with -. When we print ??, it actually means: this process has no controlling terminal, not that we don't know which TTY it is. good point. also i was thinking: if a process had a controlling terminal, but that terminal has been revoked, are users really interested to know what the name of that revoked terminal was? can't we just use -? is it important to know whether a process never had a controlling terminal, or had one at some point, but not anymore? I think this is potentially useful, because it shows that the process did not explicitly detach from the terminal (such as via setsid(2)). Particularly if the terminal is real (not a pseudo-terminal), its name may be useful in recognition. When asking for processes attached to a specific terminal with ps's t option, ps will also show processes that used to be attached (-), possibly allowing users to keep track of processes better. It appears that even if a terminal is revoked in this way, it still prevents reuse of the pts number. also the ps(1) man page claims that a process running on console has a TT entry of con. i've never seen such an entry. is this still correct? This may indeed be no longer the case, although it was never common to see con. With syscons in multi-user mode, you cannot log in on /dev/console, only on /dev/ttyv*. With syscons in single-user mode, ps(1) says v0 or ttyv0 but tty(1) says /dev/console. and the last point i'd like to make: looking at 'ps alx' on freebsd 7.x makes it easy to distinguish between ttys and pts'es, because they are names ttyvX and ttypX. looking at the same output under HEAD, all pts terminal descriptors have moved to /dev/pts/X. so they will not show up as pX, but merely as X. can't we tell ps to prefix anything coming from /dev/pts with a p? in this output: 1001 1780 1778 1 16 0 15956 3136 pauseIs00:00,02 /usr/local/bin/zsh users are supposed to know that the 0 stands for /dev/pts/0. imho 1001 1780 1778 1 16 0 15956 3136 pauseIs p00:00,02 /usr/local/bin/zsh would be much better here (like under freebsd 7.x). I rather like the new output. Pseudo-terminals are by far the most common kind of terminal and there may be many of them, so it makes sense not to have a prefix. The t option in ps also accepts these short names, like 'ps lt0'. All other terminal names start with a letter. In FreeBSD 7, the first 256 pseudo-terminals are named /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a few more pseudo-terminals but even then two characters suffice. The TTY keyword shows the full pathname relative to /dev. -- Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
On Sat Oct 1 11, Jilles Tjoelker wrote: On Sat, Oct 01, 2011 at 05:14:01PM +, Alexander Best wrote: On Sat Oct 1 11, Ed Schouten wrote: Also, it would be better if we replaced the ?? string with -. When we print ??, it actually means: this process has no controlling terminal, not that we don't know which TTY it is. good point. also i was thinking: if a process had a controlling terminal, but that terminal has been revoked, are users really interested to know what the name of that revoked terminal was? can't we just use -? is it important to know whether a process never had a controlling terminal, or had one at some point, but not anymore? I think this is potentially useful, because it shows that the process did not explicitly detach from the terminal (such as via setsid(2)). Particularly if the terminal is real (not a pseudo-terminal), its name may be useful in recognition. When asking for processes attached to a specific terminal with ps's t option, ps will also show processes that used to be attached (-), possibly allowing users to keep track of processes better. It appears that even if a terminal is revoked in this way, it still prevents reuse of the pts number. that's a very good explanation. :) so yeah...let's keep it the way it is. also the ps(1) man page claims that a process running on console has a TT entry of con. i've never seen such an entry. is this still correct? This may indeed be no longer the case, although it was never common to see con. With syscons in multi-user mode, you cannot log in on /dev/console, only on /dev/ttyv*. With syscons in single-user mode, ps(1) says v0 or ttyv0 but tty(1) says /dev/console. and the last point i'd like to make: looking at 'ps alx' on freebsd 7.x makes it easy to distinguish between ttys and pts'es, because they are names ttyvX and ttypX. looking at the same output under HEAD, all pts terminal descriptors have moved to /dev/pts/X. so they will not show up as pX, but merely as X. can't we tell ps to prefix anything coming from /dev/pts with a p? in this output: 1001 1780 1778 1 16 0 15956 3136 pauseIs00:00,02 /usr/local/bin/zsh users are supposed to know that the 0 stands for /dev/pts/0. imho 1001 1780 1778 1 16 0 15956 3136 pauseIs p00:00,02 /usr/local/bin/zsh would be much better here (like under freebsd 7.x). I rather like the new output. Pseudo-terminals are by far the most common kind of terminal and there may be many of them, so it makes sense not to have a prefix. The t option in ps also accepts these short names, like 'ps lt0'. All other terminal names start with a letter. In FreeBSD 7, the first 256 pseudo-terminals are named /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a few more pseudo-terminals but even then two characters suffice. The TTY keyword shows the full pathname relative to /dev. i think we should adjust the following paragraph tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for the console, ``con''. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). to something like this then tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for pseudo-terminals, the entry in /dev/pts. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). The full pathname of the controlling terminal is available via the tty keyword. cheers. alex ps: i am also wondering, why -o and -O aren't mutually exclusive. this would make more sense to me. -- Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225908 - head/bin/ps
Author: gjb (doc committer) Date: Sat Oct 1 20:56:58 2011 New Revision: 225908 URL: http://svn.freebsd.org/changeset/base/225908 Log: Reorder default ps(1) output according to reality. Submitted by: arundel (via docs@) MFC after:1 week Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 == --- head/bin/ps/ps.1Sat Oct 1 19:58:35 2011(r225907) +++ head/bin/ps/ps.1Sat Oct 1 20:56:58 2011(r225908) @@ -90,8 +90,8 @@ and .Fl o options). The default output format includes, for each process, the process' ID, -controlling terminal, CPU time (including both user and system time), -state, and associated command. +controlling terminal, state, CPU time (including both user and system time) +and associated command. .Pp The process file system (see .Xr procfs 5 ) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225868 - head/bin/ps
On Sat Oct 1 11, Alexander Best wrote: On Sat Oct 1 11, Jilles Tjoelker wrote: On Sat, Oct 01, 2011 at 05:14:01PM +, Alexander Best wrote: On Sat Oct 1 11, Ed Schouten wrote: Also, it would be better if we replaced the ?? string with -. When we print ??, it actually means: this process has no controlling terminal, not that we don't know which TTY it is. good point. also i was thinking: if a process had a controlling terminal, but that terminal has been revoked, are users really interested to know what the name of that revoked terminal was? can't we just use -? is it important to know whether a process never had a controlling terminal, or had one at some point, but not anymore? I think this is potentially useful, because it shows that the process did not explicitly detach from the terminal (such as via setsid(2)). Particularly if the terminal is real (not a pseudo-terminal), its name may be useful in recognition. When asking for processes attached to a specific terminal with ps's t option, ps will also show processes that used to be attached (-), possibly allowing users to keep track of processes better. It appears that even if a terminal is revoked in this way, it still prevents reuse of the pts number. that's a very good explanation. :) so yeah...let's keep it the way it is. also the ps(1) man page claims that a process running on console has a TT entry of con. i've never seen such an entry. is this still correct? This may indeed be no longer the case, although it was never common to see con. With syscons in multi-user mode, you cannot log in on /dev/console, only on /dev/ttyv*. With syscons in single-user mode, ps(1) says v0 or ttyv0 but tty(1) says /dev/console. and the last point i'd like to make: looking at 'ps alx' on freebsd 7.x makes it easy to distinguish between ttys and pts'es, because they are names ttyvX and ttypX. looking at the same output under HEAD, all pts terminal descriptors have moved to /dev/pts/X. so they will not show up as pX, but merely as X. can't we tell ps to prefix anything coming from /dev/pts with a p? in this output: 1001 1780 1778 1 16 0 15956 3136 pauseIs00:00,02 /usr/local/bin/zsh users are supposed to know that the 0 stands for /dev/pts/0. imho 1001 1780 1778 1 16 0 15956 3136 pauseIs p00:00,02 /usr/local/bin/zsh would be much better here (like under freebsd 7.x). I rather like the new output. Pseudo-terminals are by far the most common kind of terminal and there may be many of them, so it makes sense not to have a prefix. The t option in ps also accepts these short names, like 'ps lt0'. All other terminal names start with a letter. In FreeBSD 7, the first 256 pseudo-terminals are named /dev/tty[pqrsPQRS][0-9a-v]. A few more letters can be used to provide a few more pseudo-terminals but even then two characters suffice. The TTY keyword shows the full pathname relative to /dev. i think we should adjust the following paragraph tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for the console, ``con''. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). to something like this then tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters follow- ing /dev/tty, or, for pseudo-terminals, the entry in /dev/pts. This is followed by a `-' if the process can no longer reach that controlling terminal (i.e., it has been revoked). The full pathname of the controlling terminal is available via the tty keyword. i'd like to propose the following patch. any objections? cheers. alex cheers. alex ps: i am also wondering, why -o and -O aren't mutually exclusive. this would make more sense to me. -- Jilles Tjoelker diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 8c27186..44a8d0e 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -29,7 +29,7 @@ .\ @(#)ps.1 8.3 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 1, 2011 +.Dd October 1, 2011 .Dt PS 1 .Os .Sh NAME @@ -427,12 +427,15 @@ The process is being traced or debugged. An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters following .Pa /dev/tty , -or, for the console, -.Dq Li con . +or, for psuedo-terminals, the corresponding entry in +.Pa /dev/pts . This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +The full pathname of the controlling
Re: svn commit: r225897 - head/lib/libc/gen
* Garrett Cooper yaneg...@gmail.com, 20111001 21:43: Why not use strlcpy, etc with dlen? Well, I could, but it wouldn't change anything. In both cases, the size of the buffer exceeds the size of _PATH_TTY. -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ pgpjknhoTRcyW.pgp Description: PGP signature
Re: svn commit: r225868 - head/bin/ps
* Alexander Best arun...@freebsd.org, 20111001 23:10: i'd like to propose the following patch. any objections? Looks good! Thanks, -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ pgpnqHcKtE2IW.pgp Description: PGP signature
Re: svn commit: r225868 - head/bin/ps
On Sun Oct 2 11, Ed Schouten wrote: * Alexander Best arun...@freebsd.org, 20111001 23:10: i'd like to propose the following patch. any objections? Looks good! here's an updated patch, which fixes another few issues imo: http://lists.freebsd.org/pipermail/freebsd-doc/2011-October/018910.html cheers. alex Thanks, -- Ed Schouten e...@80386.nl WWW: http://80386.nl/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225912 - head/bin/ps
Author: gjb (doc committer) Date: Sat Oct 1 23:47:37 2011 New Revision: 225912 URL: http://svn.freebsd.org/changeset/base/225912 Log: Tweaks to ps(1): - there's no reason the semantics of the -x flag are being explained in the -a flag description - be more precise regarding the relation between the -a flag and the security.bsd.see_other_uids sysctl - describe the format of the -t flag's argument - 'con' no longer is a possible entry in the 'TT' column - explain that the 'TT' column refers to pseudo-terminals via mere numbers - add a hint in the 'tt' keyword description that a keyword 'tty' exists, which will give the full terminal pathname Submitted by: arundel (via docs@) (original) MFC after:1 week With-MFC: 225908 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 == --- head/bin/ps/ps.1Sat Oct 1 22:19:22 2011(r225911) +++ head/bin/ps/ps.1Sat Oct 1 23:47:37 2011(r225912) @@ -29,7 +29,7 @@ .\ @(#)ps.1 8.3 (Berkeley) 4/18/94 .\ $FreeBSD$ .\ -.Dd July 1, 2011 +.Dd October 1, 2011 .Dt PS 1 .Os .Sh NAME @@ -54,6 +54,11 @@ utility displays a header line, followed by lines containing information about all of your processes that have controlling terminals. +If the +.Fl x +options is specified, +.Nm +will also display processes that do not have controlling terminals. .Pp A different set of processes can be selected for display by using any combination of the @@ -103,13 +108,9 @@ The options are as follows: .Bl -tag -width indent .It Fl a Display information about other users' processes as well as your own. -This will skip any processes which do not have a controlling terminal, -unless the -.Fl x -option is also specified. -This can be disabled by setting the +If the .Va security.bsd.see_other_uids -sysctl to zero. +sysctl is set to zero, this option is honored only if the UID of the user is 0. .It Fl c Change the .Dq command @@ -216,6 +217,9 @@ with the standard input. .It Fl t Display information about processes attached to the specified terminal devices. +Full pathnames, as well as abbreviations (see explanation of the +.Cm tt +keyword) can be specified. .It Fl U Display the processes belonging to the specified usernames. .It Fl u @@ -427,12 +431,15 @@ The process is being traced or debugged. An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters following .Pa /dev/tty , -or, for the console, -.Dq Li con . +or, for psuedo-terminals, the corresponding entry in +.Pa /dev/pts . This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +The full pathname of the controlling terminal is available via the +.Cm tty +keyword. .It Cm wchan The event (an address in the system) on which a process waits. When printed numerically, the initial part of the address is ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r225913 - head/sys/net80211
Author: adrian Date: Sun Oct 2 02:42:31 2011 New Revision: 225913 URL: http://svn.freebsd.org/changeset/base/225913 Log: Fix a panic in the wifi stack when a software beacon miss occurs in the wrong state. The ieee80211_swbmiss() callout is not called with the ic lock held, so it's quite possible the scheduler will run the callout during a state change. This patch: * changes the swbmiss callout to be locked by the ic lock * enforces the ic lock being held across the beacon vap functions by grabbing it inside beacon_miss() and beacon_swmiss(). This ensures that the ic lock is held (and thus the VAP state stays constant) during beacon miss and software miss processing. Since the callout is removed whilst the ic lock is held, it also ensures that the ic lock can't be called during a state change or exhibit any race conditions seen above. Both Edgar and Joel report that this patch fixes the crash and doesn't introduce new issues. Reported by: Edgar Martinez emarti...@kbcnetworks.com Reported by: Joel Dahl j...@vnode.se Reported by: emaste Modified: head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_proto.c == --- head/sys/net80211/ieee80211_proto.c Sat Oct 1 23:47:37 2011 (r225912) +++ head/sys/net80211/ieee80211_proto.c Sun Oct 2 02:42:31 2011 (r225913) @@ -193,7 +193,7 @@ ieee80211_proto_vattach(struct ieee80211 vap-iv_rtsthreshold = IEEE80211_RTS_DEFAULT; vap-iv_fragthreshold = IEEE80211_FRAG_DEFAULT; vap-iv_bmiss_max = IEEE80211_BMISS_MAX; - callout_init(vap-iv_swbmiss, CALLOUT_MPSAFE); + callout_init_mtx(vap-iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); callout_init(vap-iv_mgtsend, CALLOUT_MPSAFE); TASK_INIT(vap-iv_nstate_task, 0, ieee80211_newstate_cb, vap); TASK_INIT(vap-iv_swbmiss_task, 0, beacon_swmiss, vap); @@ -1403,7 +1403,7 @@ beacon_miss(void *arg, int npending) struct ieee80211com *ic = arg; struct ieee80211vap *vap; - /* XXX locking */ + IEEE80211_LOCK(ic); TAILQ_FOREACH(vap, ic-ic_vaps, iv_next) { /* * We only pass events through for sta vap's in RUN state; @@ -1415,18 +1415,21 @@ beacon_miss(void *arg, int npending) vap-iv_bmiss != NULL) vap-iv_bmiss(vap); } + IEEE80211_UNLOCK(ic); } static void beacon_swmiss(void *arg, int npending) { struct ieee80211vap *vap = arg; + struct ieee80211com *ic = vap-iv_ic; - if (vap-iv_state != IEEE80211_S_RUN) - return; - - /* XXX Call multiple times if npending zero? */ - vap-iv_bmiss(vap); + IEEE80211_LOCK(ic); + if (vap-iv_state == IEEE80211_S_RUN) { + /* XXX Call multiple times if npending zero? */ + vap-iv_bmiss(vap); + } + IEEE80211_UNLOCK(ic); } /* @@ -1440,6 +1443,8 @@ ieee80211_swbmiss(void *arg) struct ieee80211vap *vap = arg; struct ieee80211com *ic = vap-iv_ic; + IEEE80211_LOCK_ASSERT(ic); + /* XXX sleep state? */ KASSERT(vap-iv_state == IEEE80211_S_RUN, (wrong state %d, vap-iv_state)); Modified: head/sys/net80211/ieee80211_sta.c == --- head/sys/net80211/ieee80211_sta.c Sat Oct 1 23:47:37 2011 (r225912) +++ head/sys/net80211/ieee80211_sta.c Sun Oct 2 02:42:31 2011 (r225913) @@ -109,6 +109,8 @@ sta_beacon_miss(struct ieee80211vap *vap { struct ieee80211com *ic = vap-iv_ic; + IEEE80211_LOCK_ASSERT(ic); + KASSERT((ic-ic_flags IEEE80211_F_SCAN) == 0, (scanning)); KASSERT(vap-iv_state = IEEE80211_S_RUN, (wrong state %s, ieee80211_state_name[vap-iv_state])); Modified: head/sys/net80211/ieee80211_tdma.c == --- head/sys/net80211/ieee80211_tdma.c Sat Oct 1 23:47:37 2011 (r225912) +++ head/sys/net80211/ieee80211_tdma.c Sun Oct 2 02:42:31 2011 (r225913) @@ -285,6 +285,9 @@ static void tdma_beacon_miss(struct ieee80211vap *vap) { struct ieee80211_tdma_state *ts = vap-iv_tdma; + struct ieee80211com *ic = vap-iv_ic; + + IEEE80211_LOCK_ASSERT(ic); KASSERT((vap-iv_ic-ic_flags IEEE80211_F_SCAN) == 0, (scanning)); KASSERT(vap-iv_state == IEEE80211_S_RUN, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org