From owner-cvs-lib Sun May 18 00:29:58 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA15559 for cvs-lib-outgoing; Sun, 18 May 1997 00:29:58 -0700 (PDT) Received: from nagual.pp.ru (ache.relcom.ru [194.58.229.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA15532; Sun, 18 May 1997 00:29:24 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.8.5/8.8.5) id LAA00750; Sun, 18 May 1997 11:28:09 +0400 (MSD) Date: Sun, 18 May 1997 11:28:07 +0400 (MSD) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Peter Wemm cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-Reply-To: <199705180620.OAA04512@spinner.DIALix.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 18 May 1997, Peter Wemm wrote: > The SVR4.0 man page for sleep(3c) says: > ... > The routine is implemented by setting an alarm signal and pausing until > it (or some other signal) occurs. The previous state of the alarm signal > is saved and restored. The calling program may have set up an alarm > signal before calling sleep. [..guff about adjusting alarm(2)..] > ... > > ie: traditional sleep(3) behavior is that any signal interrupts the sleep. Hmm. It looks like SYSVism. SunOS man page for sleep(3b) says: SIGALRM should _n_o_t be blocked or ignored during a call to sleep(). Only a prior call to alarm(2) should generate SIGALRM for the calling process during a call to sleep(). A signal-catching function should _n_o_t interrupt a call to sleep() to call siglongjmp(3C) or longjmp(3C) to restore an environment saved prior to the sleep() call. and old implementation don't pay attention on catched signals too. BTW, I am not shure we should keep it. In any case, _ignored_ signals should not interrupt sleep. There are some other maybe useful notes from the same place: sleep() is implemented by setting an interval timer and pausing until it expires. The previous state of this timer is saved and restored. If the sleep time exceeds the time to the expiration of the previous value of the timer, the process sleeps only until the timer would have expired, and the signal which occurs with the expiration of the timer is sent one second later. I see GNU libc sleep.c does some additional efforts to handle alarms which are set before sleep is started: /* SIGALRM signal handler for `sleep'. This does nothing but return, but SIG_IGN isn't supposed to break `pause'. */ static void sleep_handler (sig) int sig; { return; } /* Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (zero if it slept the full time). If a signal handler does a `longjmp' or modifies the handling of the SIGALRM signal while inside `sleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. */ unsigned int sleep (seconds) unsigned int seconds; { unsigned int remaining, slept; time_t before, after; sigset_t set, oset; struct sigaction act, oact; int save = errno; if (seconds == 0) return 0; /* Block SIGALRM signals while frobbing the handler. */ if (sigemptyset (&set) < 0 || sigaddset (&set, SIGALRM) < 0 || sigprocmask (SIG_BLOCK, &set, &oset)) return seconds; act.sa_handler = sleep_handler; act.sa_flags = 0; act.sa_mask = oset; /* execute handler with original mask */ if (sigaction (SIGALRM, &act, &oact) < 0) return seconds; before = time ((time_t *) NULL); remaining = alarm (seconds); if (remaining > 0 && remaining < seconds) { /* The user's alarm will expire before our own would. Restore the user's signal action state and let his alarm happen. */ (void) sigaction (SIGALRM, &oact, (struct sigaction *) NULL); alarm (remaining); /* Restore sooner alarm. */ sigsuspend (&oset); /* Wait for it to go off. */ after = time ((time_t *) NULL); } else { /* Atomically restore the old signal mask (which had better not block SIGALRM), and wait for a signal to arrive. */ sigsuspend (&oset); after = time ((time_t *) NULL); /* Restore the old signal action state. */ (void) sigaction (SIGALRM, &oact, (struct sigaction *) NULL); } /* Notice how long we actually slept. */ slept = after - before; /* Restore the user's alarm if we have not already past it. If we have, be sure to turn off the alarm in case a signal other than SIGALRM was what woke us up. */ (void) alarm (remaining > slept ? remaining - slept : 0); /* Restore the original signal mask. */ (void) sigprocmask (SIG_SETMASK, &oset, (sigset_t *) NULL); /* Restore the `errno' value we started with. Some of the calls we made might have failed, but we didn't care. */ __set_errno (save); return slept > seconds ? 0 : seconds - slept; } -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/ From owner-cvs-lib Sun May 18 00:40:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA16201 for cvs-lib-outgoing; Sun, 18 May 1997 00:40:33 -0700 (PDT) Received: from nagual.pp.ru (ache.relcom.ru [194.58.229.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA16186; Sun, 18 May 1997 00:40:08 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.8.5/8.8.5) id LAA00830; Sun, 18 May 1997 11:38:49 +0400 (MSD) Date: Sun, 18 May 1997 11:38:46 +0400 (MSD) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Peter Wemm cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-Reply-To: <199705180652.OAA04790@spinner.DIALix.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 18 May 1997, Peter Wemm wrote: > Apache doesn't fail with non-BSD systems that sleep doesn't restart after > non-ALRM signals, eg: sunos, solaris, hpux, digital unix, etc.. This may be caused by another SYSVism, i.e. double features negate each other. > Apache doesn't use signals internally other than SIGALRM anyway. (well, > the user can send SIGHUP and SIGTERM, but that's an exception, not the > normal case during operation) It forks a lot, so got SIGCHLD at least. > eg: from Digital Unix: > If the sleep() function returns because the requested time has elapsed, it > returns 0 (zero). If the sleep() function returns because it caught a > signal, the function returns the number of seconds remaining in the suspen- > sion. Maybe we can keep SYSV behaviour too... Lets fix 'killed by SIGALRM' bug first, then I'll see, how it affects Apache. > I noticed that apache is having a lot of trouble with fin_wait_2 when using > keepalive connections to unix netscape3 and doesn't run very well with -X > when large files are transferred (more than socket buffer I suspect). > I found a mention of this in the docs where it explicitly listed Netscape > on FreeBSD as one known rogues that don't do client keepalive properly. It is not a case here, I test it with Lynx alone and Lynx can't use keepalive. -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/ From owner-cvs-lib Sun May 18 00:52:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA16948 for cvs-lib-outgoing; Sun, 18 May 1997 00:52:50 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA16920; Sun, 18 May 1997 00:52:29 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id PAA05367; Sun, 18 May 1997 15:51:50 +0800 (WST) Message-Id: <199705180751.PAA05367@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-reply-to: Your message of "Sun, 18 May 1997 11:28:07 +0400." Date: Sun, 18 May 1997 15:51:49 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= wrote: > On Sun, 18 May 1997, Peter Wemm wrote: > > > The SVR4.0 man page for sleep(3c) says: > > ... > > The routine is implemented by setting an alarm signal and pausing unt il > > it (or some other signal) occurs. The previous state of the alarm si gnal > > is saved and restored. The calling program may have set up an alarm > > signal before calling sleep. [..guff about adjusting alarm(2)..] > > ... > > > > ie: traditional sleep(3) behavior is that any signal interrupts the sleep. > > Hmm. It looks like SYSVism. No.. > SunOS man page for sleep(3b) says: > > SIGALRM should _not_ be blocked or ignored during a call to > sleep(). Only a prior call to alarm(2) should generate > SIGALRM for the calling process during a call to sleep(). A > signal-catching function should _not_ interrupt a call to > sleep() to call siglongjmp(3C) or longjmp(3C) to restore an > environment saved prior to the sleep() call. This is just saying "don't block SIGALRM before calling sleep", and "don't longjump out of a signal handler while a sleep is active". it doesn't say that signals wont make the sleep return early. > and old implementation don't pay attention on catched signals too. > BTW, I am not shure we should keep it. That's what I've been suggesting too, but we shouldn't break ourselves when running a program that expects traditional behavior. :-) FWIW, I can't find any other sleep() implementation that always returns zero like ours has done up to now. > In any case, _ignored_ signals should not interrupt sleep. Hmm.. Are we doing this?? My current version of sleep(3) does this: peter@spinner[3:40pm]~src/bin/sleep-275# sleep 1000 & [1] 5301 peter@spinner[3:40pm]~src/bin/sleep-276# kill -URG 5301 peter@spinner[3:40pm]~src/bin/sleep-277# kill -ALRM 5301 [1] Done sleep 1000 peter@spinner[3:41pm]~src/bin/sleep-278# sleep 1000 & [1] 5302 peter@spinner[3:41pm]~src/bin/sleep-279# kill -TERM 5302 [1] Terminated sleep 1000 peter@spinner[3:41pm]~src/bin/sleep-280# (URG is ignored by default, and isn't interrupting sleep(3)) > There are some other maybe useful notes from the same place: > > sleep() is implemented by setting an interval timer and > pausing until it expires. The previous state of this timer > is saved and restored. If the sleep time exceeds the time > to the expiration of the previous value of the timer, the > process sleeps only until the timer would have expired, and > the signal which occurs with the expiration of the timer is > sent one second later. Yes, if a SIGALRM arrives during sleep() from an outside source, we should end the sleep rather than exit if the alarm signal isn't trapped. However, I don't see how to do this without races while using nanosleep(). It could be possible to get a SIGALRM right after installing the handler but before the nanosleep() starts. > I see GNU libc sleep.c does some additional efforts to handle alarms > which are set before sleep is started: > > /* SIGALRM signal handler for `sleep'. This does nothing but return, > but SIG_IGN isn't supposed to break `pause'. */ > static void > sleep_handler (sig) > int sig; > { > return; > } My current version basically does this too.. > /* Make the process sleep for SECONDS seconds, or until a signal arrives > and is not ignored. The function returns the number of seconds less > than SECONDS which it actually slept (zero if it slept the full time). > If a signal handler does a `longjmp' or modifies the handling of the > SIGALRM signal while inside `sleep' call, the handling of the SIGALRM > signal afterwards is undefined. There is no return value to indicate > error, but if `sleep' returns SECONDS, it probably didn't work. */ > unsigned int > sleep (seconds) > unsigned int seconds; > { > unsigned int remaining, slept; > time_t before, after; > sigset_t set, oset; > struct sigaction act, oact; > int save = errno; > > if (seconds == 0) > return 0; > > /* Block SIGALRM signals while frobbing the handler. */ > if (sigemptyset (&set) < 0 || > sigaddset (&set, SIGALRM) < 0 || > sigprocmask (SIG_BLOCK, &set, &oset)) > return seconds; > > act.sa_handler = sleep_handler; > act.sa_flags = 0; > act.sa_mask = oset; /* execute handler with original mask */ > if (sigaction (SIGALRM, &act, &oact) < 0) > return seconds; > > before = time ((time_t *) NULL); > remaining = alarm (seconds); > > if (remaining > 0 && remaining < seconds) > { > /* The user's alarm will expire before our own would. > Restore the user's signal action state and let his alarm happen. */ > (void) sigaction (SIGALRM, &oact, (struct sigaction *) NULL); > alarm (remaining); /* Restore sooner alarm. */ > sigsuspend (&oset); /* Wait for it to go off. */ > after = time ((time_t *) NULL); > } > else > { > /* Atomically restore the old signal mask > (which had better not block SIGALRM), > and wait for a signal to arrive. */ > sigsuspend (&oset); > > after = time ((time_t *) NULL); > > /* Restore the old signal action state. */ > (void) sigaction (SIGALRM, &oact, (struct sigaction *) NULL); > } > > /* Notice how long we actually slept. */ > slept = after - before; > > /* Restore the user's alarm if we have not already past it. > If we have, be sure to turn off the alarm in case a signal > other than SIGALRM was what woke us up. */ > (void) alarm (remaining > slept ? remaining - slept : 0); > > /* Restore the original signal mask. */ > (void) sigprocmask (SIG_SETMASK, &oset, (sigset_t *) NULL); > > /* Restore the `errno' value we started with. > Some of the calls we made might have failed, but we didn't care. */ > __set_errno (save); > > return slept > seconds ? 0 : seconds - slept; > } My current version is compatable with this, *except* that it doesn't seem convenient to mask SIGALRM while preparing to call nanosleep(). Doing a longjump out of the signal handler seems like overkill... I'm using this at present: #define setvec(vec, a) \ vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0 static void sleephandler() { return; /* interrupt nanosleep() */ } unsigned int sleep(seconds) unsigned int seconds; { struct timespec time_to_sleep; struct timespec time_remaining; struct sigvec vec, ovec; if (seconds != 0) { time_to_sleep.tv_sec = seconds; time_to_sleep.tv_nsec = 0; setvec(vec, sleephandler); (void) sigvec(SIGALRM, &vec, &ovec); nanosleep(&time_to_sleep, &time_remaining); (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); seconds = time_remaining.tv_sec; if (time_remaining.tv_nsec > 0) seconds++; /* round up */ } return (seconds); } > -- > Andrey A. Chernov > > http://www.nagual.pp.ru/~ache/ Cheers, -Peter From owner-cvs-lib Sun May 18 01:41:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA20502 for cvs-lib-outgoing; Sun, 18 May 1997 01:41:52 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA20444; Sun, 18 May 1997 01:41:08 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id SAA30604; Sun, 18 May 1997 18:38:59 +1000 Date: Sun, 18 May 1997 18:38:59 +1000 From: Bruce Evans Message-Id: <199705180838.SAA30604@godzilla.zeta.org.au> To: bde@zeta.org.au, peter@spinner.dialix.com Subject: Re: cvs commit: src/lib/libc/gen usleep.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-lib@FreeBSD.org, peter@FreeBSD.org Sender: owner-cvs-lib@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >> Where do those semantics appear? The old behaviour was to return >> early. The man page said otherwise, but so does the BSD4.4-Lite man > ^^^^^ >Are you sure of that? Both sleep() and usleep() do a 'while >(!ringring) sigpause(...)'.. To my reading, it won't return early ever... I haven't read the sources lately, but the example alarm(1); sleep(2); has been been returning early (and not returning the remaining time so it has been on my bug list) for years. Erm, ringring is set after the first SIGALRM is caught, so sleep() and usleep() return after the first alarm. The loop prevents returning after other signals are caught. Catching alarms prevents external SIGALRMs from killing the process. POSIX.1 seems to specify returning early from sleep() whenever a signal (of any type) is caught. Bruce From owner-cvs-lib Sun May 18 02:05:29 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA21324 for cvs-lib-outgoing; Sun, 18 May 1997 02:05:29 -0700 (PDT) Received: from nagual.pp.ru (ache.relcom.ru [194.58.229.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA21308; Sun, 18 May 1997 02:05:06 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.8.5/8.8.5) id NAA01221; Sun, 18 May 1997 13:04:51 +0400 (MSD) Date: Sun, 18 May 1997 13:04:48 +0400 (MSD) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Peter Wemm cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-Reply-To: <199705180751.PAA05367@spinner.DIALix.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 18 May 1997, Peter Wemm wrote: > My current version is compatable with this, *except* that it doesn't seem > convenient to mask SIGALRM while preparing to call nanosleep(). Doing a > longjump out of the signal handler seems like overkill... > > I'm using this at present: Good news, this variant works with Apache, lets commit it. BTW, I see race condition when SIGALRM comes inside sleep() code before nanosleep() call. It can be blocked before, but how to unblock it inside nanosleep()? -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/ From owner-cvs-lib Sun May 18 02:07:51 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA21397 for cvs-lib-outgoing; Sun, 18 May 1997 02:07:51 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA21388; Sun, 18 May 1997 02:07:35 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id TAA31228; Sun, 18 May 1997 19:01:25 +1000 Date: Sun, 18 May 1997 19:01:25 +1000 From: Bruce Evans Message-Id: <199705180901.TAA31228@godzilla.zeta.org.au> To: bde@zeta.org.au, peter@spinner.dialix.com Subject: Re: cvs commit: src/lib/libc/gen sleep.c Cc: ache@nagual.pp.ru, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Hmm. Perhaps install a temporary dummy SIGALRM handler in the sleep.c stub >so that it doesn't die if there isn't one. The old setitimer way doesn't >mess with alarm(2), using nanosleep() wont change that. Why would a program generate alarms without installing an alarm handler? Perhaps buggy programs do install one but expect it not to be invoked during sleep(). Bruce From owner-cvs-lib Sun May 18 02:12:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA21586 for cvs-lib-outgoing; Sun, 18 May 1997 02:12:07 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA21556; Sun, 18 May 1997 02:11:44 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id RAA06230; Sun, 18 May 1997 17:10:46 +0800 (WST) Message-Id: <199705180910.RAA06230@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: Bruce Evans cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-lib@FreeBSD.org, peter@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen usleep.c In-reply-to: Your message of "Sun, 18 May 1997 18:38:59 +1000." <199705180838.SAA30604@godzilla.zeta.org.au> Date: Sun, 18 May 1997 17:10:45 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Bruce Evans wrote: > >> Where do those semantics appear? The old behaviour was to return > >> early. The man page said otherwise, but so does the BSD4.4-Lite man > > ^^^^^ > >Are you sure of that? Both sleep() and usleep() do a 'while > >(!ringring) sigpause(...)'.. To my reading, it won't return early ever... .. I meant to specify that it wouldn't return early for signals other than SIGALRM. :-) > I haven't read the sources lately, but the example > > alarm(1); > sleep(2); > > has been been returning early (and not returning the remaining time so it > has been on my bug list) for years. Yes. This should be fixed now.. The version that I posted a short while ago (with all #ifdef's stripped so it was a reasonable size for the mail) should handle this assumed case pretty much correctly. > Erm, ringring is set after the first SIGALRM is caught, so sleep() and > usleep() return after the first alarm. The loop prevents returning after > other signals are caught. Catching alarms prevents external SIGALRMs > from killing the process. I added a 'do nothing' signal handler for SIGALRM for this purpose. It's not unreasonable to expect that there are quite a few programs that have taken advantage of the conventional implementation. > POSIX.1 seems to specify returning early from sleep() whenever a signal > (of any type) is caught. Yes, we violated this quite badly.. :-( Where did the sleep(3) code come from? It looks like it's from Lite-1 and that it's busted there. Was it in the net-2 code as well? > Bruce Cheers, -Peter From owner-cvs-lib Sun May 18 02:12:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA21604 for cvs-lib-outgoing; Sun, 18 May 1997 02:12:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA21559; Sun, 18 May 1997 02:11:53 -0700 (PDT) From: David Nugent Received: (from davidn@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id CAA06169; Sun, 18 May 1997 02:11:48 -0700 (PDT) Date: Sun, 18 May 1997 02:11:48 -0700 (PDT) Message-Id: <199705180911.CAA06169@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libutil login_cap.3 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk davidn 1997/05/18 02:11:48 PDT Modified files: (Branch: RELENG_2_2) lib/libutil login_cap.3 Log: Update login_cap api documentation (addition of login_getpwclass() and change for login_getclass()). Revision Changes Path 1.6.2.1 +23 -9 src/lib/libutil/login_cap.3 From owner-cvs-lib Sun May 18 02:14:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA21718 for cvs-lib-outgoing; Sun, 18 May 1997 02:14:33 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA21694; Sun, 18 May 1997 02:14:17 -0700 (PDT) From: David Nugent Received: (from davidn@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id CAA06205; Sun, 18 May 1997 02:14:12 -0700 (PDT) Date: Sun, 18 May 1997 02:14:12 -0700 (PDT) Message-Id: <199705180914.CAA06205@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libutil login_cap.3 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk davidn 1997/05/18 02:14:12 PDT Modified files: lib/libutil login_cap.3 Log: MF2.2: update login_cap api docs. Revision Changes Path 1.7 +23 -9 src/lib/libutil/login_cap.3 From owner-cvs-lib Sun May 18 02:41:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA22337 for cvs-lib-outgoing; Sun, 18 May 1997 02:41:49 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA22329; Sun, 18 May 1997 02:41:19 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id RAA06430; Sun, 18 May 1997 17:40:28 +0800 (WST) Message-Id: <199705180940.RAA06430@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-reply-to: Your message of "Sun, 18 May 1997 13:04:48 +0400." Date: Sun, 18 May 1997 17:40:27 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= wrote: > On Sun, 18 May 1997, Peter Wemm wrote: > > > My current version is compatable with this, *except* that it doesn't seem > > convenient to mask SIGALRM while preparing to call nanosleep(). Doing a > > longjump out of the signal handler seems like overkill... > > > > I'm using this at present: > > Good news, this variant works with Apache, lets commit it. I'm not sure why this happens, but I suspect it's because we are eating the signal and not letting the apache timeout() function get called - it does longjumps and a whole heap of other stuff. With using the old sleep code, the apache SIGALRM handler was blocked, but the original nanosleep version was allowing the apache timeout() to be called as an interrupt within sleep(3). This is probably a bad assumption on apache's behalf if it depends on sleep() overriding it's SIGALRM handler... > BTW, I see race condition when SIGALRM comes inside sleep() code > before nanosleep() call. It can be blocked before, but how to unblock it > inside nanosleep()? The only way I can think of to get out of this is to use a longjmp from the signal handler and restore the signal masks.... *shudder*... eg, something roughly like this: static struct jmpbuf slpjmp; static void sleephandler() { longjump(&slpjmp, 1); } unsigned int sleep(seconds) unsigned int seconds; { struct timespec time_to_sleep; struct timespec time_remaining; struct sigvec vec, ovec; if (seconds != 0) { time_to_sleep.tv_sec = seconds; time_to_sleep.tv_nsec = 0; .. mask SIGALRM .. setvec(vec, sleephandler); (void) sigvec(SIGALRM, &vec, &ovec); if (setjmp(&jmpbuf) == 0) { .. unmask SIGALRM .. nanosleep(&time_to_sleep, &time_remaining); (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); seconds = time_remaining.tv_sec; if (time_remaining.tv_nsec > 0) seconds++; /* round up */ } else { .. calculate elapsed time .. } (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); .. unmask SIGALRM .. } return (seconds); } .. but this has several problems.. 1: it's starting to get messy with lots of syscalls. 2: it doesn't deal with an aborted nanosleep() due to SIGALRM. It'd have to calculate the elapsed time itself by calling gettimeofday or clock_gettime() before and after. It'd also suffer from time adjustments and contribute to the mess. I'm not sure how apache would deal with loosing a SIGALRM which isn't going to reset it's alarm() handler... But I don't think that what the new version is doing is any worse than the old code.. On the other hand, perhaps we could change the nanosleep syscall so that it takes a mask argument and handle the differences in the libc wrapper and have sleep(3) do this: sigprocmask(SIG_BLOCK, ..SIGALRM.., &oset); ... setsignal(SIGALRM, sleephandler); ... nanosleep_mask(&time, &remaining, &oset); ... and have nanosleep(ts1, ts2) be implemented as nanosleep_mask(ts1, ts2, NULL); > -- > Andrey A. Chernov > > http://www.nagual.pp.ru/~ache/ Cheers, -Peter From owner-cvs-lib Sun May 18 02:48:01 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA22493 for cvs-lib-outgoing; Sun, 18 May 1997 02:48:01 -0700 (PDT) Received: from nagual.pp.ru (ache.relcom.ru [194.58.229.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA22404; Sun, 18 May 1997 02:44:36 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.8.5/8.8.5) id NAA01312; Sun, 18 May 1997 13:29:09 +0400 (MSD) Date: Sun, 18 May 1997 13:29:06 +0400 (MSD) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Bruce Evans cc: peter@spinner.dialix.com, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-Reply-To: <199705180901.TAA31228@godzilla.zeta.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 18 May 1997, Bruce Evans wrote: > >Hmm. Perhaps install a temporary dummy SIGALRM handler in the sleep.c stub > >so that it doesn't die if there isn't one. The old setitimer way doesn't > >mess with alarm(2), using nanosleep() wont change that. > > Why would a program generate alarms without installing an alarm handler? They assume sleep() install one for them. It is commonly used way to terminate sleep() in a child since not all sleep implementations terminates by other signals. -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/ From owner-cvs-lib Sun May 18 02:51:12 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA22584 for cvs-lib-outgoing; Sun, 18 May 1997 02:51:12 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA22572; Sun, 18 May 1997 02:50:52 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id TAA32394; Sun, 18 May 1997 19:41:01 +1000 Date: Sun, 18 May 1997 19:41:01 +1000 From: Bruce Evans Message-Id: <199705180941.TAA32394@godzilla.zeta.org.au> To: bde@zeta.org.au, peter@spinner.dialix.com Subject: Re: cvs commit: src/lib/libc/gen usleep.c Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> POSIX.1 seems to specify returning early from sleep() whenever a signal >> (of any type) is caught. > >Yes, we violated this quite badly.. :-( Where did the sleep(3) code come >from? It looks like it's from Lite-1 and that it's busted there. Was it in >the net-2 code as well? It is the same in Lite as in FreeBSD-1.1.5. I assume it is the same in FreeBSD-1.1.5 as in Net/2. We must be doing something wrong to require more complications than glibc. There are two major versions of sleep() in glibc: - the Linux version of sleep() just calls nanosleep(). It isn't as chummy with the implementation as ours - it returns 0 when nanosleep() returns 0 - the remaining time is not documented to be set in this case. Both versions are broken when nanosleep() returns EFAULT - the remaining time is garbage in this case. Both versions are broken for invalid and large sleep intervals - nanotime() returns EINVAL and the remaining time is garbage. - the POSIX version of sleep() uses alarm(). It returns after sigsuspend() in all cases (it uses the POSIX sigsuspend() instead of the crufty sigpause()). Bruce From owner-cvs-lib Sun May 18 03:03:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA22914 for cvs-lib-outgoing; Sun, 18 May 1997 03:03:23 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA22904; Sun, 18 May 1997 03:02:53 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id SAA06698; Sun, 18 May 1997 18:00:57 +0800 (WST) Message-Id: <199705181000.SAA06698@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= cc: Bruce Evans , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-reply-to: Your message of "Sun, 18 May 1997 13:29:06 +0400." Date: Sun, 18 May 1997 18:00:55 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= wrote: > On Sun, 18 May 1997, Bruce Evans wrote: > > > >Hmm. Perhaps install a temporary dummy SIGALRM handler in the sleep.c stu b > > >so that it doesn't die if there isn't one. The old setitimer way doesn't > > >mess with alarm(2), using nanosleep() wont change that. > > > > Why would a program generate alarms without installing an alarm handler? > > They assume sleep() install one for them. It is commonly used way to > terminate sleep() in a child since not all sleep implementations > terminates by other signals. BTW, I think apache is being silly using a sleep() in wait_or_timeout. The 1-second sleep in there was causing an artificially raised load average on our old SVR4 systems. Changing the sleep(1) to poll(0,0,1000) made it use *much* less cpu time and generally work better on SVR4. But this is essentially the same change as we originally made to sleep() to make it use nanosleep which caused all the problems. Quite why this sort of change works so well on SVR4 and so badly on BSD I don't know. IMHO, apache should use either select() or poll() (since it uses select() already it shouldn't matter) to do it's sleeps rather than mess with signals and sigalarms etc. Apache already uses select() for timeouts elsewhere, it should finish the job. :-) > -- > Andrey A. Chernov > > http://www.nagual.pp.ru/~ache/ Cheers, -Peter From owner-cvs-lib Sun May 18 03:37:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA23965 for cvs-lib-outgoing; Sun, 18 May 1997 03:37:07 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA23958; Sun, 18 May 1997 03:36:29 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id UAA01135; Sun, 18 May 1997 20:33:22 +1000 Date: Sun, 18 May 1997 20:33:22 +1000 From: Bruce Evans Message-Id: <199705181033.UAA01135@godzilla.zeta.org.au> To: ache@nagual.pp.ru, peter@spinner.dialix.com Subject: Re: cvs commit: src/lib/libc/gen sleep.c Cc: bde@zeta.org.au, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-lib@FreeBSD.org, peter@FreeBSD.org Sender: owner-cvs-lib@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >FWIW, I can't find any other sleep() implementation that always returns >zero like ours has done up to now. Ours was just buggy. >> In any case, _ignored_ signals should not interrupt sleep. > >Hmm.. Are we doing this?? Yes, tsleep() ignores them too. >Yes, if a SIGALRM arrives during sleep() from an outside source, we should >end the sleep rather than exit if the alarm signal isn't trapped. Only for backwards compatibility. >However, I don't see how to do this without races while using nanosleep(). >It could be possible to get a SIGALRM right after installing the handler >but before the nanosleep() starts. The old method doesn't have this problem :-(. sigsuspend()/sigpause() has exactly the right semantics for preventing the race. However, there's nothing you can do about SIGALRMs sent before the handler is installed. nanosleep() and the old sleep() have the same problem - alarms can't be relied on to terminate the sleep, because they may arrive before the sleep begins (perhaps due to scheduling delays). The best that you can do is to catch them so that you don't get killed. Bruce From owner-cvs-lib Sun May 18 03:58:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA24492 for cvs-lib-outgoing; Sun, 18 May 1997 03:58:26 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA24464; Sun, 18 May 1997 03:57:55 -0700 (PDT) From: Peter Wemm Received: (from peter@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA06761; Sun, 18 May 1997 03:57:50 -0700 (PDT) Date: Sun, 18 May 1997 03:57:50 -0700 (PDT) Message-Id: <199705181057.DAA06761@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc/gen sleep.c usleep.c Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk peter 1997/05/18 03:57:50 PDT Modified files: lib/libc/gen sleep.c usleep.c Log: Update the nanosleep versions to set a SIGALRM handler while sleeping. This appears to appease Apache, although depending on having sleep(3) changing the SIGALRM handler is a bit bogus. Revision Changes Path 1.9 +9 -2 src/lib/libc/gen/sleep.c 1.8 +9 -1 src/lib/libc/gen/usleep.c From owner-cvs-lib Sun May 18 04:07:55 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA24732 for cvs-lib-outgoing; Sun, 18 May 1997 04:07:55 -0700 (PDT) Received: from nagual.pp.ru (ache.relcom.ru [194.58.229.133]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA24707; Sun, 18 May 1997 04:07:40 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.8.5/8.8.5) id PAA01540; Sun, 18 May 1997 15:07:15 +0400 (MSD) Date: Sun, 18 May 1997 15:07:12 +0400 (MSD) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= To: Peter Wemm cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-Reply-To: <199705180940.RAA06430@spinner.DIALix.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sun, 18 May 1997, Peter Wemm wrote: > (void) sigvec(SIGALRM, &vec, &ovec); > if (setjmp(&jmpbuf) == 0) { > .. unmask SIGALRM .. I think here is a race place --> > nanosleep(&time_to_sleep, &time_remaining); > (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); > ... but this has several problems.. > 1: it's starting to get messy with lots of syscalls. > 2: it doesn't deal with an aborted nanosleep() due to SIGALRM. It'd have > to calculate the elapsed time itself by calling gettimeofday or > clock_gettime() before and after. It'd also suffer from time adjustments > and contribute to the mess. Yes. > On the other hand, perhaps we could change the nanosleep syscall so that > it takes a mask argument and handle the differences in the libc wrapper > and have sleep(3) do this: > > > sigprocmask(SIG_BLOCK, ..SIGALRM.., &oset); > ... > setsignal(SIGALRM, sleephandler); > ... > nanosleep_mask(&time, &remaining, &oset); > ... > > and have nanosleep(ts1, ts2) be implemented as nanosleep_mask(ts1, ts2, > NULL); The second variant looks much better. -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/ From owner-cvs-lib Sun May 18 06:18:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id GAA27822 for cvs-lib-outgoing; Sun, 18 May 1997 06:18:02 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA27802; Sun, 18 May 1997 06:17:38 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id VAA07838; Sun, 18 May 1997 21:14:28 +0800 (WST) Message-Id: <199705181314.VAA07838@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= cc: Bruce Evans , peter@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen sleep.c In-reply-to: Your message of "Sun, 18 May 1997 15:07:12 +0400." Date: Sun, 18 May 1997 21:14:26 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= wrote: > On Sun, 18 May 1997, Peter Wemm wrote: > > > (void) sigvec(SIGALRM, &vec, &ovec); > > if (setjmp(&jmpbuf) == 0) { > > .. unmask SIGALRM .. > > I think here is a race place --> No, because if a SIGALRM is taken before getting into nanosleep(), the signal handler longjmp's out, and the nanosleep() isn't called. So, if we recieve a sigalarm inside sleep(3), we don't sleep (as intended). However, there are so many races here already it's not funny.. like, what happens if we get a signal before masking SIGALRM in the first place? > > nanosleep(&time_to_sleep, &time_remaining); > > (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); > > > ... but this has several problems.. > > 1: it's starting to get messy with lots of syscalls. > > 2: it doesn't deal with an aborted nanosleep() due to SIGALRM. It'd have > > to calculate the elapsed time itself by calling gettimeofday or > > clock_gettime() before and after. It'd also suffer from time adjustments > > and contribute to the mess. > > Yes. Hmm.. or we could initialise time_remaining to the full value. If nanosleep() never gets called, we can simply return the full value since we never really slept. > > On the other hand, perhaps we could change the nanosleep syscall so that > > it takes a mask argument and handle the differences in the libc wrapper > > and have sleep(3) do this: > > > > > > sigprocmask(SIG_BLOCK, ..SIGALRM.., &oset); > > ... > > setsignal(SIGALRM, sleephandler); > > ... > > nanosleep_mask(&time, &remaining, &oset); > > ... > > > and have nanosleep(ts1, ts2) be implemented as nanosleep_mask(ts1, ts2, > > NULL); > > The second variant looks much better. Bleah.. signanosleep()? wait for an unmasked signal (mask specified in syscall) for up to the max time limit. > -- > Andrey A. Chernov > > http://www.nagual.pp.ru/~ache/ Cheers, -Peter From owner-cvs-lib Mon May 19 03:04:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA12654 for cvs-lib-outgoing; Mon, 19 May 1997 03:04:52 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA12608; Mon, 19 May 1997 03:04:31 -0700 (PDT) From: Peter Wemm Received: (from peter@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA23942; Mon, 19 May 1997 03:04:18 -0700 (PDT) Date: Mon, 19 May 1997 03:04:18 -0700 (PDT) Message-Id: <199705191004.DAA23942@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libutil libutil.h Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk peter 1997/05/19 03:04:17 PDT Modified files: lib/libutil libutil.h Log: Now I really understand the reason for the style.9 rule about not having visible type names in prototypes in user space headers. libutil.h generates warnings with -Wall over the use of "const char *ttyname". It's lucky it wasn't a #define conflict. Is a single '_' prefix acceptable? or does it need to be two? Revision Changes Path 1.9 +14 -14 src/lib/libutil/libutil.h From owner-cvs-lib Mon May 19 04:01:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA14942 for cvs-lib-outgoing; Mon, 19 May 1997 04:01:59 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA14917; Mon, 19 May 1997 04:01:29 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id UAA11773; Mon, 19 May 1997 20:56:47 +1000 Date: Mon, 19 May 1997 20:56:47 +1000 From: Bruce Evans Message-Id: <199705191056.UAA11773@godzilla.zeta.org.au> To: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libutil libutil.h Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Modified files: > lib/libutil libutil.h > Log: > Now I really understand the reason for the style.9 rule about not having > visible type names in prototypes in user space headers. libutil.h > generates warnings with -Wall over the use of "const char *ttyname". > It's lucky it wasn't a #define conflict. > Is a single '_' prefix acceptable? or does it need to be two? Two '_'s are only useful for extra defense against broken programs that #define reserved names. Two are unnecessary for the same reason that two are unnecessary for most of the members of the FILE struct - the opening parentheses in prototypes changes the scope much like the the opening brace in a struct declaration. Why did -Wall generate warnings? It takes -Wshadow to get a warning for the ttyname in shadowing the one in Bruce From owner-cvs-lib Mon May 19 09:34:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA01471 for cvs-lib-outgoing; Mon, 19 May 1997 09:34:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA01359; Mon, 19 May 1997 09:33:44 -0700 (PDT) From: Eivind Eklund Received: (from eivind@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA23351; Mon, 19 May 1997 09:33:28 -0700 (PDT) Date: Mon, 19 May 1997 09:33:28 -0700 (PDT) Message-Id: <199705191633.JAA23351@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-contrib@FreeBSD.ORG, cvs-gnu@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, cvs-share@FreeBSD.ORG, cvs-usrbin@FreeBSD.ORG, cvs-usrsbin@FreeBSD.ORG Subject: cvs commit: src/contrib/bind/man dig.1 src/contrib/gcc gcc.1 src/gnu/usr.bin/dialog dialog.1 src/lib/libc/stdtime time2posix.3 src/lib/libc/sys getlogin.2 src/share/man/man4/man4.i386 gsc.4 src/usr.bin/find find.1 src/usr.sbin/fdwrite fdwrite.1 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk eivind 1997/05/19 09:33:28 PDT Modified files: contrib/bind/man dig.1 contrib/gcc gcc.1 gnu/usr.bin/dialog dialog.1 lib/libc/stdtime time2posix.3 lib/libc/sys getlogin.2 share/man/man4/man4.i386 gsc.4 usr.bin/find find.1 usr.sbin/fdwrite fdwrite.1 Log: `it's'' -> `its'' where appropriate and typo fixes in time2posix.3. Closes PR docs/3612. Submitted by: Josh Gilliam Revision Changes Path 1.2 +1 -1 src/contrib/bind/man/dig.1 1.7 +1 -1 src/contrib/gcc/gcc.1 1.5 +1 -1 src/gnu/usr.bin/dialog/dialog.1 1.5 +2 -2 src/lib/libc/stdtime/time2posix.3 1.8 +1 -1 src/lib/libc/sys/getlogin.2 1.7 +2 -2 src/share/man/man4/man4.i386/gsc.4 1.9 +2 -2 src/usr.bin/find/find.1 1.5 +2 -2 src/usr.sbin/fdwrite/fdwrite.1 From owner-cvs-lib Mon May 19 15:15:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA22713 for cvs-lib-outgoing; Mon, 19 May 1997 15:15:32 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA22656; Mon, 19 May 1997 15:15:14 -0700 (PDT) From: Eivind Eklund Received: (from eivind@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA03400; Mon, 19 May 1997 15:14:56 -0700 (PDT) Date: Mon, 19 May 1997 15:14:56 -0700 (PDT) Message-Id: <199705192214.PAA03400@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-contrib@FreeBSD.ORG, cvs-gnu@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, cvs-share@FreeBSD.ORG, cvs-usrbin@FreeBSD.ORG, cvs-usrsbin@FreeBSD.ORG Subject: cvs commit: src/contrib/bind/man dig.1 src/contrib/gcc gcc.1 src/gnu/usr.bin/dialog dialog.1 src/lib/libc/stdtime time2posix.3 src/lib/libc/sys getlogin.2 src/share/man/man4/man4.i386 gsc.4 src/usr.bin/find find.1 src/usr.sbin/fdwrite fdwrite.1 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk eivind 1997/05/19 15:14:55 PDT Modified files: contrib/bind/man dig.1 contrib/gcc gcc.1 gnu/usr.bin/dialog dialog.1 lib/libc/stdtime time2posix.3 lib/libc/sys getlogin.2 share/man/man4/man4.i386 gsc.4 usr.bin/find find.1 usr.sbin/fdwrite fdwrite.1 Log: YAMFC: it's'' -> its'' where appropriate and typo fixes in time2posix.3. This is RELENG_2_2, if the headers don't show that. PR: 3612 Submitted by: Josh Gilliam Revision Changes Path 1.1.1.1.2.1 +1 -1 src/contrib/bind/man/dig.1 1.2.2.2 +1 -1 src/contrib/gcc/gcc.1 1.4.2.1 +1 -1 src/gnu/usr.bin/dialog/dialog.1 1.4.2.1 +2 -2 src/lib/libc/stdtime/time2posix.3 1.3.2.1 +1 -1 src/lib/libc/sys/getlogin.2 1.1.2.3 +2 -2 src/share/man/man4/man4.i386/gsc.4 1.4.2.3 +2 -2 src/usr.bin/find/find.1 1.2.2.1 +2 -2 src/usr.sbin/fdwrite/fdwrite.1 From owner-cvs-lib Thu May 22 00:03:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA05898 for cvs-lib-outgoing; Thu, 22 May 1997 00:03:57 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA05858; Thu, 22 May 1997 00:02:09 -0700 (PDT) From: Thomas Gellekum Received: (from tg@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id AAA06886; Thu, 22 May 1997 00:02:05 -0700 (PDT) Date: Thu, 22 May 1997 00:02:05 -0700 (PDT) Message-Id: <199705220702.AAA06886@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libutil login.conf.5 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk tg 1997/05/22 00:02:04 PDT Modified files: lib/libutil login.conf.5 Log: Typo police. Revision Changes Path 1.9 +2 -2 src/lib/libutil/login.conf.5 From owner-cvs-lib Thu May 22 00:07:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA06091 for cvs-lib-outgoing; Thu, 22 May 1997 00:07:36 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA06038; Thu, 22 May 1997 00:05:56 -0700 (PDT) From: Thomas Gellekum Received: (from tg@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id AAA06959; Thu, 22 May 1997 00:05:52 -0700 (PDT) Date: Thu, 22 May 1997 00:05:52 -0700 (PDT) Message-Id: <199705220705.AAA06959@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libutil login.conf.5 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk tg 1997/05/22 00:05:52 PDT Modified files: (Branch: RELENG_2_2) lib/libutil login.conf.5 Log: MFC: typo. Revision Changes Path 1.8.2.1 +2 -2 src/lib/libutil/login.conf.5 From owner-cvs-lib Thu May 22 21:43:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA00323 for cvs-lib-outgoing; Thu, 22 May 1997 21:43:23 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA00172; Thu, 22 May 1997 21:41:40 -0700 (PDT) From: Brian Somers Received: (from brian@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA05554; Thu, 22 May 1997 21:41:32 -0700 (PDT) Date: Thu, 22 May 1997 21:41:32 -0700 (PDT) Message-Id: <199705230441.VAA05554@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libalias - Imported sources Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk brian 1997/05/22 21:41:32 PDT src/lib/libalias - Imported sources Update of /home/ncvs/src/lib/libalias In directory freefall.freebsd.org:/net/hub/a/brian/libalias Revision/Branch: 1.1.1 Log Message: Create the alias library. This is currently only used by ppp (or will be shortly). Natd can now be updated to use this library rather than carrying its own version of the code. Submitted by: Charles Mott Status: Vendor Tag: CMOTT Release Tags: alias_2_1 N src/lib/libalias/Makefile N src/lib/libalias/alias.c N src/lib/libalias/alias.h N src/lib/libalias/alias_db.c N src/lib/libalias/alias_ftp.c N src/lib/libalias/alias_irc.c N src/lib/libalias/alias_local.h N src/lib/libalias/alias_util.c No conflicts created by this import From owner-cvs-lib Thu May 22 21:48:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA00616 for cvs-lib-outgoing; Thu, 22 May 1997 21:48:25 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA00494; Thu, 22 May 1997 21:46:54 -0700 (PDT) From: Brian Somers Received: (from brian@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA05685; Thu, 22 May 1997 21:46:51 -0700 (PDT) Date: Thu, 22 May 1997 21:46:51 -0700 (PDT) Message-Id: <199705230446.VAA05685@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib Makefile Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk brian 1997/05/22 21:46:50 PDT Modified files: lib Makefile Log: Hook in alias library. Revision Changes Path 1.55 +1 -1 src/lib/Makefile From owner-cvs-lib Fri May 23 01:25:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA08537 for cvs-lib-outgoing; Fri, 23 May 1997 01:25:36 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA08445; Fri, 23 May 1997 01:24:04 -0700 (PDT) From: Satoshi Asami Received: (from asami@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id BAA11508; Fri, 23 May 1997 01:24:00 -0700 (PDT) Date: Fri, 23 May 1997 01:24:00 -0700 (PDT) Message-Id: <199705230824.BAA11508@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc Makefile src/lib/libc/yp Makefile.inc src/lib/librpcsvc Makefile Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk asami 1997/05/23 01:24:00 PDT Modified files: lib/libc Makefile lib/libc/yp Makefile.inc lib/librpcsvc Makefile Log: Use ${DESTDIR} correctly in front of absolute paths. Revision Changes Path 1.19 +3 -3 src/lib/libc/Makefile 1.6 +2 -2 src/lib/libc/yp/Makefile.inc 1.9 +2 -2 src/lib/librpcsvc/Makefile From owner-cvs-lib Fri May 23 01:32:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA08837 for cvs-lib-outgoing; Fri, 23 May 1997 01:32:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA08715; Fri, 23 May 1997 01:30:41 -0700 (PDT) From: Satoshi Asami Received: (from asami@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id BAA11663; Fri, 23 May 1997 01:30:37 -0700 (PDT) Date: Fri, 23 May 1997 01:30:37 -0700 (PDT) Message-Id: <199705230830.BAA11663@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc Makefile src/lib/libc/sys Makefile.inc src/lib/libc/yp Makefile.inc src/lib/librpcsvc Makefile Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk asami 1997/05/23 01:30:37 PDT Modified files: lib/libc Makefile lib/libc/sys Makefile.inc lib/libc/yp Makefile.inc lib/librpcsvc Makefile Log: (Sort of) MFC: use ${DESTDIR} correctly in front of absolute paths. Reviewed by: bde Revision Changes Path 1.16.2.2 +2 -2 src/lib/libc/Makefile 1.20.2.2 +7 -7 src/lib/libc/sys/Makefile.inc 1.2.2.1 +2 -2 src/lib/libc/yp/Makefile.inc 1.6.2.1 +2 -2 src/lib/librpcsvc/Makefile From owner-cvs-lib Fri May 23 01:33:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA08898 for cvs-lib-outgoing; Fri, 23 May 1997 01:33:21 -0700 (PDT) Received: from silvia.HIP.Berkeley.EDU (ala-ca17-23.ix.netcom.com [204.32.168.183]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA08758; Fri, 23 May 1997 01:31:26 -0700 (PDT) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.5/8.6.9) id BAA11450; Fri, 23 May 1997 01:31:24 -0700 (PDT) Date: Fri, 23 May 1997 01:31:24 -0700 (PDT) Message-Id: <199705230831.BAA11450@silvia.HIP.Berkeley.EDU> To: cvs-committers@freebsd.org, cvs-all@freebsd.org, cvs-lib@freebsd.org In-reply-to: <199705230824.BAA11508@freefall.freebsd.org> (message from Satoshi Asami on Fri, 23 May 1997 01:24:00 -0700 (PDT)) Subject: Re: cvs commit: src/lib/libc Makefile src/lib/libc/yp Makefile.inc src/lib/librpcsvc Makefile From: asami@vader.cs.berkeley.edu (Satoshi Asami) Sender: owner-cvs-lib@freebsd.org X-Loop: FreeBSD.org Precedence: bulk * Use ${DESTDIR} correctly in front of absolute paths. * * Revision Changes Path * 1.19 +3 -3 src/lib/libc/Makefile * 1.6 +2 -2 src/lib/libc/yp/Makefile.inc * 1.9 +2 -2 src/lib/librpcsvc/Makefile Oops. Reviewed by: bde Satoshi From owner-cvs-lib Sat May 24 03:54:08 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA20583 for cvs-lib-outgoing; Sat, 24 May 1997 03:54:08 -0700 (PDT) Received: from agora.rdrop.com (root@agora.rdrop.com [199.2.210.241]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA20577; Sat, 24 May 1997 03:54:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by agora.rdrop.com (8.8.5/8.8.5) with ESMTP id DAA26322; Sat, 24 May 1997 03:24:18 -0700 (PDT) From: brian@FreeBSD.ORG Received: (from brian@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id DAA01647; Sat, 24 May 1997 03:24:05 -0700 (PDT) Date: Sat, 24 May 1997 03:24:05 -0700 (PDT) Message-Id: <199705241024.DAA01647@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib Makefile Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk brian 1997/05/24 03:24:04 PDT Modified files: (Branch: RELENG_2_2) lib Makefile Log: Include libalias Revision Changes Path 1.47.2.4 +1 -1 src/lib/Makefile From owner-cvs-lib Sat May 24 04:08:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA21095 for cvs-lib-outgoing; Sat, 24 May 1997 04:08:59 -0700 (PDT) Received: from punt-1.mail.demon.net (relay-7.mail.demon.net [194.217.242.9]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id EAA21071; Sat, 24 May 1997 04:08:39 -0700 (PDT) Received: from awfulhak.demon.co.uk ([158.152.17.1]) by punt-1.mail.demon.net id aa0525627; 24 May 97 11:19 BST Received: (from brian@localhost) by awfulhak.demon.co.uk (8.8.5/8.8.5) id LAA16380; Sat, 24 May 1997 11:17:02 +0100 (BST) Date: Sat, 24 May 1997 11:17:02 +0100 (BST) From: Brian Somers Message-Id: <199705241017.LAA16380@awfulhak.demon.co.uk> To: cvs-committers@freebsd.org, cvs-all@freebsd.org, cvs-lib@freebsd.org Subject: cvs commit: src/lib/libalias Makefile Sender: owner-cvs-lib@freebsd.org X-Loop: FreeBSD.org Precedence: bulk brian 1997/05/24 11:17:02 BST Modified files: (Branch: RELENG_2_2) lib/libalias Makefile Log: Nothing - this is a local test ! Revision Changes Path 1.1.1.1.2.1 +1 -0 src/lib/libalias/Makefile From owner-cvs-lib Sat May 24 04:12:51 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA21230 for cvs-lib-outgoing; Sat, 24 May 1997 04:12:51 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA21225; Sat, 24 May 1997 04:12:42 -0700 (PDT) Received: from awfulhak.demon.co.uk (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id MAA25895; Sat, 24 May 1997 12:12:37 +0100 (BST) Message-Id: <199705241112.MAA25895@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: Brian Somers cc: cvs-committers@freebsd.org, cvs-all@freebsd.org, cvs-lib@freebsd.org Subject: Re: cvs commit: src/lib/libalias Makefile In-reply-to: Your message of "Sat, 24 May 1997 11:17:02 BST." <199705241017.LAA16380@awfulhak.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 24 May 1997 12:12:37 +0100 From: Brian Somers Sender: owner-cvs-lib@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > brian 1997/05/24 11:17:02 BST > > Modified files: (Branch: RELENG_2_2) > lib/libalias Makefile > Log: > Nothing - this is a local test ! > > Revision Changes Path > 1.1.1.1.2.1 +1 -0 src/lib/libalias/Makefile > Sorry for that. This was actually done at home, but the mail escaped :| -- Brian , Don't _EVER_ lose your sense of humour....