Skip to content

Instantly share code, notes, and snippets.

View ghostmansd's full-sized avatar

Dmitry Selyutin ghostmansd

View GitHub Profile
@ghostmansd
ghostmansd / dirpath.c
Created February 19, 2015 18:30
dirpath(3) and fdirpath(3)
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@ghostmansd
ghostmansd / bug.c
Created July 11, 2014 13:56
libntoh never can find a stream
/*- clang -std=c89 bug.c -o bug -lntoh */
#ifdef __STRICT_ANSI__
#undef __STRICT_ANSI__
#endif
#ifdef _ISOC99_SOURCE
#undef _ISOC99_SOURCE
#endif
#ifdef _POSIX_SOURCE
#undef _POSIX_SOURCE
@ghostmansd
ghostmansd / mbfltest.c
Created June 25, 2014 12:45
libmbfl: cannot determine UTF-16, UTF-32 and UHC
/*
* libmbfl UTF-16 and UTF-32 bug example.
* gcc -o mbfl_test mbfltest.c -ldl
* One may need to adjust CONST_MBFL_PATH to run this program.
*/
#include <stdio.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <mbfl/mbfilter.h>