Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Method for Implementing an Emulation of UNIX Shared Memory System Calls in the OS/2 Operating System

IP.com Disclosure Number: IPCOM000106675D
Original Publication Date: 1993-Dec-01
Included in the Prior Art Database: 2005-Mar-21
Document File: 2 page(s) / 77K

Publishing Venue

IBM

Related People

Hidalgo, DS: AUTHOR [+2]

Abstract

Disclosed is an invention which provides a method that can be used to obtain a very close emulation of UNIX* shared memory system calls in OS/2**. The emulation of UNIX system calls is an accepted approach to porting UNIX C source code to OS/2. The differences in shared memory support between the UNIX and OS/2 operating systems makes the emulation of UNIX shared memory system calls particularly challenging.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Method for Implementing an Emulation of UNIX Shared Memory System Calls in the OS/2 Operating System

      Disclosed is an invention which provides a method that can be
used to obtain a very close emulation of UNIX* shared memory system
calls in OS/2**.  The emulation of UNIX system calls is an accepted
approach to porting UNIX C source code to OS/2.  The differences in
shared memory support between the UNIX and OS/2 operating systems
makes the emulation of UNIX shared memory system calls particularly
challenging.

      An approach used to port program code written for UNIX
platforms to other operating systems such as OS/2 is to emulate the
UNIX system calls in those operating systems, along with all the
necessary semantics of those calls and the necessary header file
definitions expected by the ported source code.  Some UNIX system
calls are easier to emulate in OS/2 than others.  Of particular
interest are the emulation of the UNIX shared memory system calls.
UNIX shared memory system calls follow different conventions from
those of OS/2 shared memory system calls.  There is no direct
correspondence between OS/2 named and unnamed shared memory APIs and
the UNIX shared memory system calls.

      This invention provides a set of algorithms that can be used to
obtain a very close emulation of UNIX shared memory system calls in
OS/2.  A key element of these algorithms is the use of the UNIX key
that is passed as input parameter to the shmget() system call, to
build an OS/2 shared memory segment name when the key value isn't
IPC_PRIVATE.  The name is built by converting the numeric value of
the key to its equivalent ASCII string, concatenating that string to
the prefix SHM, and then concatenating the resulting string to the
required OS/2 prefix "\SHAREMEM\".  The emulated shmget() function
then uses this name to call OS/2's named shared memory API
DosAllocSharedMem().  When this call succeeds, shmget() returns the
key value as the UNIX shared memory...