I am trying to send an integer with pipe in a POSIX system but write()
function is working for sending string or character data. Is there any way to send integer wi
Below one works fine for writing to pipe and reading from pipe as:
stop_daemon =123;
res = write(cli_pipe_fd_wr, &stop_daemon, sizeof(stop_daemon));
....
res = read(pipe_fd_rd, buffer, sizeof(int));
memcpy(&stop_daemon,buffer,sizeof(int));
printf("CLI process read from res:%d status:%d\n", res, stop_daemon);
output:
CLI process read from res:4 status:123