Is anyone executing Cnews on microport 2.4 ?

Dragos Ruiu dr at myrias.uucp
Wed Jul 12 04:47:13 AEST 1989


In article <14 at pfm.UUCP> root at pfm.UUCP (TSOS of PFM) writes:
>cab at cbnewsh.ATT.COM (CAB) writes:
>
>>Tips on compilation appreciated, my compiler seems to barf
>>on relay/hdrdefs.c line 49.  The error message is
>
>>compiler error: expression causes compiler loop: try simplifying
>
>No, sorry, I have the microport sys V 386 Rel. 3.0, but I have 
>trouble with the "spacefor" - the whole time inews says that there
>is not enough space at my /usr/spool/news (32 MB free space !).
>
>Anybody with the same problem ? 
>-- 
 
  Henry Spencer posted a suggested fix for the Cnews problem on Uport SysV/AT.
  Basically, the offsetof() macro breaks PCC compilers. On microport you
  can simplify the expression by removing the first cast and the subtraction
  since the program will be compiled in the small memory model. Klugey but
  it works.

  Cnews works *GREAT* on microport 286-2.4!

  You have to fix spacefor however. The SysV.2 df does not take arbitrary
directories for arguments. It is relatively trivial to fix it up, but
it is site specific because you need to know about how you set up your file
systems. I'm including spacefor off my system at the end of this posting.
It is a slightly trimmed down version od the original. 
  On my system /usr/spool is a separate disk drive, so to change this to
work on your system you should make the argument to df be whatever filesystem
you spool stuff on. (Typically /usr on uPort setups) 
  If you spool news and uucp stuff on different filesystems, you would be
better off starting with the stock spacefor and modifying it.
  The only other caveat is that I put my news stuff in /usr/local/lib, so
if you put things in /usr/lib (blech...) you'll have to change the line
that looks for the config file. 
  
  Spacefor follows signature...
--
Dragos Ruiu         | GNU Emacs: It's a tool.
alberta!dragos!ruiu | Me: When you have a hammer, everything looks like a nail! 
uunet!myrias!dr     |
bbs: (403) 439-0229 |
################################################################################
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	spacefor.uport
# This archive created: Tue Jul 11 12:35:32 1989
export PATH; PATH=/bin:$PATH
if test -f 'spacefor.uport'
then
	echo shar: will not over-write existing file "'spacefor.uport'"
else
cat << \SHAR_EOF > 'spacefor.uport'
:
# spacefor - determine available disk space
# About how many things of $1 bytes will fit in the available space for
# stuff of type $2 ("incoming", "articles", "control", "outbound $3",
# or "archive") without cramping things too badly?
#
# You'll have to change this -- your blocksize, minimum-free-desired amounts,
# and df output format will probably differ, and you may need to name
# your filesystems explicitly.
 
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/local/lib/news/bin/config}
 
PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

# head off special case
case "$1" in
0)      echo 10000 ; exit 0 ;;
esac

# argument to df, df units, and free space desired (in df units)
dfunit=512              # default unit (bytes)
case "$2" in
incoming)       desire=5000 ;;
articles)       desire=5000 ;;
control)        desire=3000 ;;
outbound)       desire=10000 ;; # ignore $3
archive)        desire=1 ;;             # system-specific
*)              echo "$0: bad type argument \`$2'!!" >&2
                exit 2 ;;
esac

# this is set up for the stupid SysV.2 df as opposed to the stupid BSD df :-)
df /usr/spool | awk "{
                nb = (\$2 - $desire) * $dfunit / $1
                if (nb > 10000)
                        nb = 10000      # ensure representable as integer
                nb = int(nb)
                if (nb <= 0)
                        print 0
                else
                        print nb
                exit
        }"

SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
Dragos Ruiu          What do you get when you cross a grape with an elephant ?
myrias!dr                        Grape Elephant Sine Theta



More information about the Comp.unix.microport mailing list