[PATCH] VMS IPC prepatch

Steven S. Dick (Fabian.Frederick@prov-liege.be)
Tue, 5 Oct 1999 08:49:51 +0200


Alan,

Here's my first prepatch dealing with VMS Ipc integration ...
This one was -partially- tested under UP environment and is applied
against 2.2.12 vanilla.I'd like you or someone else (Andrea ?) to guide
me locking the stuff for SMP and maybe telling me if such _feature_
could be plugged in 2.3.X branch as well.Note that I felt like
creating an IPC V de-multiplexer alike but I dunno if it's the right
_thing_ to do ...

PS : If someone wants to patch some old box with this one, don't
hesitate to ask me both library & Uspace program I've been
developping too : )

Regards, Fabian

diff -urN linux.vanilla/arch/i386/kernel/entry.S
linux.fab/arch/i386/kernel/entry.S
--- linux.vanilla/arch/i386/kernel/entry.S Fri Apr 30 17:13:37 1999
+++ linux.fab/arch/i386/kernel/entry.S Sat Oct 2 21:47:50 1999
@@ -562,6 +562,7 @@
.long SYMBOL_NAME(sys_ni_syscall) /* streams1 */
.long SYMBOL_NAME(sys_ni_syscall) /* streams2 */
.long SYMBOL_NAME(sys_vfork) /* 190 */
+ .long SYMBOL_NAME(sys_vmsipc)

/*
* NOTE!! This doesn't have to be exact - we just have
diff -urN linux.vanilla/include/asm/unistd.h
linux.fab/include/asm/unistd.h
--- linux.vanilla/include/asm/unistd.h Wed Jan 20 20:06:24 1999
+++ linux.fab/include/asm/unistd.h Sat Oct 2 21:49:03 1999
@@ -195,6 +195,7 @@
#define __NR_getpmsg 188 /* some people actually want
streams */
#define __NR_putpmsg 189 /* some people actually want
streams */
#define __NR_vfork 190
+#define __NR_vmsipc 191

/* user-visible error numbers are in the range -1 - -122: see
<asm-i386/errno.h> */


