ioctl //user space int ioctl(int fd,unsigned long cmd,...); //kernel space int (*ioctl)(struct inode *inode,struct file* filp,unsigned int cmd,unsigned long arg) Blocking I/O #include <linux/wait.h> wait_queue_head_t my_queue; DECLARE_WAIT_QUEUE_HEA…
kmalloc #include <linux/slab.h> void *kmalloc(size_t size,int flags); void kfree(void *addr); flags: GFP_ATOMIC: Used to allocate memory from interrupt handlers and other code outside of a process context.Never sleeps GFP_KERNEL: Normal allocation o…
How to make docker use aufs in CentOS 7? - Server Faulthttps://serverfault.com/questions/650208/how-to-make-docker-use-aufs-in-centos-7 bnied/kernel-ml-aufs: Mainline kernel packages, with AUFS support.https://github.com/bnied/kernel-ml-aufs kernel-m…
Concurrency and Its Management Race condition can often lead to system crashes, memory leak,corrupted data,or security problem as well avoid the use of global variables The Linux Semaphore Implementation Semaphore #include <linux/semaphore.h> void s…
Measuring Time Lapses The counter and the utility functions to read it live in <linux/jiffies.h>.Needless to say both jiffies and jiffies_64 must be considered read-only. Processor-Specific Registers #include <asm/msr.h> rdtsc(low32,high32); r…