home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / CNEWS / _CNEWS.TAR / usr / doc / cnews / docs / problems < prev    next >
Encoding:
Text File  |  1994-09-02  |  31.6 KB  |  1,130 lines

  1. .Ch "Known Porting Problems With C News"
  2. .Ix problems porting
  3. .SH
  4. Intro
  5. .PP
  6. C News
  7. in general is pretty portable.
  8. People have got it to run on a very wide range of systems with little
  9. trouble.
  10. Difficulties are usually problems in the system,
  11. not
  12. C News.
  13. Some of them,
  14. however,
  15. are widespread enough to be worth comment,
  16. for
  17. the guidance of people having problems.
  18. If you run into a novel problem,
  19. we are always interested in hearing about such things.
  20. .SH
  21. Unix Dependencies
  22. .PP
  23. The biggest portability glitch in
  24. C News
  25. is that it depends a lot on
  26. Unix
  27. utilities.
  28. The extensive use of complex shell files,
  29. \fIsed\fR and \fIawk\fR programs,
  30. and a wide range of lesser Unix utilities would make it quite difficult
  31. to move
  32. C News
  33. to a system that is seriously non-Unix-like.
  34. The actual C programs seldom depend on Unix in major ways.
  35. (An exception is the use
  36. of \fIread\fR system calls in \fIexpire\fR,
  37. to avoid difficulties with
  38. stdio end-of-file behavior;
  39. we now know how to avoid this but haven't implemented the fixes yet.)
  40. .PP
  41. .Ix Unix Minix
  42. .Ix Unix utilities
  43. .Ix sed
  44. .Ix awk
  45. We know that \fIawk\fR and the colon (:) operator of \fIexpr\fR are
  46. problem areas under Minix.
  47. .SH
  48. Shell Problems
  49. .PP
  50. C News seriously stress-tests shells.
  51. The current Minix shell is not robust enough
  52. in the face of complex inputs,
  53. botches some constructs entirely,
  54. and can run out of memory on the complex shell files.
  55. Any shell that is too old to implement comments begun
  56. by ``#'' is big trouble,
  57. since we use such comments everywhere.
  58. .PP
  59. Any system/shell combination that thinks that a shell script starting
  60. with ``#!\ /bin/sh'' should be run by the C Shell (because it starts
  61. with `#') is also big trouble:
  62. you will have to change that line to ``:\ use\ /bin/sh'' everywhere.
  63. We know that at least some releases of Xenix have this problem.
  64. It is not necessary that your kernel understand the ``#!'' feature\(emwe
  65. believe that nothing in C News relies on it\(embut it is essential that
  66. it not cause invocation of the C Shell.
  67. .PP
  68. We know that some Hewlett-Packard Unixes have broken shells,
  69. probably
  70. the result of mistakes in
  71. HP's efforts to make
  72. the shell 8-bit-clean;
  73. the symptom is
  74. that something like:
  75. .DS
  76. .ft B
  77. x=y
  78. if test " $x" != " y"
  79. then
  80.     echo oops
  81. fi
  82. .ft
  83. .DE
  84. prints ``oops''.
  85. This is,
  86. again,
  87. big trouble,
  88. because we do that a lot.
  89. .PP
  90. .Ix machines 3b1
  91. .Ix 3b1
  92. Many people using 3B1s,
  93. aka UNIX PCs,
  94. run the Korn shell as their \fI/bin/sh\fR.
  95. .Ix shell Korn
  96. .Ix ksh
  97. Some other folks may do this too.
  98. Beware that \fIksh\fR was not fully \fIsh\fR-compatible for a
  99. long time,
  100. with some subtle differences in the
  101. ill-documented behavior of backquotes and backslashes.
  102. Some of the C News shell scripts,
  103. notably \fIinews\fR,
  104. are known to hit these bugs.
  105. We are \fItold\fR that current \fIksh\fRs have fixed them.
  106. .PP
  107. .Ix Unix SunOS 4.0
  108. It is reliably reported that SunOS 4.0.\fIx\fR shells will dump core
  109. in some ill-defined circumstances,
  110. when the user environment (sum of all
  111. environment variables) is exactly the wrong size.
  112. Perhaps this has been fixed in 4.1.
  113. .PP
  114. .Ix Unix "Ultrix 3.1"
  115. It is reliably reported that the VAX 3.1 Ultrix shell is somewhat broken
  116. and gives various kinds of trouble.
  117. Switching to \fI/bin/sh5\fR
  118. (note that this requires fixing the first line
  119. of a zillion shell files)
  120. is reported to banish the problems.
  121. .PP
  122. .Ix wait
  123. .Ix breakage wait
  124. .Ix inews
  125. .Ix NNTP
  126. It is reliably reported that recent SunOS shells give the wrong exit status
  127. from the \fIwait\fR command:
  128. they give a 0 for a successful wait, rather than giving the exit status of
  129. the process waited for.
  130. This makes \fIinews \-W\fR appear to always succeed even if backgrounded
  131. parts of it failed, which can be troublesome in NNTP environments where
  132. correct exit status is important.
  133. .SH
  134. Make Problems
  135. .PP
  136. .Ix make
  137. .Ix machines 3b2
  138. .Ix 3b2
  139. .Ix SVID
  140. .Ix Unix A/UX
  141. There is a persistent problem on 3B2s with implementations of \fImake\fR
  142. that violate the SVID in a subtle way.
  143. They attempt to execute makefile commands directly,
  144. rather than via the
  145. shell,
  146. if the commands do not contain metacharacters.
  147. This means that if\(emas on many 3B2s\(em\fItest\fR is a shell builtin
  148. \fIand there is no /bin/test program\fR,
  149. the makefile line
  150. ``test\ \-s\ file'' will cause \fImake\fR to complain about an unknown
  151. command.
  152. (The SVID says that makefile commands must be executed as if by
  153. the shell, and the shell will execute this line correctly.)
  154. We've added `;' on the ends of such lines,
  155. which suffices to convince
  156. \fImake\fR to run a shell on the systems we've encountered,
  157. but AT&T
  158. is good at finding ways to break such workarounds.
  159. This problem is also known to occur in A/UX.
  160. .PP
  161. .Ix Unix Ultrix
  162. Another obscure problem,
  163. a bug in either \fImake\fR or the shell,
  164. appears
  165. in at least some releases of Ultrix:
  166. a construct like
  167. .DS
  168. .ft B
  169.     ln ... || cp ...
  170. .ft
  171. .DE
  172. in a shell file is seen as an error\(emand \fImake\fR aborts\(emwhen
  173. the \fIln\fR fails,
  174. even though the \fIcp\fR would work.
  175. .SH
  176. Offsetof
  177. .Ix offsetof
  178. .Ix "ANSI C"
  179. .PP
  180. ANSI C requires C compilers to supply a macro \fIoffsetof\fR,
  181. which can
  182. be used to find the offset of a structure member within the structure.
  183. \fIRelaynews\fR's header-parsing code uses it,
  184. defining it if the system has not supplied it.
  185. Unfortunately,
  186. it is really hard to write a portable version of this.
  187. The implementation we currently use is:
  188. .DS
  189. .ft B
  190. #define offsetof(type, mem) ((char *)&((type *)NULL)\->mem \- (char *)NULL)
  191. .ft
  192. .DE
  193. The table in \fIrelay/hdrdefs.c\fR
  194. .Ix initializers
  195. .Ix hdrdefs.c
  196. puts invocations of \fIoffsetof\fR in initializers.
  197. This turns out to be a severe stress test for C compilers.
  198. A compilation error in \fIhdrdefs.c\fR is almost certain
  199. to be problems with this macro.
  200. Some compilers,
  201. notably the one in Microport System V for the 286,
  202. .Ix Unix "Microport System V for the 286"
  203. reject it.
  204. We have heard a report that System V Release 2 on the VAX silently
  205. miscompiles it!
  206. .Ix Unix "System V Release 2 on the VAX"
  207. If you have trouble with \fIoffsetof\fR,
  208. you might try this version instead:
  209. .DS
  210. .ft B
  211. #define offsetof(type, mem) ((int)&((type *)NULL)\->mem)
  212. .ft
  213. .DE
  214. .SH
  215. Fast Stdio Routines
  216. .Ix stdio "faster internals"
  217. .Ix problems stdio
  218. .PP
  219. We supply a set of fast standard-I/O routines that are compatible with
  220. most AT&T-derived implementations of \fIstdio\fR.
  221. They speed up C News quite a bit.
  222. However,
  223. they don't work on all Unixes.
  224. The tester program we supply,
  225. which the library-build procedure runs,
  226. is thought to diagnose such problems 100% of the time.
  227. It has been reported in the past that A/UX and Microport 386 stdios
  228. .Ix Unix A/UX
  229. .Ix Unix "Microport 386"
  230. flunk the test.
  231. SunOS 4.0 used to pass the test falsely,
  232. but improvements in both
  233. the test and the routines
  234. seem to have cured the problems:
  235. 4.0.3 passes the test and
  236. as far as we can tell,
  237. the routines run correctly under it.
  238. .PP
  239. In any case,
  240. if you are feeling nervous or are having mysterious problems,
  241. telling \fIbuild\fR that you don't want to use the fast-stdio stuff is
  242. always safe.
  243. This is also the best response if you have trouble compiling those routines.
  244. .SH
  245. void
  246. .Ix void
  247. .Ix "old compilers"
  248. .PP
  249. Old compilers that don't understand the \fIvoid\fR type will choke on
  250. much of our code.
  251. .Ix news.h
  252. There is a commented-out ``#define\ void\ int'' in \fInews.h\fR that
  253. cures most cases of this if you uncomment it.
  254. (We have a report that you might need to add ``\-Dvoid=int'' to the
  255. Makefile in \fIlibv7\fR if you're using that library.)
  256. C News does not rely on the ANSI C ``void\ *'' type as far as we know.
  257. .SH
  258. Modes in fopen
  259. .Ix fopen
  260. .Ix Unix Minix
  261. .PP
  262. Unix V7 documented only ``r'',
  263. ``w'',
  264. and ``a'' as suitable mode arguments
  265. to \fIfopen\fR.
  266. It actually implemented the read/write modes,
  267. ``r+'',
  268. ``w+'',
  269. and ``a+'',
  270. as well,
  271. and C News relies on them.
  272. Unix reimplementations based on old documentation may have trouble here;
  273. we know that at least the older versions of Minix really don't implement
  274. these modes.
  275. .PP
  276. A related complication in Minix is that \fIftell\fR
  277. reportedly doesn't give the
  278. right answer in ``a'' mode.
  279. This makes \fIdbz\fR flunk its regression test.
  280. .Ix dbz
  281. .SH
  282. MAXLONG
  283. .Ix MAXLONG
  284. .Ix Unix Unisys
  285. .PP
  286. The \fIrelay/cpu.h\fR file formerly defined a constant \fIMAXLONG\fR
  287. which is the biggest positive value of a \fIlong\fR.
  288. The definition was clever but failed on some odd systems (Unisys?).
  289. Current versions of C News
  290. generate the value dynamically in a less fallible way,
  291. and check the value for plausibility.
  292. (This is encountered when \fIrelaynews\fR is asked to
  293. process a single article,
  294. not a batch.
  295. This happens primarily when an article is posted locally,
  296. with \fIinews\fR.)
  297. .Ix inews
  298. It is still barely possible that the plausibility check will fail on some
  299. bizarre system.
  300. .SH
  301. df Output Format
  302. .Ix df
  303. .PP
  304. .Ix spacefor
  305. The \fIspacefor\fR utility needs to understand the output format of \fIdf\fR,
  306. unless you're lucky enough to have a system that has one of the semi-standard
  307. system calls to report disk space.
  308. There are numerous variations on \fIdf\fR.
  309. \fIBuild\fR and the relevant makefiles know about the more common ones,
  310. but customization may be necessary.
  311. \fISpacefor\fR is commented well enough that it should be possible to
  312. figure out the necessary changes;
  313. usually the initializations of \fInr\fR
  314. and \fInf\fR are all that need changing.
  315. If there are colons (:)
  316. in your \fIdf\fR's output format,
  317. you should
  318. probably start from the ``sysv'' \fIspacefor\fR,
  319. which attempts to
  320. preprocess the output to get rid of System V garbage;
  321. .Ix Unix "System V"
  322. .Ix "System V" breakage
  323. otherwise the ``bsd'' one is a reasonable starting point.
  324. .PP
  325. One constant nuisance is \fIdf\fRs that are too stupid to take a directory
  326. name as an argument.
  327. The long-term solution to this is to edit a suitable variant of \fIspacefor\fR
  328. to know about the proper arguments.
  329. A short-term solution is to use the ``null'' variant, sacrificing space
  330. checking for the sake of getting something working.
  331. .PP
  332. .Ix Unix HP-UX
  333. We're told that HP-UX 7.0 users are best advised to
  334. choose the ``bsd'' variant of spacefor,
  335. and edit it to
  336. call \fIbdf\fR instead of \fIdf\fR.
  337. Similar approaches may be useful on other hybrid SysV/BSD systems.
  338. .SH
  339. Floating Point
  340. .Ix "floating point"
  341. .Ix expire
  342. .Ix awk
  343. .PP
  344. The only places in our code where floating point is used,
  345. as far as we know,
  346. are in the calculation of expiry dates in \fIexpire\fR
  347. and the calculation of space in some of the variants of \fIspacefor\fR.
  348. These are not performance bottlenecks,
  349. so slow floating-point arithmetic
  350. is not a problem.
  351. Complete absence of floating point would require only minor modifications.
  352. Note,
  353. however,
  354. that we use \fIawk\fR a lot,
  355. and the typical \fIawk\fR
  356. implementation uses floating point extensively.
  357. .SH
  358. 386 Optimizer vs. dbz
  359. .Ix machines 386
  360. .Ix dbz
  361. .Ix problems "broken 386 optimiser"
  362. .Ix Unix "System V"
  363. .Ix "System V" breakage
  364. .Ix Unix "SCO Xenix/386 2.3"
  365. .PP
  366. We have a reliable report that the System V 386 optimizer
  367. (invoked when
  368. \fIcc\fR is given the \fB\-O\fR option)
  369. miscompiles the \fIdbz\fR package
  370. badly enough to cripple it,
  371. without producing any error messages.
  372. The only fix is to compile \fIdbz\fR without \fB\-O\fR.
  373. .PP
  374. SCO Xenix/386 2.3 has the same problem.
  375. .SH
  376. nnafree and nnfree
  377. .Ix nnafree
  378. .Ix nnfree
  379. .Ix machines HP
  380. .PP
  381. We have a reliable report that
  382. the HP Spectrum C compiler has an optimiser bug that makes it throw up
  383. (with a 
  384. ``cc: Internal error 3279: Please contact your local HP representative''
  385. message)
  386. on the \fInnafree\fR macro
  387. (and \fInnfree\fR, a historical synonym)
  388. in \fIh/news.h\fR.
  389. .Ix news.h
  390. The following revised version of
  391. the macro reportedly avoids
  392. the problem.
  393. .DS
  394. .ft B
  395. #define nnafree(mempp) do { if (*(mempp) != 0) { free((char *)*(mempp)); \e
  396.    *(mempp) = 0; }} while (0)
  397. .ft
  398. .DE
  399. .PP
  400. .Ix Unix Microport
  401. It is also reliably reported that the Microport compiler objects to
  402. these macros in large model.
  403. Whether the above fix would suffice is not known.
  404. Manual expansion
  405. [barf!]
  406. is known to work,
  407. although it would be less
  408. painful to define a function containing the right code and change the
  409. macro to call the function.
  410. Code for a suitable function can,
  411. in fact,
  412. be found
  413. in \fIh/news.h\fR,
  414. inside `#ifdef\ lint'.
  415. .SH
  416. ANSI C
  417. .Ix "ANSI C"
  418. .PP
  419. Although we made an effort to be ANSI-C compatible,
  420. lack of access to a real ANSI C compiler limits our ability to do this.
  421. A secondary problem is that it's really very difficult to get code that
  422. is 100% acceptable to both ANSI C compilers and older compilers.
  423. Some issues inevitably got resolved in favor of current compilers,
  424. and may cause complaints from ANSI C compilers.
  425. .PP
  426. Work is in progress on moving us closer to ANSI compatibility.
  427. Beware that if \fB__STDC__\fR is defined
  428. .Ix __STDC__
  429. by your compiler but it is \fInot\fR ANSI compatible, you are on your
  430. own as far as we're concerned, even if the value is specified as 0.
  431. (We can't just use ``#if\ __STDC__'' because some preprocessors choke
  432. on the appearance of an unknown identifier in #if.)
  433. .SH
  434. GNU C
  435. .Ix "GNU C"
  436. .PP
  437. If compiling with the GNU compiler,
  438. you may need the
  439. \fB\-traditional\fR flag.
  440. Beware,
  441. also,
  442. that if you are using your system's \fIdbm\fR library,
  443. it contains functions that return structure values,
  444. and the GNU conventions
  445. for handling such values are incompatible with the ones in many AT&T-derived
  446. compilers.
  447. The
  448. \fB\-fpcc-struct-return\fR option cures this.
  449. .SH
  450. Awk Problems
  451. .Ix awk
  452. .PP
  453. A number of problems can arise if your \fIawk\fR has bugs,
  454. since the shell
  455. files rely on \fIawk\fR fairly extensively.
  456. For example,
  457. \fIawk\fR is a prime suspect if \fIspacefor\fR doesn't work.
  458. We've fixed the worst trouble spots,
  459. but would appreciate detailed information
  460. on any more.
  461. .PP
  462. .Ix awk "line length limits"
  463. One known problem that is hard to avoid is line-length limits in \fIawk\fR.
  464. In particular,
  465. for several purposes in control-message
  466. handling C News wants to build a ``canonical'' representation
  467. of the \fIsys\fR file,
  468. with backslashed newlines removed.
  469. This is done by
  470. NEWSBIN\fI/relay/canonsys.awk\fR.
  471. .Ix canonsys.awk
  472. Most \fIawk\fRs have limits
  473. on line length,
  474. and some of the limits are too low to cope with long
  475. multiply-continued \fIsys\fR lines.
  476. 512-byte limits,
  477. found in a number of old \fIawk\fRs,
  478. are particularly troublesome.
  479. A quick look indicates that this will interfere,
  480. to some uncertain extent,
  481. with \fIcheckgroups\fR and \fIsendsys\fR.
  482. .Ix checkgroups
  483. .Ix "control messages" checkgroups
  484. .Ix sendsys
  485. .Ix "control messages" sendsys
  486. Big deal. :-)
  487. The complaint may also appear from
  488. \fInewgroup\fR,
  489. .Ix newgroup
  490. .Ix "control messages" newgroup
  491. but there it should be harmless.
  492. .PP
  493. .Ix Unix HP-UX
  494. Bart Muyzer and Martijn
  495. Roos Lindgreen report that HP-UX 8.0 \fIawk\fR is badly broken,
  496. such that
  497. (for example)
  498. the regular expression ``/[\et ]/'' will match backslashes
  499. and t's as well as tabs and spaces.
  500. Installing the HP-UX 7.0 \fInawk\fR as \fIawk\fR is reportedly a workable
  501. fix.
  502. .SH
  503. Systems Without Hard Links
  504. .Ix links
  505. .PP
  506. .Ix Unix unoid
  507. Some vaguely Unixoid systems have trouble implementing real (``hard'') links.
  508. Examples are VMS in general and Eunice in particular.
  509. .Ix VMS
  510. .Ix Eunice
  511. There are some hooks for dealing with this,
  512. but it's not trivial.
  513. .PP
  514. .Ix relaynews
  515. \fIRelaynews\fR will try to make symbolic links if real ones fail.
  516. There is one exception:
  517. if \fIrelaynews\fR cannot buffer up enough of the article in memory to
  518. find the `Newsgroups:' line,
  519. it will drop the article into a temporary
  520. file and will rely on being able to move that to the first of the
  521. `real' locations by manipulating links.
  522. This should essentially never happen except on 16-bit machines,
  523. and should be rare even on them.
  524. .PP
  525. .Ix expire
  526. \fIExpire\fR has a \fB\-l\fR option which
  527. tells it to consider the first filename of an article its `leader',
  528. not expiring the article under that name until it has expired under
  529. all others.
  530. This has not been tested much recently.
  531. .PP
  532. .Ix lock
  533. The locking system (both C routines and the \fInewslock\fR program)
  534. will need revision in some system-dependent way to avoid use of links.
  535. .PP
  536. There is one minor use of links in installation
  537. (\fIinews\fR is found
  538. in two places,
  539. and the Makefile attempts a link before doing a copy),
  540. and substantially more in the regression tests.
  541. .SH
  542. 16-bit Machines
  543. .Ix machines small
  544. .Ix machines PDP-11
  545. .PP
  546. C News
  547. has been tested on 16-bit machines\(emindeed,
  548. a good bit of the
  549. early development work was done on one\(emand does run on them.
  550. Nothing relies on ints being 32 bits.
  551. Nothing relies on pointers and ints being the same size,
  552. as far as we know.
  553. Nothing relies on large address spaces,
  554. although one or two modules come in separate small-space and large-space
  555. versions,
  556. and the small-space versions are slower.
  557. .PP
  558. However,
  559. there are some fundamental limits
  560. to consider.
  561. Both \fIrelaynews\fR and \fIexpire\fR\(emthe usual trouble spots for
  562. space shortages\(emwant to keep lots of stuff in core.
  563. There isn't any easy way around this one.
  564. .SH
  565. Number of File Descriptors
  566. .Ix "file descriptors"
  567. .PP
  568. There is a constant,
  569. NOPENBFS,
  570. in \fIrelay/trbatch.c\fR,
  571. .Ix relay/trbatch.c
  572. .Ix relaynews
  573. that defines
  574. how many batch files are kept open simultaneously.
  575. If you are feeding much news to more systems than this,
  576. \fIrelaynews\fR performance will suffer.
  577. .PP
  578. .Ix NOPENBFS
  579. The major limit on NOPENBFS is available file descriptors
  580. (although on a 16-bit machine there might also be a shortage of memory
  581. for \fIstdio\fR buffers).
  582. Other parts of \fIrelaynews\fR want perhaps 10 file descriptors for
  583. other purposes,
  584. so with the usual total supply of 20,
  585. a NOPENBFS value
  586. of 10 is the right default.
  587. If you feed many people,
  588. and your kernel provides a process with more than 20 file
  589. descriptors,
  590. you probably want to boost
  591. NOPENBFS (this can be done with -DNOPENBFS=xxx in the makefile).
  592. Remember to leave about 10 descriptors worth of headroom.
  593. .SH
  594. Shell Processing Order
  595. .Ix shell
  596. .Ix problems shell
  597. .PP
  598. Normally,
  599. shell
  600. variable expansion should take place before scanning for syntax
  601. elements such as ``0<&1''.
  602. At least one reimplementation of the shell
  603. (specifically, Bash 1.04)
  604. does things in the
  605. wrong order.
  606. This is known to affect,
  607. at least,
  608. \fIrelay/sh/anne.jones\fR,
  609. .Ix anne.jones
  610. which can be fixed by changing (circa line 44)
  611. .DS
  612. .ft B
  613. "")    USER="`who am i <&$fd |
  614. .ft
  615. .DE
  616. to
  617. .DS
  618. .ft B
  619. "")    USER="`eval \e"who am i <&$fd\e" |
  620. .ft
  621. .DE
  622. or so we are told.
  623. .SH
  624. Binary-Mode Fopen
  625. .Ix fopen
  626. .Ix "ANSI C"
  627. .Ix dbz
  628. .PP
  629. In several places,
  630. the new
  631. \fIdbz\fR
  632. uses ANSI C ``binary mode'' fopen codes,
  633. e.g.
  634. `fopen(...,\ "r+b")'.
  635. The text/binary distinction involved is meaningless
  636. under Unix,
  637. and most Unix implementations just ignore trailing nonsense in
  638. the second argument of
  639. \fIfopen\fR,
  640. so it all works out nicely.
  641. .PP
  642. .Ix Unix Ultrix
  643. Unfortunately... at least one version of DEC's Ultrix objects to the `b's,
  644. we are told.
  645. Sigh.
  646. DEC will have to fix this to make their systems ANSI
  647. compatible,
  648. but heaven only knows how long that will take.
  649. .PP
  650. Meanwhile,
  651. the fix is to delete the `b's in the second arguments of the
  652. \fIfopen\fRs
  653. in three places in
  654. \fIdbminit()\fR
  655. in
  656. \fIdbz/dbz.c\fR,
  657. if your system has
  658. this particular bit of brain damage.
  659. .SH
  660. size_t
  661. .Ix problems size_t
  662. .Ix size_t
  663. .Ix Unix Microport
  664. .PP
  665. Some systems,
  666. notably from Microport,
  667. do not define the
  668. \fIsize_t\fR type in the \fI<sys/types.h>\fR header.
  669. Worse,
  670. the \fIsize_t\fR in that header doesn't necessarily bear any
  671. relationship to the ANSI C \fIsize_t\fR.
  672. This causes trouble in the \fIdbz\fR library in particular.
  673. The proper type for \fIsize_t\fR is whatever the C \fIsizeof\fR
  674. operator returns,
  675. nominally an unsigned type which is large enough to
  676. contain the size of any memory object.
  677. We think nothing relies too heavily on it being unsigned.
  678. Note that \fIsize_t\fR must also be suitable for use in the two middle
  679. arguments of \fIfread\fR and \fIfwrite\fR,
  680. the last argument of
  681. \fImemcpy\fR,
  682. \fImemchr\fR,
  683. and \fImemcmp\fR,
  684. and the argument of \fImalloc\fR.
  685. .SH
  686. Background Processes vs. csh
  687. .Ix shell C
  688. .Ix csh
  689. .Ix problems csh
  690. .Ix inews
  691. .PP
  692. \fIInews\fR runs much of its processing in the background.
  693. We are told that this can hit problems,
  694. in some circumstances,
  695. with \fIcsh\fR's manipulations of signals,
  696. terminal modes,
  697. etc etc.
  698. We prefer a standard shell,
  699. and have made no attempt to understand the
  700. C shell's weirdnesses.
  701. We're aware that well-written programs can fail
  702. under the C shell due to bizarre problems with weird signals,
  703. etc.,
  704. but
  705. we class this as the fault of the C shell and its co-conspirators and
  706. decline to contort our programs to compensate for its failings.
  707. We do
  708. sympathize with people victimized by it,
  709. but can be of no practical help.
  710. .SH
  711. Compress Behavior
  712. .Ix compress
  713. .Ix problems compress
  714. .Ix batcher
  715. .PP
  716. Extremely old (pre-1985) versions of \fIcompress\fR run off at the mouth
  717. with a status message
  718. on \fIstderr\fR even when nothing goes wrong in the compression.
  719. This upsets the batcher,
  720. which thinks any \fIstderr\fR output means trouble.
  721. .SH
  722. ulimit
  723. .Ix ulimit
  724. .Ix problems ulimit
  725. .Ix Unix "System V"
  726. .Ix "System V" breakage
  727. .PP
  728. Most versions of System V have the concept of \fIulimit\fR,
  729. a per-process limit on how big an individual file can be.
  730. This limit can be lowered by anyone but raised only by the super-user;
  731. normally \fIinit\fR or \fIlogin\fR initializes it to some suitable value.
  732. Unfortunately,
  733. many System Vs set it far too low,
  734. at 1 megabyte.
  735. This causes trouble with many things,
  736. but in particular,
  737. .Ix relaynews
  738. .Ix expire
  739. \fIrelaynews\fR,
  740. \fIexpire\fR, etc.
  741. need to be able to work with the \fIhistory\fR file,
  742. .Ix history
  743. which can easily be several megabytes.
  744. It's necessary to deal with this on all paths by which
  745. any of these programs might be invoked:
  746. from \fIuucp\fR or other transport software bringing in news,
  747. from \fIcron\fR,
  748. .Ix cron
  749. and by users via \fIinews\fR for local postings.
  750. .Ix inews
  751. It is difficult to do this in a portable way when super-user privileges
  752. are needed.
  753. .SH
  754. Restricted Shells
  755. .Ix shell restricted
  756. .Ix problems "restricted shells"
  757. .Ix Unix "System V"
  758. .Ix "System V" breakage
  759. .PP
  760. There is an unfortunate interaction between the `#!' feature in shell files
  761. and the ``restricted shell'' feature found in some Unixes
  762. (notably System V):
  763. the restricted shell typically is just a different way of invoking
  764. \fI/bin/sh\fR,
  765. and in some versions,
  766. careless code just checks the first
  767. letter of the name the shell was invoked under to see if it was `r'.
  768. Unfortunately,
  769. if the system has the `#!' feature and there is a shell
  770. file named,
  771. say,
  772. .Ix rnews
  773. \fIrnews\fR whose first line is `#!\ /bin/sh',
  774. this shell file will end up invoking the restricted shell!
  775. .PP
  776. Simply deleting the `#!' line might fix this;
  777. on systems which have the
  778. Korn shell,
  779. .Ix shell Korn
  780. .Ix /bin/ksh
  781. changing `#!\ /bin/sh' to `#!\ /bin/ksh' might work.
  782. Otherwise you will have
  783. .Ix cunbatch
  784. to arrange to have your neighbors invoke \fIcunbatch\fR instead of
  785. \fIrnews\fR, or else write a simple \fIrnews\fR that invokes the real
  786. one under another name.
  787. It would be wise to check for other shell files whose names begin with `r',
  788. also,
  789. as \fIrnews\fR definitely isn't the only one.
  790. .SH
  791. Remote Invocation vs. Nonstandard Shells
  792. .Ix shell non-standard
  793. .Ix problems "non-standard shells"
  794. .Ix rsh
  795. .\" thanks to Paul Eggert for most of this
  796. .PP
  797. When \fInewsrun\fR is invoked on a host that is not the news server,
  798. it uses \fIrsh\fP to propagate news batches to the server.
  799. It runs \fI/bin/sh\fR explicitly to avoid major difficulties with
  800. non-standard shells,
  801. but it has to rely on the invoker's login shell to run that one command.
  802. This means \fInewsrun\fR will emit spurious output
  803. if its invoker's login shell is the C shell
  804. and its invoker's \fI.cshrc\fR contains commands that generate output.
  805. A similar problem occurs with \fIbash\fP and \fI.bashrc\fP.
  806. .Ix bash
  807. .Ix shell bash
  808. .Ix csh
  809. .Ix shell C
  810. .PP
  811. The simplest solution is to use \fI/bin/sh\fP
  812. as the login shell for \fInewsrun\fP's invoker.
  813. Otherwise,
  814. if you have a networked news server,
  815. check that the login shell is standard enough to invoke \fI/bin/sh\fP
  816. by executing the following command as \fInewsrun\fP's invoker.
  817. .DS
  818. .ft B
  819. rsh \fInewsserver\fP exec /bin/sh \-c true
  820. .ft
  821. .DE
  822. This command should output nothing.
  823. .PP
  824. .Ix Unix "System V"
  825. .Ix "System V" breakage
  826. A slightly related problem is that not everyone calls the run-remote-shell
  827. command \fIrsh\fR;
  828. on System V in particular,
  829. \fIrsh\fR means something
  830. different.
  831. For the moment we have opted to ignore this issue,
  832. as the possibilities
  833. for gratuitous differences boggle the mind.
  834. People facing this problem may wish to place an
  835. \fIrsh\fR shell file in the search path to invoke the right command in the
  836. right way,
  837. whatever that is.
  838. .SH
  839. Values of Logical Operators
  840. .Ix "broken compilers"
  841. .Ix problems "broken compilers"
  842. .Ix Unix Ultrix
  843. .PP
  844. There seem to
  845. be compilers,
  846. e.g. the Ultrix one on DEC's new RISC workstations,
  847. that go into convulsions when they see something like
  848. .DS
  849. .ft B
  850. *p++ = isascii(c) && isalnum(c);
  851. .ft
  852. .DE
  853. because they don't know how to generate a numeric value for `&&',
  854. or because they don't know how to turn that value into a `char'.
  855. One or two places in
  856. C News
  857. use constructs like this.
  858. If you run into this,
  859. you might
  860. want to try replacing the
  861. right-hand side
  862. with something like ``(...)\ ?\ 1\ :\ 0'' to get the
  863. troublesome operator back into a conditional context.
  864. .SH
  865. Empty Lines
  866. .Ix "empty lines"
  867. .Ix problems "empty lines"
  868. .Ix relaynews
  869. .PP
  870. Some backward operating systems
  871. (through which your
  872. C News
  873. distribution
  874. may have passed on its way to you),
  875. and perhaps some stupid text-handling
  876. software even on sane operating systems,
  877. do not recognize the notion of
  878. an empty line.
  879. They think all lines must have at least one character in them;
  880. the closest
  881. they can come to an empty line is a line consisting of a single blank.
  882. This matters because \fIrelaynews\fR will tolerate white space only in
  883. certain places in the \fIsys\fR file,
  884. and in particular,
  885. it tolerates
  886. empty lines but not lines consisting solely of white space.
  887. The result will be complaints (in \fIerrlog\fR)
  888. about white space in
  889. the \fIsys\fR line for a system named ``\ ''.
  890. .SH
  891. active-File Date
  892. .Ix problems "broken file systems"
  893. .Ix "broken file systems"
  894. .Ix Unix "Bull DPX/2 B.O.S. 1.0"
  895. .Ix relaynews
  896. .Ix active
  897. .Ix files active
  898. .\" thanks to Simon J. Gerraty for this weirdie
  899. .PP
  900. On some Bull systems, at least ones running DPX/2 B.O.S. 1.0,
  901. apparently \fIrelaynews\fR updates the
  902. contents of the \fIactive\fR file correctly, but the file's date remains
  903. unchanged!
  904. This appears to be a kernel bug.
  905. It reportedly upsets some news readers.
  906. A workaround, said to be effective, is to add the line
  907. .DS
  908. .ft B
  909. utime(ctlfile(actrelnm), (time_t *)NULL);
  910. .ft
  911. .DE
  912. after the call to \fInnafree\fR in \fIactfsync\fR
  913. in \fIlibbig/active.big.c\fR.
  914. .Ix active.big.c
  915. .SH
  916. enum Operators
  917. .Ix "broken compilers"
  918. .Ix problems "broken compilers"
  919. .Ix readnews
  920. .\" thanks to Scott Reynolds for this one
  921. .PP
  922. Some compilers have difficulty compiling the
  923. \fIreadnews\fR we supply,
  924. because they object to applying the `!' operator to an \fIenum\fR type.
  925. Changing the definition of \fIbooltype\fR in \fIrna/defs.h\fR to
  926. .DS
  927. .ft B
  928. typedef int bool;
  929. #define    false    0
  930. #define    true    1
  931. .ft
  932. .DE
  933. is reported to solve this.
  934. .SH
  935. Amiga Library Ordering
  936. .Ix Unix "Amiga System V Release 4"
  937. .Ix problems "amiga loading"
  938. .PP
  939. It is reliably reported that when compiling some of the programs under
  940. SVR4 on the Amiga,
  941. it is necessary to give ``\-lc \-lucb'' as library
  942. options\(emlinking of the C library \fImust\fR precede linking of the
  943. Berkeley-emulation library,
  944. or the code links but will not run.
  945. .SH
  946. AIX and Mach vs. fsync()
  947. .Ix fsync
  948. .Ix problems fsync
  949. .Ix Unix AIX
  950. .Ix Unix Mach
  951. .Ix relaynews
  952. .Ix /dev/null
  953. .Ix machines NeXT
  954. .PP
  955. The
  956. .I relaynews
  957. regression test fails under some (all?) AIXes,
  958. because the system refuses to do an
  959. .I fsync
  960. on a file descriptor open to
  961. .I /dev/null .
  962. It is possible that this does not affect production use, however.
  963. Mach (at least on the NeXT) is reported to have similar problems.
  964. .SH
  965. AIX/370 vs. Shell Files
  966. .Ix problems AIX/370
  967. .Ix Unix AIX/370
  968. .Ix shell AIX/370
  969. .Ix newsrunning
  970. .PP
  971. AIX/370 has added at least one keyword (``on'') to the shell,
  972. and this is
  973. known to cause syntax complaints
  974. in at least one shell script (\fInewsrunning\fR).
  975. Unless this is also a keyword in the final version of POSIX 1003.2,
  976. we don't plan to fix this.
  977. .SH
  978. Struct Conditional Expressions
  979. .Ix "broken compilers"
  980. .Ix problems "broken compilers"
  981. .Ix Unix "SCO Xenix"
  982. .PP
  983. Some (all?) SCO Xenix compilers take offense to expressions like
  984. .DS
  985. .ft B
  986. value = (dbzint) ? dbzfetch(key) : fetch(key);
  987. .ft
  988. .DE
  989. where the functions return
  990. .I struct
  991. values.
  992. This occurs in three places in
  993. .I dbz/dbzmain.c ,
  994. .Ix dbz
  995. and the workaround is to expand those conditionals to statements like:
  996. .DS
  997. .ft B
  998. if (dbzint)
  999.     value = dbzfetch(key);
  1000. else
  1001.     value = fetch(key);
  1002. .ft
  1003. .DE
  1004. .SH
  1005. staleness vs. Ultrix
  1006. .Ix Unix Ultrix
  1007. .Ix staleness
  1008. .Ix problems Ultrix
  1009. .PP
  1010. Several Ultrix users have reported a problem with the ``staleness''
  1011. command.
  1012. It seems Ultrix's \fIsed\fR is an antique and blows up on the complex
  1013. regular expression in \fIstaleness\fR.
  1014. .Ix sed
  1015. A fix,
  1016. at some small cost in performance,
  1017. is to change the last four lines
  1018. of \fIstaleness\fR to something like
  1019. .DS
  1020. .ft B
  1021. exec awk '$1 == "/expired/" { print "-o", $3 }' $NEWSCTL/explist
  1022. .ft
  1023. .DE
  1024. .SH
  1025. SCO Xenix string functions
  1026. .Ix "botched libraries"
  1027. .Ix problems "botched libraries"
  1028. .Ix Unix "SCO Xenix 2.3"
  1029. .\" Sydney S. Weinstein discovered this horror
  1030. .PP
  1031. Under SCO Xenix 2.3,
  1032. and perhaps other recently-released SCO systems,
  1033. the string functions like \fIstrchr\fR exist but can be
  1034. inordinately slow when dealing with long strings.
  1035. This is not an academic issue:
  1036. one symptom is that \fIrelaynews\fR
  1037. .Ix relaynews
  1038. takes a long time to start up,
  1039. eating 10-15 seconds of CPU time
  1040. before it starts processing articles.
  1041. This apparently is a combination of badly-written code and
  1042. strange internationalization support.
  1043. Just using our string functions,
  1044. by
  1045. telling \fIbuild\fR that your system does not have them,
  1046. works much better.
  1047. Telling the compiler \fB\-nointl\fR may be helpful if you don't want
  1048. to go that far.
  1049. .SH
  1050. Old SCO Xenix vs. \fIsetvbuf\fP
  1051. .Ix "botched libraries"
  1052. .Ix problems "botched libraries"
  1053. .Ix Unix "SCO Xenix"
  1054. .Ix dbz
  1055. .Ix problems setvbuf
  1056. .Ix setvbuf
  1057. .\" Ronald Khoo reported this unbelievable botch
  1058. .PP
  1059. The \fIdbz\fR package makes some use of the \fIsetvbuf\fR routine.
  1060. Incredible though it sounds,
  1061. old versions of SCO Xenix reportedly had
  1062. the order of \fIsetvbuf\fR's arguments wrong!
  1063. If you have SCO Xenix version
  1064. 2.2 or earlier,
  1065. check the arguments to \fIsetvbuf\fR:
  1066. if the second and third are a type and a buffer pointer respectively
  1067. (they are supposed to be a buffer pointer and a type),
  1068. you're in trouble and will have to tinker with the \fIdbz\fR sources.
  1069. .SH
  1070. SunOS 4.1.1 vs. write()
  1071. .Ix write
  1072. .Ix problems SunOS 4.1
  1073. .Ix Unix "SunOS 4.1.1"
  1074. .Ix problems "broken kernel"
  1075. .Ix "broken kernel"
  1076. .PP
  1077. In some circumstances,
  1078. a SunOS 4.1.1 \fIwrite\fR system call to a disk
  1079. file can be interrupted by a signal.
  1080. No other Unix does this,
  1081. and routines like \fIfwrite\fR are not prepared
  1082. to cope with it.
  1083. This can result in gratuitous failures of \fIdbz\fR in particular.
  1084. .PP
  1085. It is thought not to be a problem in C News,
  1086. but some other packages
  1087. using \fIdbz\fR suffer,
  1088. .Ix dbz
  1089. and we mention it just in case.
  1090. Sun acknowledges it as a bug.
  1091. The bug-id is 1052649.
  1092. It is fixed in patch 100293-01.
  1093. .SH
  1094. uucp Variations
  1095. .Ix uucp
  1096. .Ix problems queuelen
  1097. .Ix queuelen
  1098. .PP
  1099. There are innumerable variations on the details of \fIuucp\fR that may
  1100. require appropriate modifications to \fIqueuelen\fR.
  1101. For example,
  1102. some versions of Honey DanBer (aka BNU) \fIuucp\fR cut all
  1103. system names down to seven characters,
  1104. and \fIqueuelen\fR will have to be altered to do likewise.
  1105. .SH
  1106. malloc Variations
  1107. .Ix malloc
  1108. .Ix Unix A/UX
  1109. .PP
  1110. On some systems,
  1111. performance is noticeably better if the \fB\-lmalloc\fR
  1112. library is used,
  1113. rather than relying on the \fImalloc\fR in the standard
  1114. C library.
  1115. A/UX is reportedly an example.
  1116. .SH
  1117. Slow egrep
  1118. .Ix egrep
  1119. .Ix "System V" breakage
  1120. .Ix Unix "System V"
  1121. .Ix Unix A/UX
  1122. .PP
  1123. At least some System V suppliers (including, reportedly, Apple in
  1124. some [now obsolete?] A/UX versions) have broken \fIegrep\fR in such
  1125. a way that it is inordinately slow.
  1126. It may be worth substituting \fIgrep\fR for \fIegrep\fR in some of
  1127. the shell scripts,
  1128. with appropriate caution since they do not accept
  1129. quite the same pattern syntax.
  1130.