HP3000-L Archives

September 2002, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Peter Smithson <[log in to unmask]>
Reply To:
Peter Smithson <[log in to unmask]>
Date:
Fri, 13 Sep 2002 05:47:04 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
 For those of you who remember me, I'm back at this MPE port of some C
code and will be asking stupid questions again.

I've got a C library which I'm calling from a COBOL program.  I've
found a lot of problems can be fixed by using the HP intrinsics rather
than the stdio stuff but I've got something odd happending with
_mpe_fileno.

The COBOL program has been created by a server process using fork and
exec.  The stdin and stdio have been dup2'd onto a socket.  I emulated
most problems just by running the COBOL program like this -

PETERX > out

from the POSIX shell.  But this works OK and only fails when it's
kicked off from the server.

I've got this bit of code -

LogCliCmd("doing FWRITE 1\n");
        filenum= fileno(stdout);
LogCliCmd("doing FWRITE 2 filenum=%d\n", filenum);
        filenum= _mpe_fileno(filenum);
LogCliCmd("doing FWRITE 3\n");
        FWRITE (filenum, buffer, -Len, controlcode);
LogCliCmd("done FWRITE\n");

The logging shows "FWRITE 2" is being written but not "FWRITE 3".  So
the call to _mpe_fileno seems to be causing the process to terminate.

Any ideas on what could be going wrong?  filenum has a value of 1 if
I'm using the server process or just re-directing stdout.

It works OK if I use the server to kick off a pure C program that
calls the same library routines.
--
http://www.wadmag.org.uk
http://uk.geocities.com/ukwebring - UK Motorcycle site webring

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2