Skip to content

Instantly share code, notes, and snippets.

View peadar's full-sized avatar
🚁
Working from home

Peter Edwards peadar

🚁
Working from home
View GitHub Profile
#include <assert.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
@peadar
peadar / b.cc
Last active August 29, 2015 14:04
Timing for passing C++ strings by reference or value
#include <string>
int
fRef(const std::string &v)
{
}
int
fValue(std::string v)
{
}
@peadar
peadar / getvdso.c
Last active January 3, 2018 19:34
How to get the VDSO and see what's inside
#include <sys/auxv.h>
#include <stdlib.h>
#include <unistd.h>
#include <elf.h>
#ifdef __LP64__
typedef Elf64_auxv_t Elf_auxv_t;
typedef Elf64_Ehdr Elf_Ehdr;
typedef Elf64_Phdr Elf_Phdr;
#else