home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!netsys!pagesat!spssig.spss.com!news.oc.com!utacfd.uta.edu!rwsys!caleb!jdp
- From: jdp@caleb.UUCP (Jim Pritchett)
- Newsgroups: comp.sys.amiga.programmer
- Subject: BTN v2.1 handler problem
- Message-ID: <lQIWr*sf1@caleb.UUCP>
- Date: Wed, 04 Nov 1992 05:32:37 GMT
- Organization: is sometimes desirable
- Lines: 70
-
- Hello,
- I have been Manxifying Jonathon Hue's tar program from the old Fish
- disk in order to fix some bugs Andy Finkel pointed out. (I am using Aztec
- C v5.2a.) I've run into the following problem:
-
- the standard write() command produces a return value of -1 and tapemon prints
- " Function/mode error." The write command in tar works fine on files, but it
- fails on BTN:. So, using the same method used in tar, I wrote the simple test
- program below:
-
-
- #include <stdio.h>
-
- main(argc, argv)
- int argc;
- char **argv;
-
- {
- char buffer[10240];
- int err, i;
- long tape;
-
- if (argc <= 1)
- {
- printf("No argument. Syntax is: %s filename.", argv[0]);
- exit();
- }
-
- tape = creat(argv[1], 0666);
- printf("creat returned %ld.\n", tape);
-
- for (i=0; i < 10240; i++) buffer[i] = (char) i;
-
- err = write(tape, buffer, 10240L);
-
- printf("err is %ld.\n", err);
-
- (void) close(tape);
-
- }
-
-
- This program produces the same error. It also produces this Enforcer hit on the
- close() call. I don't know why.
-
- Program Counter (approximate)= 3030D0 Fault address =4E7343FA
- User stack pointer = 35F844 DOS process address = 2A0E08
- Data: 00000000 FFFFFFFF 00000000 00004E55 00000008 0000002B 0000003B 002A0E64
- Addr: 4E7343FA 00342662 002A0E08 002A11D0 003478D6 0035F860 0020C9D0 001FFFA0
- Stck: 002FDA72 4E7343FA 00000000 0000A008 0000000A 000000A2 00309B34 0035F870
- READ-WORD (---)(-)(-) SR=0004 SSW=0769
- New_WShell, "test"
-
-
-
- From looking at the BTN: source, it appears that BTN thinks that the file has
- not been opened for "write" access. (Note, I don't really understand how device
- drivers work, so I may have this part wrong.) Is this a bug in BTN: or Manx?
- Or, am I just missing something obvious? I really don't understand why the
- original tar executable works fine on this, but when I recompile it, it fails.
-
- If this really is a compiler bug, how can I work around it? Is there a fix?
-
- Thanks,
-
- Jim Pritchett
-
-
- UUCP: rwsys.lonestar.org!caleb!jdp
- or utacfd.uta.edu!rwsys!caleb!jdp
-