Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
From: fox@rudolf.nscl.msu.edu (Ron Fox)
Subject: Re: Create & QIO to DECterms
Date: 23 Jun 1993 12:19:24 GMT	[thread overview]
Message-ID: <209hoc$vl9@msuinfo.cl.msu.edu> (raw)
In-Reply-To: 1993Jun22.191457.28022@e2big.mko.dec.com


--
In article <1993Jun22.191457.28022@e2big.mko.dec.com>, kleinsorge@star.enet.dec.com (Fred Kleinsorge) writes:
|>Newsgroups: comp.sys.vms,comp.os.vms
|>Path: msuinfo!agate!ames!decwrl!pa.dec.com!e2big.mko.dec.com!star.enet.dec.com!kleinsorge
|>From: kleinsorge@star.enet.dec.com (Fred Kleinsorge)
|>Subject: Re: Create & QIO to DECterms
|>Message-ID: <1993Jun22.191457.28022@e2big.mko.dec.com>
|>Keywords: DECterm
|>Lines: 27
|>Sender: usenet@e2big.mko.dec.com (Mr. USENET)
|>Reply-To: kleinsorge@star.enet.dec.com (Fred Kleinsorge)
|>Organization: Digital Equipment Corporation
|>X-Newsreader: mxrn 6.18-4
|>References:  <1993Jun22.164105.23968@mprgate.mpr.ca>
|>Date: Tue, 22 Jun 93 15:14:57 EDT
|>Xref: msuinfo comp.sys.vms:153 comp.os.vms:74069
|>
|>
|>The system service is giving you a error from the probe of the
|>arguments.  I'd check either the line:
|>
|>	terminal.dsc$a_pointer = device_name;
|>
|>and make it:
|>
|>	terminal.dsc$a_pointer = &device_name[];
|>
|>or the line:
|>
|>	status = sys$assign(terminal, &user_input_chan, 0, 0);
|>
|>and make it:
|>
|>	status = sys$assign(&terminal, &user_input_chan, 0, 0);
|>
|>I always get into trouble on how C decides what to do when passing
|>structures.
|>
|>
|>-- 
|>					+--------------------------------------+
|>Fred Kleinsorge				| All opinions expressed are mine, and |
|>kleinsorge@star.enet.dec.com		| may not reflect those of my employer |
|>					+--------------------------------------+
|>
  The problem was the latter one I think.  In VMS C, structures are passed
by copy in the argument list.  sys$assign, needs a pointer to the descriptor
so you need &terminal in the SYS$ASSIGN.  The fudging of the descriptor
is O.K. since array names without subscripts can be treated as pointers to
their contents.  By the way, more standard and portable than what you showed
is:

   terminal.dsc$a_pointer = &device_name[0];

Which should also work.
	RF.
Ron Fox                     | FOX@MSUNSCL.BITNET      | Where the name 
NSCL                        | FOX@RUDOLF.NSCL.MSU.EDU | goes on before
Michigan State University   | MSUHEP::RUDOLF::FOX     | the quality
East Lansing, MI 48824-1321 |                         | goes in.
USA


      reply	other threads:[~1993-06-23 12:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-22 16:41 Create & QIO to DECterms Vincent Li
1993-06-22 19:14 ` Fred Kleinsorge
1993-06-23 12:19   ` Ron Fox [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox