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

Conference vmszoo::rms_openvms

Title:RMS asks, 'R U Journaled?'
Moderator:STAR::TSPEERUVEL
Created:Tue Mar 11 1986
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3031
Total number of notes:12302

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

****CROSS POSTED IN TURRIS::DECC.NOTE*****


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
3014.1STAR::EWOODSThu Feb 20 1997 17:5315
  You're not calling RMS services directly.  You are using C RTL OPEN.

  I did run your program on both a V7.1 and V7.2 system.  It certainly
  appears that the file is being successfully created.   After creating
  the file with your program, with a program (non C) of my own I opened 
  the file and successfully added a record to it on both systems.  

  The DEC C compiler I used was:  DEC C V5.0-003.  And I changed your
    hard-coded device:[dir] to SYS$LOGIN.

  I think you need to pursue this with DECC so I'm glad to see you 
  have cross posted this in DECC notes.  
                                         
  -- Elinor
3014.2DECC conference says....PATRLR::MCCUSKERThu Feb 27 1997 16:5959
Elinor,

Thanks for your reply.  To complete the loop, below is the response I
recieved from the DECC conference.

Again, Thanks!

Brad McCusker
PATHWORKS Server Engineering

           <<< TURRIS::DISK$NOTES_PACK:[NOTES$LIBRARY]DECC.NOTE;1 >>>
                                   -< DECC >-
================================================================================
Note 2099.1             RMS-F-IOP error - only on VMS 7.1                 1 of 1
TAVENG::BORIS "Boris Gubenko, ISE"                   42 lines  22-FEB-1997 05:37
                  -< define DECC$DEFAULT_UDF_RECORD logical >-
--------------------------------------------------------------------------------
  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");
}