[Linux] shared memory 생성 연결, 해제 방법 shm_open
·
💙 OS: 운영체제/💙 Linux
SYNOPSIS #include #include /* For mode constants */ #include /* For O_* constants */ int shm_open(const char *name, int oflag, mode_t mode); int shm_unlink(const char *name); Link with -lrt. shm_open() 새로운 혹은 이미 존재하는 POSIX shared memory를 open하거나 없다면 새로 생성. shm_unlink() shm_opne()으로 생성된 shared memory를 없애준다. 예시 shm_open(SHM_NAME, O_RDWR | O_CREAT, 0666); shm_unlink(SHM_NAME);
[Ubuntu Linux] makefile 만들때 오류 해결 (space를 tab으로 변환)
·
💙 OS: 운영체제/💙 Linux
makefile을 만들때 space가 아니라 tab을 사용해야 한다! 그래서 ubuntu에서 //car -e -t -v "makefile이름" cat -e -t -v makefile 을 누르면 makefile에 tab이 있는지 공백인지 확인할 수 있는데, 나는 이상하게 출력되었다. intro_exe : proj1.o main.o^M$ gcc -o intro_exe proj1.o main.o^M$ main.o : main.c^M$ gcc -c -o main.o main.c^M$ proj1.o : proj1.c^M$ gcc -c -o proj1.o proj1.c^M$ clean : ^M$ rm *.o intro_exe tab이 gcc앞에 있으니까 ^Igcc~ 이렇게 나와야 하는데 구글링해서 나오는 것과는 모..