Domanda

I have write the following code , but the compiler tell me that 'S_FIFO' is not declared , i was think that the problem is that library that containe 'S_FIFO' is not include , so i have included the last 3 library , but the problem does not solved ?

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h> 

int main()
{
    FILE* fp;
    int fd ; 
    if(mknode("/Desktop/s/test" , S_FIFO | 0666 , 0) == -1) 
        printf("ERROR \n");
    fp = fopen("/Desktop/s/test" , "r");
    char string[80] ;
    fgets(string , 80 ,fp) ; 
    fclose(fp); 
    return 0 ;
}
È stato utile?

Soluzione

You've included the correct library, but spelled the function name and macro names wrong.

It should be mknod() function with the macro S_IFIFO.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top