LIST_FOR_EACH_ENTRY_SAFE
포스트: 1
Posts
1 post[Linux][Kernel] list_for_each_entry_safe() vs list_for_each_entry()
이번에는 list_for_each_entry_safe()와 list_for_each_entry() 매크로 함수 차이점에 대해서 살펴봅시다.둘 다 리눅스 커널에서 굉장히 많이 쓰는 함수이니 동작을 잘 알아두면 좋습니다. list_for_each_entry_safe() 함수 구현부는 다음과 같습니다.#define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_first_entry(head, typeof(*pos), member), \ n = list_next_entry(pos, member); \ &pos->member != (head); \ pos = n, n = list_next_entry


![[웹툰단행본] 『통제구역관리부』 1권 후기 : 이상한 변칙과 기이한 일들이 일어나는 공간에 대하여](https://img.zoomtrend.com/2026/06/09/1780996474-SE-5eda86fa-0d63-4afd-b8dd-b801879fed52.jpg)