diff -urN linux.vanilla/include/linux/ipcvms.h
linux.fab/include/linux/ipcvms.h
--- linux.vanilla/include/linux/ipcvms.h Thu Jan 1 01:00:00 1970
+++ linux.fab/include/linux/ipcvms.h Sat Sep 28 21:49:30 1996
@@ -0,0 +1,13 @@
+#ifndef _VMS_IPC_H
+#define _VMS_IPC_H
+
+#define LOTCREA 1
+#define LONCREA 2
+#define LOTDEL 3
+#define LONDEL 4
+#define LONREAD 5
+#define LONAMEMAX 16
+
+
+#endif
+
diff -urN linux.vanilla/include/linux/loname.h
linux.fab/include/linux/loname.h
--- linux.vanilla/include/linux/loname.h Thu Jan 1 01:00:00 1970
+++ linux.fab/include/linux/loname.h Sun Oct 3 13:02:22 1999
@@ -0,0 +1,137 @@
+/*
+ * loname.h
+ *
+ * Copyright (c) Fabian Frederick 1999 ffrederick@prov-liege.be
+ *
+ *
+ *
+ */
+
+#ifndef __LOGNAME_H
+#define __LOGNAME_H
+
+/*Check versioning (c_f_u appears from 2.0.36/2.2.X it seems ...)*/
+/*#define copy_from_user memcpy_fromfs*/
+
+/*Path settings*/
+/*
+#define SYSTEM_DIRECTORY "LNM$SYSTEM_DIRECTORY"
+#define PROCESS_DIRECTORY "LNM$PROCESS_DIRECTORY"
+*/
+#define SYSTEM_DIRECTORY "SYS"
+#define PROCESS_DIRECTORY "PROC"
+
+#define MAXQUOTA 2048
+
+/*Logical name table types*/
+#define LOT_TYPE_PROCESS 0x01 /* Process Exclusive */
+#define LOT_TYPE_JOB 0x02 /* Reserved for Job processes */
+#define LOT_TYPE_GROUP 0x04 /* Process group rely */
+#define LOT_TYPE_USER 0x08 /* User table : Name is specified in
+ * LOT structure as well
+ */
+
+#define LOT_TYPE_ALL 0x08 /* Access to all */
+
+/*Logical name types */
+/*Refer to lnmdef.h for further types */
+/*Info is included in itemlist for both logical names input-outputs*/
+#define LON_TYPE_STRING 0x01 /* logitem : string */
+
+/* Both logical names & tables attributes on creation */
+
+#define ATTR_CONFINE 0x01
+#define ATTR_NO_ALIAS 0x02
+#define ATTR_CREATE_IF 0x04 /* LON's created _IF_ not existent
+ * in destination table
+ */
+#define ATTR_PUBLIC 0x08 /*This defines "normal" node cases*/
+
+#define LON_NAME_MAXCH 128
+#define LOT_NAME_MAXCH 128
+
+/*Conflict report*/
+#define ATTR_CREATE_TRY_FOOL 0x02
+#define OCC_CREATE_TRY_FOOL 0x04
+#define TBL_RELY_INEXISTANT 0x08
+#define ATTR_CREATE_IF_TRIGGERED 0x10
+#define ATTR_NO_ALIAS_TRIGGERED 0x20
+#define UNKNOWN_PATH 0x40
+#define SUB_QUOTA 0x80
+#define FRONT_INDKEY_TRY_FOOL 0x0100
+#define PROTECTION_TRY_FOOL 0x0200
+#define ATTR_CONFLICT 0x0400
+#define QUOTA_EXCEEDED 0x0800
+#define AUTHORIZE_TRY_FOOL 0x2000
+
+
+#define CREATE_SUCCESS 1
+
+typedef struct item_list{
+ short longBuf; /*may be Hard coded ... not required for
inputs*/
+ short code_info;
+ char *adrBuf;
+ int *adrLongInfo;
+ /*int end; unecessary*/
+
+}itemlist;
+
+typedef struct logical_Node{
+ int attr;
+ char name [LON_NAME_MAXCH];
+ itemlist meanitem;
+ /*typeinfo defined in meanitem*/
+ struct logical_Node *next;
+
+
+}logical_node;
+
+typedef struct logical_Table{
+ char name [LOT_NAME_MAXCH];
+ logical_node *lons;
+ logical_node *last_lon;
+ unsigned int lon_occ;
+ unsigned int max_occ;
+ int owner_pid; /* This should be _not_ necessary for
+ * system_directory though ... Todo : split lot
+ */
+
+}logical_table;
+
+typedef struct logical_table_Occ{
+ unsigned int attr,
+ accessmode;
+ logical_table log_table;
+ struct logical_table_Occ *next;
+}logical_table_occ;
+
+typedef struct logical_Directory{
+ logical_table_occ *lots;
+ /*unsigned int lot_occ; static_ed_ for ease */
+ logical_table_occ *last_lot;
+
+}logical_directory;
+
+
+typedef struct loname_arg{
+
+ int first,
+ second,
+ third;
+ char *firstptr;
+ char *secondptr;
+ itemlist *firstitem;
+
+}loname_argstruct;
+
+/*Avoid collision with user space library methods */
+#ifdef _KSPACE
+void lninit(void);
+int crelnt(int,const char *, unsigned int, const char*, int);
+int crelnm(int,const char *, const char*, int, const itemlist*);
+int dellnm(const char*,const char*, int);
+int trnlnm(int,const char*,const char*, int, itemlist*);
+#endif
+
+#endif
+
Binary files linux.vanilla/init/version.o and linux.fab/init/version.o
differ
diff -urN linux.vanilla/ipc/.ipc.o.flags linux.fab/ipc/.ipc.o.flags
--- linux.vanilla/ipc/.ipc.o.flags Sat Oct 2 21:17:19 1999
+++ linux.fab/ipc/.ipc.o.flags Sun Oct 3 13:14:08 1999
@@ -1,3 +1,3 @@
-ifeq (util.o msg.o sem.o shm.o,$(strip $(subst
$(comma),:,$(EXTRA_LDFLAGS) $(ALL_O))))
+ifeq (util.o msg.o sem.o shm.o loname.o,$(strip $(subst
$(comma),:,$(EXTRA_LDFLAGS) $(ALL_O))))
FILES_FLAGS_UP_TO_DATE += ipc.o
endif
diff -urN linux.vanilla/ipc/.loname.o.flags
linux.fab/ipc/.loname.o.flags
--- linux.vanilla/ipc/.loname.o.flags Thu Jan 1 01:00:00 1970
+++ linux.fab/ipc/.loname.o.flags Sun Oct 3 13:14:08 1999
@@ -0,0 +1,3 @@
+ifeq (-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-fno-strict-aliasing -D__SMP__ -pipe -fno-strength-reduce -m486
-malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686,$(strip
$(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_loname.o))))
+FILES_FLAGS_UP_TO_DATE += loname.o
+endif
diff -urN linux.vanilla/ipc/Makefile linux.fab/ipc/Makefile
--- linux.vanilla/ipc/Makefile Tue Mar 10 23:43:13 1998
+++ linux.fab/ipc/Makefile Sat Oct 2 21:50:15 1999
@@ -11,7 +11,7 @@
O_OBJS := util.o

ifdef CONFIG_SYSVIPC
-O_OBJS += msg.o sem.o shm.o
+O_OBJS += msg.o sem.o shm.o loname.o
endif

include $(TOPDIR)/Rules.make
Binary files linux.vanilla/ipc/ipc.o and linux.fab/ipc/ipc.o differ
diff -urN linux.vanilla/ipc/loname.c linux.fab/ipc/loname.c
--- linux.vanilla/ipc/loname.c Thu Jan 1 01:00:00 1970
+++ linux.fab/ipc/loname.c Sun Oct 3 14:23:00 1999
@@ -0,0 +1,504 @@
+/*
+ * loname.c
+ *
+ * Copyright (c) Fabian Frederick 1999 ffrederick@prov-liege.be
+ *
+ * This file countains first approach to logical names
+ * Based in some ways on linux/ipc/sem.c by Krishna Balasubramanian
+ *
+ * History :
+ * 06 July 1999 : (Fab) : -Semantic dispositions
+ *
-Uspace deployement
+ *
+ * 08 July 1999 : (Fab) : -Test interfacing
+ *
-Table creation based on table entries ... Avoid CONFINE
+ *
which isn't automatic incall.
+ *
-Source & destination reject abilities in lon creation managed
+ * 09 July 1999 : (Fab) : -Table creation with quota < node
size rejected
+ *
-Reject abilities from dest. object _NOT_ table.
+ *
-Frontier put for double creation : Index key on pid/table name _by_
table space
+ *
+ * 12 July 1999 : (Fab) : -Check attribute conflict
+ *
-Absolute quota ceil added
+ *
-Delete logical name process implemented (still untested)
+ * 27 Sep 1999 : (Fab) :
+ *
-First K-Space version.
+ * 28 Sep 1999 : (Fab) :
+ *
-First de-multiplexer release
+ *
+ * 29 Sep 1999 : (Fab) :
+ *
-syscall7 test (problem with headers) + Library planification
+ *
+ * 30 Sep 1999 : (Fab) :
+ *
-syscall by struct passing (unable to pass more than 6 args due to
+ *
register limitation)
+ * -Code
cleanup from #ifdef USPACE blabla ....
+ * 01 Oct 1999 : (Fab) :
+ *
-Patched D-Mul
+ *
-Added lninit method (not linked with util.c 's ipcinit yet).
+ *
-Added trnlnm functionnality (untested)
+ *

+ *
+ *
+ *
+ */
+
+#define _KSPACE
+#include <linux/loname.h>
+#include <asm/uaccess.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/malloc.h>
+#include <linux/mm.h>
+#include <stdio.h>
+#include <string.h>
+
+#define KAL_PRIO GFP_KERNEL
+char buffer[128];
+int pid;
+
+static int used_system_lots = 0;
+static int used_process_lots = 0;
+static logical_directory system_directory,
+ process_directory;
+
+void ltrace(const char *name){printk(name);}
+
+void lninit(void)
+{
+
+ used_system_lots=0;
+ used_process_lots=0;
+
+}
+
+int crelnt(int attr, const char *logicaldir, \
+ unsigned int quota, const char *logicaltablename, int
accessmode)
+
+{
+
+logical_directory *scan_directory;
+logical_table_occ *scan_lot, *buf_lot;
+int current_pid;
+int i,
+ *occ;
+
+current_pid=current->pid;
+
+if (quota < sizeof(logical_node))
+ return SUB_QUOTA;
+
+if (quota > MAXQUOTA)
+ return QUOTA_EXCEEDED;
+
+/*Recover directory*/
+if(!strcmp(PROCESS_DIRECTORY, logicaldir)){
+ /*Check attribute conflict*/
+ if(attr&ATTR_CONFINE)
+ return ATTR_CONFLICT;
+ scan_directory=&process_directory;
+ scan_lot=process_directory.lots;
+ occ=&used_process_lots;
+ }else{
+
+ if(strcmp(SYSTEM_DIRECTORY, logicaldir))
+ return UNKNOWN_PATH;
+
+ scan_directory=&system_directory;
+ scan_lot=system_directory.lots;
+ occ=&used_system_lots;
+}
+
+ buf_lot=scan_lot;
+
+ /* Here, we try to avoid resource name conflicts.
+ * only on CREATE_IF attribute.
+ * CONFINE sub-type will show where to look at
+ * AFAIK surnaming cannot appear in similar directory issue only.
+ * Contact me if I'm wrong.
+ */
+
+ ltrace("Create table : Check redundancy");
+ sprintf(buffer, "OCC in chosen path : %d", *occ);
+ ltrace(buffer);
+
+
+ /*Check for doubles
+ *two reject standards :
+ * -Index key set to owner pid + table name by tablespace (the
only way to stay cohesive)
+ * -create_if parameter from source which is _hugely_
different in the way we can have xxxbles on owner_pid
+ */
+
+ for(i=0;i<(*occ);i++){
+ ltrace("Creation table : Check entry");
+ if(!strcmp(logicaltablename,scan_lot->log_table.name)){
+ if (attr&ATTR_CREATE_IF)
+ return ATTR_CREATE_TRY_FOOL;
+ else{
if(scan_lot->log_table.owner_pid==current_pid)
+ return
FRONT_INDKEY_TRY_FOOL;
+ else{
if((scan_lot->attr&ATTR_NO_ALIAS)||(attr&ATTR_NO_ALIAS))
+
return ATTR_NO_ALIAS_TRIGGERED;
+ }
+ }
+ }
+ scan_lot=scan_lot->next;
+ }
+
+ scan_lot=buf_lot;
+ ltrace("create table : allocation");
+
+ if(*occ){
+ buf_lot=scan_directory->last_lot;
+ scan_directory->last_lot=(logical_table_occ*) \
+ kmalloc(sizeof(logical_table_occ), KAL_PRIO);
+ if(!scan_directory->last_lot)
+ return -ENOMEM;
+
+ scan_directory->last_lot->next=NULL;
+
+ buf_lot->next=scan_directory->last_lot;
+ }else{
+ ltrace("Create table : keep trace of last lot");
+
scan_directory->lots=scan_directory->last_lot=(logical_table_occ*) \
+ kmalloc(sizeof(logical_table_occ), KAL_PRIO);
+ if(!scan_directory->lots)
+ return -ENOMEM;
+
+ }
+
+ (*occ)++;
+ ltrace ("create table : assignation");
+
+ strcpy(scan_directory->last_lot->log_table.name, logicaltablename);
+ scan_directory->last_lot->log_table.lon_occ=0;
+
scan_directory->last_lot->log_table.max_occ=quota/sizeof(logical_table_o
cc);
+ scan_directory->last_lot->attr=attr;
+ scan_directory->last_lot->accessmode=accessmode;
+ scan_directory->last_lot->log_table.owner_pid=current_pid;
+
+ return CREATE_SUCCESS;
+
+}
+
+int crelnm(int attr, const char * logicaltablename, const char
*logicalname, int accessmode, const itemlist *equivale)
+{
+
+
+ int current_pid,
+ found,
+ pathchoosed;
+
+ logical_directory *scan_directory;
+ logical_table_occ *scan_lot,
+ *buf_lot;
+ logical_node *scan_node,
+ *buf_node;
+ int *occ,i;
+
+ itemlist *equival;
+
+ current_pid=current->pid;
+ ltrace("Recover directory");
+
+ /*Recover directory*/
+ if(attr&ATTR_CONFINE){
+ ltrace("Path choosed : Process");
+ pathchoosed=0;
+ scan_directory=&process_directory;
+ scan_lot=process_directory.lots;
+ occ=&used_process_lots;
+ }else{
+
+ ltrace("Path choosed : System");
+ pathchoosed=1;
+ scan_directory=&system_directory;
+ scan_lot=system_directory.lots;
+ occ=&used_system_lots;
+ }
+
+ ltrace("Recover table");
+ /*Recover table*/
+ i=0;
+ found=0;
+ buf_lot=scan_lot;
+ while(!found){
+ for(;i<(*occ);i++){
+ if((scan_lot->log_table.owner_pid==current_pid) \
+
&&(!strcmp(logicaltablename,scan_lot->log_table.name))){
+ found=1;
+ break;
+ }
+ scan_lot=scan_lot->next;
+ }
+ if(i>=*occ)
+ break;
+
+ }
+/*scan_lot=buf_lot;*/
+
+ ltrace("Add logical name");
+ /*Add logical name */
+ if(found){
+
+ ltrace("Eject on protex try fool");
+ /*Process table _can_ be reached by author only ... Specific
protection'd make part of future implementation*/
+ if(*occ)
+
if(((scan_lot->log_table.owner_pid!=pid)&&(pathchoosed)))
+ return PROTECTION_TRY_FOOL;
+
+ if(scan_lot->log_table.lon_occ<scan_lot->log_table.max_occ){
+ scan_node=scan_lot->log_table.lons;
+
+ /*Rejected for NO_ALIAS in source, occ
with same name, pid and NO_ALIAS, CREATE_IF in source
+ *coupled with same name in occ.
+ */
+
+
for(i=0;i<scan_lot->log_table.lon_occ;i++){
+
if((!strcmp(scan_node->name,logicalname))){
+
if(attr&ATTR_CREATE_IF)
+ return
ATTR_CREATE_IF_TRIGGERED; /*Which doesn't reject _both_ unappliance
though*/
+
if((scan_node->attr&ATTR_NO_ALIAS)||(attr&ATTR_NO_ALIAS))
+ return
ATTR_NO_ALIAS_TRIGGERED; /*Destination ejection*/
+
scan_node=scan_node->next;
+ }
+ break;
+ }
+ /* if(i<=scan_lot->log_table.lons)
+ return ATTR_CREATE_TRY_FOOL;
*/
+ buf_node=scan_node;
+ /*Create logical name*/
+ltrace("Allocation");
+ if(scan_lot->log_table.lon_occ){
+
buf_node=scan_lot->log_table.last_lon;
+
+ scan_lot->log_table.last_lon= \
+
(logical_node*)kmalloc(sizeof(logical_node), KAL_PRIO);
+
if(!scan_lot->log_table.last_lon)
+ return -ENOMEM;
+
buf_node->next=scan_lot->log_table.last_lon;
+
+ }else{
+
scan_lot->log_table.last_lon=scan_lot->log_table.lons \
+ =(logical_node*)
kmalloc(sizeof(logical_node),KAL_PRIO);
+
if(!scan_lot->log_table.last_lon)
+ return -ENOMEM;
+
+
scan_lot->log_table.last_lon->next=NULL;
+ }
+ scan_lot->log_table.lon_occ++;
+
+ }else return OCC_CREATE_TRY_FOOL;
+
+}else return TBL_RELY_INEXISTANT;
+
+ltrace("Assignation");
+/*Assign node*/
+
+/*Both access modes & attribute are table cohesive*/
+strcpy(scan_lot->log_table.last_lon->name, logicalname);
+
+scan_lot->log_table.last_lon->meanitem.adrBuf= (char*)
kmalloc(strlen(equival->adrBuf)+1,KAL_PRIO);
+if(!scan_lot->log_table.last_lon)
+ return -ENOMEM;
+
+scan_lot->log_table.last_lon->attr=attr;
+strcpy(scan_lot->log_table.last_lon->meanitem.adrBuf, equival->adrBuf);
+scan_lot->log_table.last_lon->meanitem.code_info=equival->code_info;
+/*Other infos are VMS typical needs ... not included here ... */
+
+return CREATE_SUCCESS;
+
+}
+
+int dellnm(const char *logicaltablename, const char *logicalname, int
accessmode)
+/*AFAIK, if logical_name reveals being any logical_table_name, both
table & entries are _deleted_ ...*/
+{
+
+
+logical_directory *scan_directory;
+logical_table_occ *scan_lot, *buf_lot, *scan_lot2;
+logical_node *scan_node, *buffer_node;
+
+int current_pid,
+ i,
+ j,
+ k,
+ pathchoosed,
+ *occ;
+
+current_pid=current->pid;
+
+/*Recover directory*/
+if(!strcmp(PROCESS_DIRECTORY, logicaltablename)){
+ pathchoosed=0;
+ scan_directory=&process_directory;
+ scan_lot=process_directory.lots;
+ occ=&used_process_lots;
+ }else{
+ if(strcmp(SYSTEM_DIRECTORY, logicaltablename))
+ return UNKNOWN_PATH;
+ pathchoosed=1;
+ scan_directory=&system_directory;
+ scan_lot=system_directory.lots;
+ occ=&used_system_lots;
+}
+
+ buf_lot=scan_lot;
+
+ for(i=0;i<(*occ);i++){
+ ltrace("Creation table : Check entry");
+
+ /*Scratch namespace ? */
+ if(!strcmp(logicalname,scan_lot->log_table.name)){
+ /*Avoid authorize fool in process
directory*/
+ if(pathchoosed==0)
+
if(current_pid!=scan_lot->log_table.owner_pid)
+ return
AUTHORIZE_TRY_FOOL;
+ /*Delete entries*/
+ scan_node=scan_lot->log_table.lons;
+
for(j=0;j<scan_lot->log_table.lon_occ;j++){
+
buffer_node=scan_node->next;
+ kfree(scan_node);
+ scan_node=buffer_node;
+
+ }
+ /*delete table*/
+ if(i){
+ scan_lot2=buf_lot;
+ for(k=0;k<i;k++)
scan_lot2=scan_lot2->next;
+
scan_lot2=scan_lot->next;
+ }else
scan_directory->lots=scan_lot->next;
+
+ kfree(scan_lot);
+ (*occ)?(*occ)--:NULL;
+
+ }else{
+ /*Look for logical name in
current namespace*/
+
buffer_node=scan_node=scan_lot->log_table.lons;
+
for(j=0;j<scan_lot->log_table.lon_occ;j++){
+
if((!strcmp(scan_node->name,logicalname))){
+ /*Avoid
authorize fool in process directory*/
+
if(pathchoosed==0){
+
if(current_pid!=scan_lot->log_table.owner_pid)
+
return AUTHORIZE_TRY_FOOL;
+ }
+ /*Delete
entry*/
+
buffer_node=scan_node;
+
scan_node=scan_lot->log_table.lons;
+ if(j){
+
for(k=0;k<j;k++)scan_node=scan_node->next;
+
scan_node->next=buffer_node->next;
+
scan_node=buffer_node;
+ }else
scan_lot->log_table.lons=scan_node->next;
+
+
kfree(scan_node);
+
(scan_lot->log_table.lon_occ) ? scan_lot->log_table.lon_occ--: NULL;
+
+ }
+
scan_node=scan_node->next;
+ }
+ }
+ scan_lot=scan_lot->next;
+ }
+
+ return 1;
+
+}
+
+/*
+int dellnt()
+Refer to dellnm
+{
+
+
+}
+*/
+
+int trnlnm (int attr, const char *logical_table_name, \
+ const char *logical_name, int accessmode, itemlist
*equival)
+{
+
+logical_directory *scan_directory;
+logical_table_occ *scan_lot, *buf_lot, *scan_lot2;
+logical_node *scan_node, *buffer_node;
+
+int current_pid,
+ i,
+ j,
+ k,
+ pathchoosed,
+ *occ,
+ found;
+
+
+ current_pid=current->pid;
+ /*Recover directory*/
+ if(attr&ATTR_CONFINE){
+ ltrace("Path choosed : Process");
+ pathchoosed=0;
+ scan_directory=&process_directory;
+ scan_lot=process_directory.lots;
+ occ=&used_process_lots;
+ }else{
+
+ ltrace("Path choosed : System");
+ pathchoosed=1;
+ scan_directory=&system_directory;
+ scan_lot=system_directory.lots;
+ occ=&used_system_lots;
+ }
+
+ ltrace("Recover table");
+ /*Recover table*/
+ i=0;
+ found=0;
+ while(!found){
+ for(;i<(*occ);i++){
+ if((scan_lot->log_table.owner_pid==current_pid) \
+
&&(!strcmp(logical_table_name,scan_lot->log_table.name))){
+ found=1;
+ break;
+ }
+ scan_lot=scan_lot->next;
+ }
+ if(i>=*occ)
+ break;
+
+ }
+ ltrace("Recover name fields");
+ /*Recover name*/
+ if (found){
+ /*Look for logical name in current namespace*/
+ buffer_node=scan_node=scan_lot->log_table.lons;
+ for(j=0;j<scan_lot->log_table.lon_occ;j++){
+
if((!strcmp(scan_node->name,logical_name))){
+ /*Avoid authorize fool
in process directory*/
+ if(pathchoosed==0){
+
if(current_pid!=scan_lot->log_table.owner_pid)
+
return AUTHORIZE_TRY_FOOL;
+ }
+ /*Capture entry & return
in 'equival' structure*/
+ copy_to_user(equival,
&(scan_node->meanitem), sizeof(itemlist));
+
+/* setname(equival->adrBuf,
scan_node->meanitem.adrBuf);*/
+ }
+ scan_node=scan_node->next;
+ }
+ }
+}
+
Binary files linux.vanilla/ipc/loname.o and linux.fab/ipc/loname.o
differ
Binary files linux.vanilla/kernel/kernel.o and linux.fab/kernel/kernel.o
differ
diff -urN linux.vanilla/kernel/sys.c linux.fab/kernel/sys.c
--- linux.vanilla/kernel/sys.c Tue Jun 8 01:18:16 1999
+++ linux.fab/kernel/sys.c Sun Oct 3 13:46:18 1999
@@ -11,7 +11,9 @@
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/prctl.h>
-
+#include <linux/ipcvms.h>
+#define _KSPACE
+#include <linux/loname.h>
#include <asm/uaccess.h>
#include <asm/io.h>

