[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2099.0. "RMS-F-IOP error - only on VMS 7.1" by PATRLR::MCCUSKER () Thu Feb 20 1997 15:22

*****CROSS POSTED IN VMSZOO::RMS_OPENVMS*****


DEC C V5.2-003
ALPHA VMS 7.1

Can anyone help me to understand why the program at the bottom of this note
fails on the open call on ALPHA/VMS7.1?  It is successful on ALPHA VMS 6.2.
A pointer would be greatly appreciated as I would guess there has been some
change that I'm not aware of and couldn't find.  Also, if there is a more
appropriate conference, let me know.

Thanks for your help,

Brad McCusker


Points of interest:
1. vaxc$errno = 99700 ==> 
        %RMS-F-IOP, operation invalid for file organization or device

2. $SHOW DEV /FILES tells us the file _is_ opened by this process.

3. Same results if the file exists prior to running the program or not.

4. I get the same results if the file pre-exists or not.

5. The debugger output from the failing run is here:

SRC: module TEST -scroll-source
  4201:
  4202: main ()
  4203: {
  4204:         char filename[41] ;
  4205:         int omode ;
  4206:         int mode;
  4207:         int fd;
  4208:         unsigned long brad ;
  4209:
  4210:         strcpy (filename, "PWRK$LMROOT:[lanman.logs]PCROOM_net.err");
  4211:
  4212:         omode = O_RDWR ;
  4213:         mode = 436 ;
  4214:         brad = errno ;
  4215:         fd = open( filename, O_CREAT|omode, mode, "rfm=udf","shr=put" )A
  4216:         brad = errno ;
  4217:         brad = vaxc$errno ;
->4218: }
  4219:
 OUT -output
stepped to TEST\main\%LINE 4212
stepped to TEST\main\%LINE 4213
stepped to TEST\main\%LINE 4214
stepped to TEST\main\%LINE 4215
stepped to TEST\main\%LINE 4216
TEST\main\brad: 0
stepped to TEST\main\%LINE 4217
TEST\main\brad: 65535
stepped to TEST\main\%LINE 4218
TEST\main\brad: 99700
%RMS-F-IOP, operation invalid for file organization or device


DIR/FULL on the file in question:

$ dir/full PWRK$LMROOT:[lanman.logs]PCROOM_net.err

Directory PWRK$LMROOT:[LANMAN.LOGS]

PCROOM_NET.ERR;1              File ID:  (859,17,0)
Size:            0/0          Owner:    [SYSTEM]
Created:   20-FEB-1997 14:18:55.70
Revised:   20-FEB-1997 14:20:34.44 (1)
Expires:   <None specified>
Backup:    <No backup recorded>
Effective: <None specified>
Recording: <None specified>
File organization:  Sequential
Shelved state:      Online
File attributes:    Allocation: 0, Extend: 0, Global buffer count: 0
                    Version limit: 5
Record format:      Undefined, maximum 0 bytes, longest 0 bytes
Record attributes:  None
RMS attributes:     None
Journaling enabled: None
File protection:    System:RWD, Owner:RWD, Group:R, World:
Access Cntrl List:  None

Total of 1 file, 0/0 blocks.
$


PROGRAM:
===========================================================================

/* VMS System Header Files */
#include	<stdio.h>
#include	<fcntl.h>
#include	<errno.h>
#include	<unistd.h>
#include	<types.h>
#include	<limits.h>
#include	<string.h>
#include	<time.h>
#include	<stdlib.h>
#define   unlink(x)   remove(x)   /* unlink is stubbed out */
#define   link(x,y)   rename(x,y) /*   link is stubbed out */

main ()
{
	char filename[41] ;
	int omode ;
        int mode;
	int fd;
        unsigned long brad ;

        strcpy (filename, "PWRK$LMROOT:[lanman.logs]PCROOM_net.err");

	omode = O_RDWR ;
        mode = 436 ;
        brad = errno ;
	fd = open( filename, O_CREAT|omode, mode, "rfm=udf","shr=put" ) ;
        brad = errno ;
        brad = vaxc$errno ;
}



 
T.RTitleUserPersonal
Name
DateLines
2099.1define DECC$DEFAULT_UDF_RECORD logicalTAVENG::BORISBoris Gubenko, ISESat Feb 22 1997 05:3742
  A file with sharing RMS option set ("shr=put" in your example) must be
  processed in record mode. Attempt to perform block I/O for such a file
  results in %RMS-F-IOP error.

  Prior to OpenVMS V7.1, the DEC C RTL was processing UNDEFINED record format
  files ("rfm=udf") in record mode.

  In OpenVMS V7.1 the DEC C RTL has been changed to process UNDEFINED record
  format files in stream mode. Defining the logical DECC$DEFAULT_UDF_RECORD,
  regardless of value, will instruct the RTL to return to its original behavior
  of processing UNDEFINED record format files in record mode.

  Boris

$ say f$getsyi("version")
V7.1    
$ show log DECC$DEFAULT_UDF_RECORD
%SHOW-S-NOTRAN, no translation for logical name DECC$DEFAULT_UDF_RECORD
$ run x
open: non-translatable vms error code: 0x18574
%rms-f-iop, operation invalid for file organization or device
$ define DECC$DEFAULT_UDF_RECORD 1
$ run x
Success
$

X.C
===
#include    <errno.h>
#include    <fcntl.h>
#include    <stdio.h>

main ()
{
    char *filename = "decc_2099.dat";

    remove(filename);

    if ( open( filename, O_CREAT, 0, "rfm=udf", "shr=put") == -1 )
	perror("open");
    else puts("Success");
}
2099.2Another optionPATRLR::MCCUSKERFri Feb 28 1997 16:445
Many thanks to Boris for his reply.  Thank heavens for notes!

Another alternative is to add ctx=rec to the open statement. 

Brad McCusker