Ich habe ein kleines Problem. Ich habe diesen Codewährend nicht erkannt wird (System call-c)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h> // serve per le FIFO
#include <fcntl.h> // serve per la open
#include <stdbool.h>
#define BUF_SIZE 100
int main (int argc,char *argv[]){
----definition of variables----
if (argc > 3) {
printf("Errore troppi argomenti da riga di start\n");
return -1;
}
if (argc < 2) {
printf("Errore pochi argomenti da riga di start\n");
return -1;
}
if(argc == 3){
pathServer=argv[1];
pathClient=argv[2];
printf("Ho stampato da riga di comando %d parametri.\n", argc);
}
if(argc == 2){
pathServer=argv[1];
printf("Ho stampato da riga di comando %d parametri.\n", argc);
}
if((mkfifo(pathClient, S_IWUSR | S_IRUSR)) < 0){
printf("Errore. FifoClient non creata.\n");
return -1;
}
fifoServer=open(pathServer, O_WRONLY);
write(fifoServer, pathClient, strlen(pathClient));
fifoClient=open(pathClient, O_RDONLY);
while(contr1) {
printf ("Inserisci comando da eseguire:\n");
(other code)
}
das Programm geht nicht in die erste Weile. es alles Kontrolle vor während und afther, dass das Terminal zeigt nichts ich weiß nicht warum, bitte helfen Sie mir
wo initialisieren Sie contr1 ?? – kunal
in ---- Definition der Variablen ---- ich mache das: bool contr1 = true; –
Was sind pathServer = argv [1]; pathClient = argv [2]; – kunal