@@ -1000,5 +1002,72 @@
break;
}
return error;
+}
+
+/* VMS Ipc De-multiplexer stuff (Fab) */
+asmlinkage int sys_vmsipc( uint call, loname_argstruct *args)
+{
+ int report;
+ loname_argstruct arg_import;
+ copy_from_user(&arg_import, args, sizeof(loname_argstruct));
+ arg_import.firstptr=getname(args->firstptr);
+ arg_import.secondptr=getname(args->secondptr);
+ report=PTR_ERR(arg_import.firstptr);
+ /*Check afterwards for incase plug cohesive ... */
+ if (call<=LONAMEMAX){
+ switch(call){
+ case LOTCREA:
+ if (IS_ERR(arg_import.firstptr))
+ goto out;
+ report=PTR_ERR(arg_import.secondptr);
+ if (IS_ERR(arg_import.secondptr))
+ goto out;
+ return crelnt(arg_import.first, \
+ arg_import.firstptr, arg_import.second, \
+ arg_import.secondptr,arg_import.third);
+ case LONCREA:
+
+ if (IS_ERR(arg_import.firstptr))
+ goto out;
+ report=PTR_ERR(arg_import.secondptr);
+ if (IS_ERR(arg_import.secondptr))
+ goto out;
+ copy_from_user(arg_import.firstitem,
args->firstitem, sizeof(itemlist));
+
arg_import.firstitem->adrBuf=getname(args->firstitem->adrBuf);
+
+ return crelnm(arg_import.first, \
+ arg_import.firstptr, arg_import.secondptr,
\
+ arg_import.second, arg_import.firstitem);
+ case LONDEL:
+
+ if (IS_ERR(arg_import.firstptr))
+ goto out;
+ report=PTR_ERR(arg_import.secondptr);
+ if (IS_ERR(arg_import.secondptr))
+ goto out;
+ return dellnm(arg_import.firstptr, \
+ arg_import.secondptr,arg_import.first);
+/*
+ case LOTDEL:
+*/
+ case LONREAD:
+
+ if (IS_ERR(arg_import.firstptr))
+ goto out;
+ report=PTR_ERR(arg_import.secondptr);
+ if (IS_ERR(arg_import.secondptr))
+ goto out;
+ return
trnlnm(arg_import.first,arg_import.firstptr,arg_import.secondptr, \
+ arg_import.second,
arg_import.firstitem);
+ }
+ }
+ /*
+ if (call <= MBMAX){
+
+ }
+ */
+
+ out:
+ return report;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/