GNU Build System: Automake, Autoconf, Libtool

Reading Time: 4 minutes Brief GNU Build System: Automake, Autoconf, Libtool are a suite of programming tools used to make source code packages portable to many Unix-like systems. Why We Need Autotools: Autoconf: automatically generates configure script by scans of existing tree to find […]

Dynamic Linking Example

Reading Time: 4 minutes Following example covers API like dladdr, dlclose, dlerror, dlopen, dlsym and flags like RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, `RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_NEXT, RTLD_DEFAULT, etc. At First Sight, This Might Look Lengthy & Alien, But If You Spend 5 Min, You Might Get What You Looking […]

How Program Gets Run: Linux

Reading Time: 9 minutes I know it’s long, but please bear with me & have patience. How do we launch our programs? Do you know how programs get runs behind the screen when you double-click on it or you type ./a.out on shell As […]

How to hack C/C++ application using RTLD_NEXT with an easy example

Reading Time: 4 minutes While I was working as a core C library developer with my previous employer. I came across this RTLD_NEXT flag in dynamic linking which has the amazing capability and can be easily exploited or used for unethical purpose(Here I intend […]

Execute Threads Parallelly at Given Time: pthread_barrier_t

Reading Time: 2 minutes Why we need pthread_barrier_t? When multiple threads are working together, it might be required that the threads wait for each other at a certain event or point in the program before proceeding ahead. Let us say we have four threads, […]

Understand ELF file format

Reading Time: 8 minutes ELF is the file format used for object files (.os), binaries, shared libraries and core dumps in Linux. ELF has the same layout for all architectures, however endianness and word size can differ; relocation types, symbol types and the like […]

Unix Domain Socket

Reading Time: 3 minutes Brief A Unix domain socket or IPC socket is a data communications endpoint for exchanging data between processes executing on the same host operating system. The API for Unix domain sockets is similar to that of an Internet socket, but […]

A Bit About vfork

Reading Time: < 1 minute What is vfork ? It’s a special case of a clone. It is used to create new processes without copying the page tables of the parent process. calling thread is suspended until the child call execve or _exit. Points To […]

Thread Conditional Wait with Mutex : pthread_cond_t

Reading Time: 2 minutes Brief Condition variables provide yet another way for threads to synchronize. While mutexes implement synchronization by controlling thread access to data, condition variables allow threads to synchronize based upon the actual value of data. Without condition variables, the programmer would […]

Error Handling : setjmp & longjmp

Reading Time: < 1 minute Points To Catch As for the control flow: setjmp returns twice, and longjmp never returns. When you call setjmp for the first time, to store the environment, it returns zero, And then when you call longjmp, the control flow passes […]