Logo Search packages:      
Sourcecode: pcsc-lite version File versions

INTERNAL void* SYS_PublicMemoryMap ( int  iSize,
int  iFid,
int  iOffset 
)

Map the file iFid in memory only for reading.

Parameters:
[in] iSize Size of the memmory mapped.
[in] iFid File which will be mapped in memory.
[in] iOffset Start point of the file to be mapped in memory.
Returns:
Address of the memory map.

Definition at line 245 of file sys_unix.c.

Referenced by SCardEstablishContextTH().

{

      void *vAddress;

      vAddress = 0;
      vAddress = mmap(0, iSize, PROT_READ, MAP_SHARED, iFid, iOffset);
      if (vAddress == (void*)-1) /* mmap returns -1 on error */
      {
            Log2(PCSC_LOG_CRITICAL, "SYS_PublicMemoryMap() failed: %s",
                  strerror(errno));
            vAddress = NULL;
      }

      return vAddress;
}


Generated by  Doxygen 1.6.0   Back to index