Skip to content

Instantly share code, notes, and snippets.

@roychen
roychen / list.h
Created January 31, 2012 15:08
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.
@roychen
roychen / .gitignore
Created January 13, 2012 13:47 — forked from bkeepers/.gitignore
My Sublime settings
*