Skip to content

Instantly share code, notes, and snippets.

@oza
oza / hi.c
Created October 14, 2009 21:57
#include <stdio.h>
main(void){puts("hi");}
let rec fib = function
0 -> 0
| 1 -> 1
| x -> fib(x-1) + fib(x-2);;
@oza
oza / epoll.c
Created November 14, 2009 07:03
#include <stdio.h>
#include <sys/epoll.h>
void start_epoll(int fd)
{
int efd,ret;
struct epoll_event ev,events;
int buf;
efd = epoll_create(1);
/**
* How to compile in linux :
* gcc -lrt posix_timer.c
* to link posix timer functions.
*/
#include <stdio.h>
#include <time.h>
#include <signal.h>
/**
* How to compile in linux :
* gcc -lrt posix_timer.c
* to link posix timer functions.
*/
#include <stdio.h>
#include <time.h>
#include <signal.h>
all:
gcc easy_alloc.c -o easy_alloc
./easy_alloc
clean:
rm -rf easy_alloc
all:
g++ a.cpp -o a
./a
clean:
rm -rf a
all:
g++ helloserver.cpp -o helloserver
clean:
server
#ifndef __DPRINTF_H__
#define __DPRINTF_H__
#ifdef __DEBUG__
#define dprintf(fmt,...) \
printf("[%s]%d:" fmt "\n",__FUNCTION__,__LINE__,__VA_ARGS__)
#define dputs(str) \
printf("[%s]%d:" str "\n",__FUNCTION__,__LINE__)
all:
make poll
make select
poll: poll.c
gcc poll.c -o poll
select:select.c
gcc select.c -o select