#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#define QUEUE_SIZE 10
struct flock lock, unlock;
struct data
{
char name [80];
}
라인 21==>
int lock_open( int fd, int index)
{
unlock.l_start = index;
unlock.l_type = F_WRLCK;
unlock.l_len = 1;
unlock.l_whence = SEEK_SET;
return fcntl(fd, F_SETLKW, &lock);
}
아래 이런 에러가 계속 뜨네요. 이유가 뭘까요?