📄 ckuins.doc
字号:
function does something else or uses some other units of time (like the NCRTower 32, which uses clock-ticks), do not include -DNAP.Reportedly, all versions of System V R4 for Intel-based computers, andpossibly also SVR3.2, include nap() as a kernel call, but it's not in thelibrary. To include code to use it via syscall(3112,x), without having toinclude Xenix compatibility features, include the following compile-timeoption: -DNAPHACKNONDESTRUCTIVE INPUT BUFFER PEEKINGSome AT&T UNIX versions have no way to check if input is waiting on a ttydevice, but this is a very important feature for Kermit. Without it, slidingwindows might not work very well (or at all), and you also have to type yourescape character to get Kermit's attention in order to interrupt a local-modefile transfer. If your system offers an FIONREAD ioctl, the build procedureshould pick that up automatically and use it, which is ideal.If your system lacks FIONREAD but has a select() function, this can be usedinstead. If the build procedure fails to include it (SHOW FEATURES willlist SELECT), then you can add it to your CFLAGS: -DSELECTConversely, if the build procedure tries to use select() when it really isnot there, add: -DNOSELECTNote: select() is not part of System V nor of POSIX, but it has been added tovarious System-V- and POSIX-based systems as an extension.Some System-V variations (SCO Xenix/UNIX/ODT and DIAB DNIX) include a rdchk()function that can be used for buffer peeking. It returns 0 if no charactersare waiting and 1 if characters are waiting (but unlike FIONREAD, it does nottell the actual number). If your system has rdchk(), add: -DRDCHK: Include this in CFLAGS if your system has the rdchk() function.Otherwise, if your version of UNIX has the poll() function (and the/usr/include/poll.h file) -- which appears to be a standard part of System Vgoing back to at least SVR3, include: -DCK_POLLOTHER SYSTEM-DEPENDENT FEATURESSystems with <termios.h> might have the symbol IEXTEN defined. This is usedto turn "extended features" in the tty device driver on and off, such asCtrl-O to toggle output flushing, Ctrl-V to quote input characters, etc.In most UNIX implementations, it should be turned off during Kermit operation,so if ckutio.c finds this symbol, it uses it. This is necessary, at least, onBSDI. On some systems, however, IEXTEN is either misdefined ormisimplemented. The symptom is that CR, when typed to the command processor,is echoed as LF, rather than CRLF. This happens (at least) on Convex/OS 9.1.The solution is to add the following symbol to the makefile entry's CFLACS: -DNOIEXTENHowever, in at least one UNIX implementation, QNX 4.21, IEXTEN must be setbefore hardware flow control can be used.In edits 177 and earlier, workstation users noticed a "slow screen writing"phenomenon during interactive command parsing. This was traced to a setbuf()call in ckutio.c that made console (stdout) writes unbuffered. This setbuf()call has been there forever, and could not be removed without some risk.Kermit's operation was tested on the NeXT in edit 178 with the setbuf() callremoved, and the slow-writing symptom was cured, and everything else (commandparsing, proper wakeup on ?, ESC, Ctrl-U, and other editing characters,terminal emulation, remote-mode and local-mode file transfer, etc) seemed towork as well as or better than before. In subsequent edits, this change wasmade to many other versions too, with no apparent ill effects. To remove thesetbuf() call for your version of Kermit, add: -DNOSETBUFLater reports indicate that adding -DNOSETBUF has other beneficial effects,like cutting down on swapping when Kermit is run on workstations with smallmemories. But BEWARE: on certain small UNIX systems, notably the AT&T 6300and 3B1 (the very same ones that benefit from NOSETBUF), NOSETBUF seems toconflict with CK_CURSES. The program builds and runs OK, but after once usingthe curses display, echoing is messed up. In this case, we use a System-Vspecific variation in the curses code, using newterm() to prevent System Vfrom altering the buffering. See makefile entries for AT&T 6300 and 3B1.The UNIX version of C-Kermit includes code to switch to file descriptor zero(stdin) for remote-mode file transfer. This code is necessary to preventKermit from giving the impression that it is "idle" during file transfers,which, at some sites, can result in the job being logged out in the middle ofan active file transfer by idle-job monitors.However, this feature can interfere with certain setups; for example, there isa package which substitutes a pty/tty pair for /dev/tty and sets filedescriptor 0 to be read-only, preventing Kermit from sending packets. Or...When a UNIX shell is invoked under the PICK environment, file descriptor 0is inoperative.To remove this feature and allow Kermit to work in such environments, add thecompile-time option: -DNOFDZEROOn some versions of UNIX, earlier releases of C-Kermit were reported to rendera tty device unusable after a hangup operation. Examples include IBM AIX onthe RT PC and RS/6000. A typical symptom of this phenomenon is that the DIALcommand doesn't work, but CONNECTing to the device and dialing manually dowork. A further test is to SET DIAL HANGUP OFF, which should make dialingwork once by skipping the pre-dial hangup. However, after the connection isbroken, it can't be used any more: subsequent attempts to DIAL the same devicedon't work. The cure is usually to close and reopen the device as part of thehangup operation. To do this, include the following compile-time option: -DCLSOPNSimilarly, there is a section of code in ttopen(), which does anotherclose(open()) to force the O_NDELAY mode change. On some systems, theclose(open()) is required to make the mode change take effect, and apparentlyon most others it does no harm. But reportedly on at least one System V R4implementation, and on SCO Xenix 3.2, the close(open()) operation hangsif the device lacks carrier, EVEN THOUGH the CLOCAL characteristic has justbeen set to avoid this very problem. If this happens to you, add this toyour CFLAGS: -DNOCOTFMCor, equivalently, in your KFLAGS on the make command line. It stands forNO Close(Open()) To Force Mode Change.C-Kermit renames files when you give a RENAME command and also according tothe current SET FILE COLLISION option when receiving files. The normal UNIXway to rename a file is via two system calls: link() and unlink(). Butthis leaves open a window of vulnerability. Some UNIX systems also offer anatomic rename(oldname,newname) function. If your version of UNIX has thisfunction, add the following to your CFLAGS: -DRENAMEC-Kermit predefines the RENAME for several UNIX versions in ckcdeb.h (SVR4,SUNOS41, BSD44, AIXRS, etc). You can tell if rename() is being used if theSHOW FEATURES command includes RENAME in the compiler options list. If thepredefined RENAME symbol causes trouble, then add NORENAME to your CFLAGS.Trouble includes: 1. Linker complains that _rename is an unresolved symbol. 2. Linking works, but Kermit's RENAME command doesn't work (which happens because older versions of rename() might have their arguments reversed).If rename() is not used, then Kermit uses link()/unlink(), which is equivalentexcept it is not atomic: there is a tiny interval in which some other processmight "do something" to one of the files or links.Some UNIX systems (Olivetti X/OS, Amdahl UTS/V, ICL SVR3, etc) define theS_ISREG and S_ISDIR macros incorrectly. This is compensated for automaticallyin ckufio.c. Other systems might have this same problem. If you get acompile-time error message regarding S_ISREG and/or S_ISDIR, add the followingto your CFLAGS: -DISDIRBUGFinally, here's a symbol you should NEVER define: -DCOMMENTIt's used for commenting out blocks of code. If for some reason you findthat your compiler has COMMENT defined, then add -UCOMMENT to CFLAGS or KFLAGS!Similarly, some header files have been known to define COMMENT, in which caseyou must add "#undef COMMENT" to each C-Kermit source module, after all the#includes.TERMINAL INTERRUPTIONWhen C-Kermit enters interactive command mode, it sets a Control-C (terminalkeyboard interrupt = SIGINT) trap to allow it to return to the command promptwhenever the user types Control-C (or whatever is assigned to be the interruptcharacter). This is implemented using setjmp() and longjmp(). On somesystems, depending on the machine architecture and C compiler and who knowswhat else, you might get "Memory fault (coredump)" or "longjmp botch" insteadof the desired effect (this should not happen in 5A(190) and later). In thatcase, add -DNOCCTRAP to your CFLAGS and rebuild the program.Job control -- the ability to "suspend" C-Kermit on a UNIX system by typingthe "susp" character (normally Ctrl-Z) and then resume execution later (withthe "fg" command) -- is a tricky business. C-Kermit must trap suspend signalsso it can put the terminal back into normal mode when you suspend it (Kermitputs the terminal into various strange modes during interactive commandparsing, CONNECT, and file transfer). Supporting code is compiled intoC-Kermit automatically if <signal.h> includes a definition for the SIGTSTPsignal. HOWEVER... some systems define this signal without supportingjob control correctly. You can build Kermit to ignore SIGTSTP signals byincluding the -DNOJC option in CFLAGS. (You can also do this at runtime bygiving the command SET SUSPEND OFF.) NOTE: As of version 5A(190), C-Kermit makes another safety check. Even if job control is available in the operating system (according to the numerous checks made in congm()), it will still disable the catching of SIGTSTP signals if SIGTSTP was set to SIG_IGN at the time C-Kermit was started.System V R3 and earlier systems normally do not support job control. If youhave an SVR3 system that does, include the following option in your CFLAGS: -DSVR3JCOn systems that correctly implement POSIX signal handling, signals can behandled more reliably than in Bell, Berkeley, or AT&T UNIXes. On systems(such as QNX) that are "strictly POSIX", POSIX signal handling *must* be used,otherwise no signal will work more than once. If you have POSIX-based systemand you find that your version of Kermit responds to Ctrl-C (SIGINT) or Ctrl-Z(SIGTSTP) only once, then you should add the following option to your CFLAGS: -DCK_POSIX_SIGBut be careful; some POSIX implementations, notably 4.4BSD, include POSIXsignal handling symbols and functions as "stubs" only, which do nothing. Lookin <signal.h> for sigsetjmp and siglongjmp and read the comments.DIALING OUT AND COORDINATING WITH UUCPMake sure your dialout line is correctly configured for dialing out (asopposed to login). The method for doing this is different for each kind ofUNIX. Consult your system documentation for configuring lines for dialing out(for example, Sun SPARCstation IPC users should read the section "Setting upModem Software" in the Desktop SPARC Sun System & Network Manager's Guide, orthe Terminals and Modems section of the HP manual, "Configuring HP-UX forPeripherals".Unlike other operating systems, UNIX allows multiple processes to access thesame tty device at the same time, even though there is no earthly reason whytwo processes would want to do this. When they do, process A will read someof the incoming characters, and process B will read the others. In alllikelihood, neither process will see them all. As you can imagine, this cancause enormous difficulties for any communication program.Rather than change UNIX to make exclusive access to tty devices be thedefault, UNIX developers hit upon the idea of a "lock file". Any process thatwants to open a tty device should first check and see if a file of a certainname exists, and if so, not to open the device. If the file does not exist,the process creates the file and then opens the device. When the processcloses the device, it destroys the lockfile. This procedure was originatedfor use with UNIX's UUCP, CU, and TIP programs, and so these lockfiles arecommonly called "UUCP lockfiles" (UUCP = UNIX-to-UNIX Copy Program).As you can imagine, this method is riddled with pitfalls: - If a process does not observe the prevailing lockfile convention, then it can interfere with other "polite" processes. - If a process crashes while it has the device open, the lockfile is left behind, preventing further processes from using the device. - Various versions of UNIX use different names for the lockfiles, put them in different directories, and specify their contents differently. - On a given system, the lockfile conventions may change from one UNIX release to the next (for example, SunOS 4.0 to 4.1). - The same tty device might have more than one name, and most lockfile conventions don't allow for this.In order to fit in with UUCP and other UNIX-based communication software,C-Kermit must have the same idea as your system's uucp, cu, and tip programsabout what the UUCP lock directory is called, what the lockfile itself iscalled, and what its contents should be. In most cases, Kermit tries tofigure this out automatically (see ckutio.c). The following CFLAGS optionscan be used to override C-Kermit's normal assumptions: -DLCKDIR: Tells Kermit that the UUCP lock directory is /usr/spool/uucp/LCK. -DACUCNTRL: Tells Kermit to use the BSD 4.3 acucntrl() program
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -