Skip to content

Instantly share code, notes, and snippets.

View YutaroHayakawa's full-sized avatar
🌴
On vacation

Yutaro Hayakawa YutaroHayakawa

🌴
On vacation
  • Isovalent at Cisco
  • San Jose, California, US
  • 03:38 (UTC -07:00)
  • X @YutaroHayakawa
View GitHub Profile
@YutaroHayakawa
YutaroHayakawa / list.h
Created April 13, 2016 14:27
Linux kernel linked list, modified for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.