This file is indexed.

/usr/include/pbseq/alignment/ipc/SharedMemoryAllocator.hpp is in libblasr-dev 0~20161219-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef _BLASR_SHARED_MEMORY_ALLOCATOR_HPP_
#define _BLASR_SHARED_MEMORY_ALLOCATOR_HPP_

#include <iostream>
#include <string>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>

template<typename T_Data>
int AllocateMappedShare(std::string &handle, int dataLength, T_Data *&dataPtr, int &shmId) {
    std::cout << "opening shm" << std::endl;
    shmId = shm_open(handle.c_str(), O_CREAT| O_RDWR, S_IRUSR | S_IWUSR);
    if (ftruncate(shmId, sizeof(T_Data)*dataLength) == -1) {
        std::cout <<" ftruncate error: " << errno << std::endl;
    }
    std::cout << "done truncating." << std::endl;
    dataPtr = (T_Data*) mmap(NULL, sizeof(T_Data)*dataLength,
                                                PROT_READ | PROT_WRITE, MAP_SHARED, shmId, 0); 
    if (dataPtr == MAP_FAILED) {
        // 
        // Handle this better later on.
        //
        std::cout << "ERROR, MEMORY MAP FAILED." << std::endl;
        exit(1);
    }
    std::cout << "done mapping." << std::endl;
    return dataLength;
}


#endif // _BLASR_SHARED_MEMORY_ALLOCATOR_HPP_