私は私が解決できないこの愚かな小さな問題を抱えています...
exer3.c: In function ‘shm_pipe_pipe’:
exer3.c:69:39: error: expected ‘)’ before ‘;’ token
exer3.c:69:39: error: too few arguments to function ‘shmget’
/usr/include/i386-linux-gnu/sys/shm.h:54:12: note: declared here
ラインの69の環境:
pipes_array[i].m_key = 1;
key = i;
pipes_array[i].m_shmid = shmget(key, PIPE_SIZE, IPC_CREAT | IPC_EXCL | 0600); //69
if (pipes_array[i].m_shmid < 0) {
perror("Error");
return -1;
}
それから:
exer3.c: In function ‘shm_pipe_read’:
exer3.c:111:60: error: expected ‘)’ before ‘;’ token
ラインの111の周囲:
current_bytes_to_read = total_bytes_to_read <= pipes_array[i].m_bytes_in_pipe ? total_bytes_to_read : pipes_array[i].m_bytes_in_pipe;
//reading the information
if ((pipes_array[i].m_roffset + current_bytes_to_read) < PIPE_SIZE) { //111
memcpy(buf + offset, tbuffer + pipes_array[i].m_roffset, current_bytes_to_read);
次に:exer3.c:関数内'shm_pipe_write':exer3.c:153:41:エラー:予期される')'前';' トークン
ラインの153の環境:
while (total_bytes_to_write != 0) {
if (pipes_array[i].m_bytes_in_pipe == PIPE_SIZE) { //153
make: *** [exer3.o] Error 1
誰かがそれを手伝ってくれませんか?ありがとう!