Skip to content

Instantly share code, notes, and snippets.

@markrwilliams
Created December 25, 2013 23:42
Show Gist options
  • Save markrwilliams/8127943 to your computer and use it in GitHub Desktop.
Save markrwilliams/8127943 to your computer and use it in GitHub Desktop.
import ctypes
class cmsghdr0(ctypes.Structure):
_fields_ = [('cmsg_len', ctypes.c_size_t),
('cmsg_level', ctypes.c_int),
('cmsg_type', ctypes.c_int)]
class cmsghdr(ctypes.Structure):
_fields_ = cmsghdr0._fields_ + [('cmsg_data', ctypes.c_ubyte * 4)]
print ctypes.sizeof(cmsghdr0)
print ctypes.sizeof(cmsghdr)
# 16
# 24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment