Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!yale!husc6!purdue!haven!adm!news From: postmaster@[unknown] (SMTP MAILER) Newsgroups: comp.unix.questions Subject: Mail Delivery Problem Message-ID: <24331@adm.BRL.MIL> Date: 29 Aug 90 13:34:16 GMT Sender: news@adm.BRL.MIL Lines: 494 ----Reason for mail failure follows---- Sending mail to host ise.ncsl.nist.gov : Unrecognized host name or address. ----Transcript of message follows---- Date: 27 Aug 90 13:20:00 GMT+109:13 From: info-unix@BRL.MIL Subject: INFO-UNIX Digest V10#129 To: "barkley" Return-Path: Received: from SEM.BRL.MIL by ecf.ncsl.nist.gov with SMTP ; Mon, 27 Aug 90 13:20:10 EST Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab02920; 27 Aug 90 5:55 EDT Received: from sem.brl.mil by SEM.BRL.MIL id aa02902; 27 Aug 90 5:45 EDT Date: Mon, 27 Aug 90 05:45:22 EST From: The Moderator (Mike Muuss) To: INFO-UNIX@BRL.MIL Reply-To: INFO-UNIX@BRL.MIL Subject: INFO-UNIX Digest V10#129 Message-ID: <9008270545.aa02902@SEM.BRL.MIL> INFO-UNIX Digest Mon, 27 Aug 1990 V10#129 Today's Topics: WordStar-like Editor for Unix Wanted Re: Curses and the arrow keys CD-ROM device drivers needed Does PMAX Ultrix 4.0 cc *fully* support void pointers? Re: ATT Unix millisec clock Re: ct for BSD machine... Re: Curses and the arrow keys help: cron runs commands twice (is it timed's fault?) spell and /usr/dict/words. mysteriously full root partition ----------------------------------------------------------------- From: "raymond.konopka..jr" Subject: WordStar-like Editor for Unix Wanted Date: 24 Aug 90 17:07:46 GMT Sender: "Ray Konopka"@cbnewsk.att.com, Jr@cbnewsk.att.com Followup-To: konopka@ihlpm.att.com To: info-unix@sem.brl.mil I would like to know if there exists a WordStar-like editor available for use on a Unix system. I have programmed in a PC environment for some time know using Borland's Turbo Pascal and Turbo C/C++ and have just moved to a Unix environment. I like the editors used by Borland which are based on WordStar, and I am trying to find one available for a Unix environment. Any information would be appreciated. Thanks, Ray Konopka ----------------------------- From: Mike Jetzer Subject: Re: Curses and the arrow keys Date: 26 Aug 90 18:52:18 GMT To: info-unix@sem.brl.mil In article <1990Aug24.175453.4310@irscscm.UUCP> mlake@irscscm.UUCP (Marshall Lake) writes: >I am writing a program which will be taking advantage of curses. [ . . . ] >I am doing a getch () and if I get an ESCAPE I do >another getch (). If I addch () for each character I get (the ESCAPE >and the next character) then the cursor moves around properly on the >screen but the x/y coordinates in the window structure do not follow >suit. Curses is recognizing the arrow keys simply as regular >characters. Am I naive in thinking that curses is smart enough to >handle the arrow keys specially? Should I be moving the cursor >manually via the move function? Your naivete could be corrected by reading the manpage on curses. Performing a keypad() will enable the keypad on most terminals, and when the user presses an arrow key, the return value will be KEY_DOWN, KEY_UP, etc. You can then take the proper action based on the key that the user actually pressed. -- Mike Jetzer "And we'll have fun, fun, fun until Daddy takes the keyboard awa-ay..." ----------------------------- From: Michael Meissner Subject: Re: Curses and the arrow keys Date: 26 Aug 90 21:32:07 GMT Sender: news@osf.org To: info-unix@sem.brl.mil In article <1990Aug24.175453.4310@irscscm.UUCP> mlake@irscscm.UUCP (Marshall Lake) writes: | I am writing a program which will be taking advantage of curses. I am | trying to utilize the arrow keys and am confused (actually all of | curses confuses me). I am doing a getch () and if I get an ESCAPE I do | another getch (). If I addch () for each character I get (the ESCAPE | and the next character) then the cursor moves around properly on the | screen but the x/y coordinates in the window structure do not follow | suit. Curses is recognizing the arrow keys simply as regular | characters. Am I naive in thinking that curses is smart enough to | handle the arrow keys specially? Should I be moving the cursor | manually via the move function? If your curses is based on the System V.2 curses, it will have a 'keypad' function which turns on recognizing any arrow keys or function keys. Here is a copy of the documentation: NAME keypad - enable keypad SYNTAX keypad(win, bf) WINDOW *win; bool bf; DESCRIPTION This option enables the keypad of the user's terminal. If the keypad is enabled, pressing a function key (such as an arrow key) will return a single value representing the function key. For example, pressing the left arrow key results in the value KEY_LEFT being returned.. For more information see the Guide to Curses Screen-Handling. The routine is used to return the character. If the keypad is disabled, does not treat function keys as special keys and the program interprets the escape sequences itself. Keypad layout is terminal dependent; some terminals do not even have a keypad. SEE ALSO getch(3cur) Guide to Curses Screen-Handling Note that KEY_LEFT and friends will not fit in an ordinary character, so make sure getch's result is stored in an int. If your curses is still based on the Berkeley curses, you have my sympathies. This is one area where System V is better than BSD. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Do apple growers tell their kids money doesn't grow on bushes? ----------------------------- From: "E Drew Einhorn ADV.SCI.Inc" Subject: CD-ROM device drivers needed Date: 26 Aug 90 18:03:52 GMT Sender: USENET News System To: info-unix@sem.brl.mil Anybody know where I can find device drivers to support CD-ROM players on a AT&T 3b2/600 under SYSV version 3.2.2. We have an assortment of players that used to be hooked up to PC's. Thanks, -- einhorn@hydra.unm.edu ----------------------------- From: Scott Weitzenkamp Subject: Does PMAX Ultrix 4.0 cc *fully* support void pointers? Keywords: brain damage Date: 26 Aug 90 22:24:35 GMT Followup-To: comp.unix.ultrix To: info-unix@sem.brl.mil We have a DECstation 3100 with Ultrix 3.0. One of the bugs in cc is that it does not have complete support for void pointers. For example, the following code will *not* compile: int foo(void *ptr) { printf("%d\n", ptr); } Is this bug fixed in cc on Ultrix 4.0? If not, then why the hell not? Why bother having prototypes and other ANSI features if you don't fully support something as simple (IMHO) as void pointers? Most of the pcc-based cc's that I've come across (SunOS 3.x and 4.x, System V/386 3.2) at least allow void pointers as function parameters. While I'm complaining, does the Ultrix 4.0 cc support the ANSI C "const" keyword? -- Thanks in advance... Scott Weitzenkamp, Talarian Corporation, Mountain View, CA uunet!talarian!scott (415) 965-8050 "Welcome to the late show, starring NULL and void" -- Men At Work ----------------------------- From: the hacker Subject: Re: ATT Unix millisec clock Date: 9 Aug 90 10:18:03 GMT Sender: news@nixpbe.uucp To: info-unix@sem.brl.mil In <13494@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article freiss@nixpbe.UUCP (the hacker) writes: >-So far, only SECOND resolution is permitted through the ATT Unix OS to time >-the elapsed time of a job. Millisecond resolution (or better) accessed >-from a .c executable is desired. I am running ATT Unix Version System 5 >-Version 3.2 on a Motorola 68020 based machine. >-System interrupts? Shell commands? Any solution to this thorny problem would >-be greatly appreciated... >Unfortunately, you have not stated a problem, but rather a desired SOLUTION. >If we knew what the real problem to be solved was, perhaps we could suggest >something helpful. Right :-) ok, what Nick Kawaguchi wants is a) something like a profiler with millisecond resolution to time how long a C-function takes to execute. BTW, thanks to all of you who replied suggesting the times() system call. He uses that now, though something that has a better resolution would be more useful. b) a sleep() call with millisecond or tenth of second resolution. Curses has a napms() function that supposedly does exactly that, but I'm told it is unreliable (i.e. doesn't really nap milliseconds, but 1 / HZ seconds). My guess is it's impossible, but then I'm not very wizardly concerning UN*X. All hints are appreciated. Thanks, -Martin freiss.pad@nixdorf.com ----------------------------- From: Don Libes Subject: Re: ct for BSD machine... Date: 27 Aug 90 00:36:15 GMT To: info-unix@sem.brl.mil In article <3095@unisoft.UUCP> rembo@unisoft.UUCP (Tony Rems) writes: >I was wondering if anyone out there has ported or written/re-written >a version of ct for a BSD machine. For those who don't know ct >is a dial-back getty program. Specifically, I'm looking for >a copy to run on a Pyramid. Any help or direction anyone can >give me would be appreciated. >P.S. Please send me e-mail as well as posting to the net if you can. Since no one has responded to you at all, I'll point you to a different way of solving the same problem. In my talk at the last USENIX, I showed a 5-line script to do dial-back. I can't repeat the whole talk here but you can read the paper. It has a slightly longer version of the same script with all the details explained. The paper may be ftp'd as pub/expect.ps.Z from durer.cme.nist.gov. If you cannot ftp, you may request email copies by mailing to "library@ cme.nist.gov". The contects of the message should be (no subject line) "send pub/expect.ps.Z". Don Libes libes@cme.nist.gov ...!uunet!cme-durer!libes ----------------------------- From: Kim Christian Madsen Subject: Re: Curses and the arrow keys Date: 26 Aug 90 22:54:07 GMT To: info-unix@sem.brl.mil mlake@irscscm.UUCP (Marshall Lake) writes: >I am writing a program which will be taking advantage of curses. I am >trying to utilize the arrow keys and am confused (actually all of >curses confuses me). I am doing a getch () and if I get an ESCAPE I do >another getch (). If I addch () for each character I get (the ESCAPE >and the next character) then the cursor moves around properly on the >screen but the x/y coordinates in the window structure do not follow >suit. Curses is recognizing the arrow keys simply as regular >characters. Am I naive in thinking that curses is smart enough to >handle the arrow keys specially? Should I be moving the cursor >manually via the move function? >I'm really not sure I know what I'm talking about when it comes to >curses so any help is appreciated. In the following I suppose that you have System V curses, I'm no real expert on BSD curses. The method you're using to catch the arrow-keys will work only if you know exactly what the arrow-keys send, but hopefully they're described properly in your terminfo database, so you could get the information from there and parse it. But a better way to handle this situation is using the following approach (I assume that we're using stdscr (the default window). ... initscr(); /* Enable curses */ keypad(stdscr,TRUE); /* Enable function-keys */ noecho(); /* Do not echo typed input on screen */ ... switch (ch=getch()) { case KEY_DOWN: /* Down arrow pressed */ .... break; case KEY_UP: /* Up arrow pressed */ ... break; case KEY_LEFT: /* Left arrow pressed */ ... break; case KEY_RIGHT: /* Right arrow pressed */ ... break; default: if ((ch & A_CHARTEXT) != ch) /* Function key was pressed */ else /* Normal character read */ break; } This answers your first question, I hope, as for your second question, whether you have to move the cursor manually, after determining that an arrow key has been pressed. The answer is YES! And the reason is obvious, first only you know that it was an arrow key to curses it was only a sequence of characters. Remember that almost every terminal of a different brand has differing escape sequences associated with the function keys (including arrow keys). Another vital reason for curses to expect you to decide what to do when an arrow-key is pressed, is that you might not always want it just to move the cursor on the screen, you might want to bind the functionality of pulling a menu down, when you hit the down arrow and then in the menu using it to go to the next menu item, or you might want another functionality the authors of curses never dreamed about, even in their nightmares, when designing the system. So the bottom line is: Yes you can easily detect when a function key has been pressed, but then you must decide what you want to do with that information. Best Regards Kim Chr. Madsen ----------------------------- From: rainbow Subject: help: cron runs commands twice (is it timed's fault?) Keywords: cron timed NFS Date: 26 Aug 90 10:56:14 GMT To: info-unix@sem.brl.mil PRELUDE: 1) If this has been subject to the net lately, please write me a short mail. 2) WARNING: If no one can help me further here, I'll post this article to comp.unix.wizards! ;-) The following includes some of my current employers equipment, so I avoid naming any Hard- or Software (forgive me). THE PROBLEM ITSELF: CRON RUNS COMMANDS TWICE We are running a network with about 20 UNIX machines. The networking- software is a NFS-lookalike (based on ethernet,TCP/IP). Now on some machines we have the problem that cron(1M) appears to run some commands twice. For example I have a job that is to be executed once per week, say at friday noon. But then, friday 12:00, cron decides to run my job twice (there are two processes running (different PIDs, of course, but same PPID), I receive two mails and it is logged twice in cron.log). This doesn't happen every friday, nor does it happen on all machines within the network, but unless it does on some. Now an obvious workaround is to have all jobs using some kind of locking machanism (as I have them now), but this is not the kind of solution I am looking for. Up to now, noone could tell me why this silly cron behaves so badly, therefore I decided to post this mail. THE THEORY (OR: DOES CRON REMEBER THE LAST COMMAND IT EXECUTED?): To make it somewhat easier, I already have a theory about what might happen. Even if this is not the reason, it is a possible scenario, that is to be avoided (is it already?). ((Unfortunately I have *absolutely* no UNIX-sourcecode available, so could someone please look up whether cron works the way I believe it to work?)) When cron is running, it wakes up every minute, takes a look at the real-time clock, checks whether there is any work to do, optionally does that work and then puts itself to sleep again. This it probably does using the alarm(2) and pause(2) systemcalls. As far as I know, alarm(2) is implemented the way that it schedules a signal to be sent to the caller in HZ*seconds clockticks. Now this is just what might cause the problem: Everything will work fine, as long as your real-time clock is incremented every HZ clockticks, too. But, as we have all machines *synchronizing their clocks* within our NFS-network, you can't rely on that. On machines that have a faster local clock, it might happen that timed slows down the local clock in order to synchronize it with the others. Therefore a minute might be somewhat longer than 60*HZ clockticks (up to ten percent I think, that were 66*HZ ticks). Now when cron is woken up after 60*HZ clockticks the real-time clock might still show the same time as it did the last time cron woke up. If cron doesn't somehow remember that it already did all scheduled jobs for that time, it will do them once again! THE FINAL QUESTIONS: 1) Has anyone seen the described problem on machines where timed was running? 2) Is this scenario publicly known and solved for a long time? 3) Does timed somehow inform programs like cron about time "changes"? 4) Does cron work that way? Or does it continually sleep until there is some work to be done (this could work on ATT SysV since cron has all necessary tables loaded and could be signaled by crontab(1) or at(1) when someone makes any changes) Or does cron(1M) remember the commands it already started? Please mail me or post your replies to comp.unix.questions. Thanx in advance Joerg (please excuse any mistakes; english is not my native language!) Joerg F. Trinitis Kaerntner Platz 4, 8000 Muenchen 21, West Germany (rainbow@altger.alt.sub.org) BANG: ...uunet!mcvax!unido!altger!rainbow ----------------------------- From: Mike Marcel Jonkmans Subject: spell and /usr/dict/words. Date: 26 Aug 90 23:57:18 GMT Sender: news@cs.vu.nl To: info-unix@sem.brl.mil Allright I had nothing to do and typed for fun the following : (csh)% spell < /usr/dict/words > error (csh)% cat error belying revisable (csh)% What's so special about belying and revisable ?? -- Mike Jonkmans. (mike@cs.vu.nl) ..!uunet!mcsun!botter!mike ----------------------------- From: Caroline Lambert Subject: mysteriously full root partition Date: 27 Aug 90 05:47:31 GMT Sender: USENET News System To: info-unix@sem.brl.mil I have a root partition on a Sun3 that claims to be 110% full - actually 7739 out of 7751 kbytes used. Using 'ls -l' and 'du' I can account for only 6300 kbytes. I have another Sun3 with an almost identical root partition, which does show only 6300 kbytes used. I have halted the system and rebooted it to do an 'fsck', but it still claims to be 110% full. Has anyone come across something like this before? Any pointers would be appreciated. -- Caroline Lambert Department of Geophysics My employer is not AA6BA Stanford University responsible for my caroline@pangea.Stanford.EDU Stanford, CA 94305 irresponsibilities ----------------------------- End of INFO-UNIX Digest ***********************