mmap(): enodev

Pietro Paolini P.Paolini at Genexis.eu
Sun May 25 08:46:46 EDT 2014


Hello everyone, 
in order to try to use mmap() to perform IPC I am writing a test program like this :

int main(char **argv, int argn)
{
        char *addr;
        int fd;

        if ((fd = open(FILENAME, O_RDWR) == -1)) {
                perror("open:");
                exit(1);
        }
        addr = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
        if (addr == MAP_FAILED) {
                printf("mmap() : %p %s", addr, strerror(errno));
                exit(1);
        }
        close(fd);
....


I am running under 
Linux crunchbang 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

My problem is that everytime I have got an "No such device" error which I don't fully get, could a problem of my platoform
or am I simply doing something wrong ?

Thanks all,
Pietro 



More information about the Kernelnewbies mailing list