              <<< VAXAXP::NOTES$:[NOTES$LIBRARY]VMSNOTES.NOTE;1 >>>
               -< VAX and Alpha VMS - Digital Internal Use Only >-
================================================================================
Note 1838.1             change in REQUEST message length?                 1 of 2
XDELTA::HOFFMAN "Steve, OpenVMS Engineering"        130 lines  18-NOV-1996 11:43
                   -< Relying on Undocumented Behaviour... >-
--------------------------------------------------------------------------------

   REQUEST and REPLY are based on the same mechanism -- both are user
   interfaces to the $sndopr system service.  And I've seen references
   to some buffer-related fixes that may be related to this change...

   If the documentation says `128 bytes', and the user found that they
   could use additional bytes, then they were depending on undocumented
   and unsupported and subject-to-change behaviour.

   The $sndopr OPC$L_MS_TEXT limit is derived from and limited to the
   size of the mailbox device being used.  OPC$L_MS_OTEXT is documented
   as being limited to 255 characters.  A program can be constructed using
   these system services -- assuming familiarity with OpenVMS programming
   -- in less than an hour, and can easily be installed with the necessary
   OPER privilege.

   The operator mailbox device is traditionally MBA2:.

   The following is some old (pre DEC C) code that may serve as at least
   a demonstration of calling $sndopr...


#module	SNDOPR "SRH X1.0-000"
#pragma builtins

/*
** COPYRIGHT (c) 1992 BY
** DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.
** ALL RIGHTS RESERVED.
**
** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
** ONLY  IN  ACCORDANCE  OF  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR  ANY  OTHER
** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
** OTHER PERSON.  NO TITLE TO AND  OWNERSHIP OF THE  SOFTWARE IS  HEREBY
** TRANSFERRED.
**
** THE INFORMATION IN THIS SOFTWARE IS  SUBJECT TO CHANGE WITHOUT NOTICE
** AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
** CORPORATION.
**
** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY OF ITS
** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*/

/*
**++
**  Facility:
**
**	Examples
**
**  Version: V1.0
**
**  Abstract:
**
**	Example of working with the $SNDOPER system service
**
**  Author:
**	Steve Hoffman
**
**  Creation Date:  1-Jan-1990
**
**  Modification History:
**--
*/
#include <descrip.h>
#include <iodef.h>
#include <opcdef.h>
#include <ssdef.h>
#include <stsdef.h>

#define OPC_BUFSIZ 1024
#define OPC_RQSTID 127
main()
    {
    unsigned short int chan;
    unsigned short int iosb[4];
    unsigned long int reqid;
    struct dsc$descriptor_s opc_d;
    unsigned long int retstat, dasstat;
    struct OPC *opc = calloc( 8, 1), *rply = calloc( OPC_BUFSIZ, 1 );

    opc_d.dsc$w_length = 12;
    opc_d.dsc$b_dtype = DSC$K_DTYPE_T;
    opc_d.dsc$b_class = DSC$K_CLASS_S;
    opc_d.dsc$a_pointer = opc;
 
    retstat = sys$crembx( 0, &chan,
	    OPC_BUFSIZ, (2 * OPC_BUFSIZ ),
	    0x0ff00, 0, 0);

    if ( !$VMS_STATUS_SUCCESS(retstat) )
	return retstat;
 
    *(unsigned long int *) opc = ~0;
    opc->opc$b_ms_type = OPC$_RQ_RQST;
    opc->opc$l_ms_rqstid = OPC_RQSTID;
    strcpy( &opc->opc$l_ms_text, "help" );
 
    printf("Please REPLY/PEND=nn to this request\n" );

    retstat = sys$sndopr( &opc_d, chan );

    if ( !$VMS_STATUS_SUCCESS(retstat) ) goto bail_out;
 
    retstat = sys$qiow( 0, chan, IO$_READVBLK, iosb, 0, 0, 
	    rply, OPC_BUFSIZ, 0, 0, 0, 0 );
    if (! $VMS_STATUS_SUCCESS(retstat)) goto bail_out;
    retstat = sys$synch( 0, iosb ); 
    if (! $VMS_STATUS_SUCCESS(iosb[0])) goto bail_out;
    
    *(unsigned long int *) opc = ~0;
    opc->opc$b_ms_type = OPC$_RQ_CANCEL;
    opc->opc$l_ms_rqstid = OPC_RQSTID;
 
    retstat = sys$sndopr( &opc_d, chan );

    if ( !$VMS_STATUS_SUCCESS(retstat) ) goto bail_out;
 
    retstat = sys$qiow( 0, chan, IO$_READVBLK, iosb, 0, 0, 
	    rply, OPC_BUFSIZ, 0, 0, 0, 0 );
    if (! $VMS_STATUS_SUCCESS(retstat)) goto bail_out;
    retstat = sys$synch( 0, iosb ); 
    if (! $VMS_STATUS_SUCCESS(iosb[0])) goto bail_out;

bail_out:
 
    dasstat = sys$dassgn( chan );
    return retstat;
    };
