[net.micro.cpm] Uc.c

ciaraldi@Rochester.ARPA (02/22/84)

From:  Mike Ciaraldi <ciaraldi@Rochester.ARPA>

I have been using umodem.c (version 3.6) for
Unix to CP/M file transfers, and wanted to upgrade to 
uc.c, since it has CRC checksumming.

I fetched it from SIMTEL, and it compiled OK, but when I run
it I immediately get a segmentation fault, before it even
prints the sing-on message (the printf is the FIRST executable
statement!).
I contacted Rick Conn and he said he wrote this for System V.
We are running BSD 4.1c (soon to convert to 4.2).

For comparison, umodem has conditional-compile flags for
JHU (Johns Hopkins), VER7 (Version 7, also good for Berkeley),
and SYS3 (for System III, and V also, I suppose).

Does anyone know how to fix up uc.c? The differences on
umodem have to do with how you tell the system to kill echo,
go to 8-bit transmission, etc. But all these calls are
after the printf, so why don't we even see the sign-on message?
(last-minute thought: maybe the output buffer is not
getting flushed).  

I suppose I could hack up uc.c and put in the same things umodem
has, but if someone else has already done it, I would
appreciate a copy. Also, it should be added to the archives.

Mike Ciaraldi
ciaraldi@rochester

brian@sdccsu3.UUCP (03/02/84)

x

We had exactly the same problem with uc.c on 4.1 - what you have to do
to fix it is change the fstat procedure name to something else - for
example, myfstat, as it is overlaying the system fstat in the io
library, and the first printf in the program is causing infinite
recursion until you blow the stack.

Be aware that the uc.c program will fail as soon as you go to 4.2 - it
uses alarm() to time out reads, and the entire signal handling mechanism
has changed in 4.2 in this respect, so you'll have to rewrite all the
sections of code that depend on that.  Look into the 'select' system
call in your 4.2 manuals.

A few days ago I posted 'xmodem' - a sort of umodem program updated for
4.2 BSD.  You'll find a working example of the select call and timeout
as it would be used in uc in that program.  Or you could add crcs to
xmodem - I intended to but ran out of time.

-- 
	-Brian Kantor, UC San Diego 
	Kantor@Nosc
	ihnp4 \
	decvax \
	dcdwest  -----  sdcsvax  ----- brian
	ittvax /
	ucbvax/