Skip to content

Instantly share code, notes, and snippets.

diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 060db6a..65fdde2 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -32,7 +32,7 @@ endif
# CC = gcc
#
-COPTS = -O2 -pipe -Wall -g
+COPTS = -static -O2 -pipe -Wall -g
@kangear
kangear / freg-register_chrdev_region.c
Last active December 27, 2015 03:49
is simple DON'T edit.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
static struct cdev freg_cdev; //An instance of a character device
static dev_t ndev; //The node of the device
/* "freg"设备的全局变量 */
@kangear
kangear / freg-alloc_chrdev_region.c
Last active December 27, 2015 02:09
That's OK, don't edit.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
static struct cdev freg_cdev; //An instance of a character device
static dev_t ndev; //The node of the device
/* "freg"设备的全局变量 */
@kangear
kangear / freg-register_chrdev.c
Last active December 27, 2015 02:09
freg.c sample DON'T EDIT.
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
/* 主设备号 */
#define MAJOR_NUM 250
static ssize_t freg_read(struct file* filp, char __user *buf, size_t count, loff_t* f_pos);
static ssize_t freg_write(struct file* filp, const char __user *buf, size_t count, loff_t* f_pos);