![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux编程
rickys2080
Just for fun
展开
-
linux coredump 使用
1. 查看是否开启coredump: ulimit -c2. 开启coredump: ulimit -c unlimited3. 运行编译出的程序,在同目录下生成core文件4. 查看core文件定位崩溃点:gdb ./your_execute core...原创 2019-12-20 17:44:53 · 142 阅读 · 0 评论 -
几种linux下自动生成Makefile的方法
GNU Autotools 依次运行如下命令: autoscan viMakefile.am//添加此文件并编辑内容 aclocal autoheader automake -a autoconf ./configure make 参考:https://blog.csdn.net/memoryjs/article/details/7860783 qdevelop 安装好...转载 2019-11-19 17:08:14 · 549 阅读 · 0 评论 -
LINUX命令缩写全拼
/bin = BINaries/dev = DEVices/etc = ETCetera/lib = LIBrary/proc = PROCesses/sbin = Superuser BINaries/tmp = TeMPorary/usr = Unix Shared Resources/var = VARiable ?FIFO = First In, Fir...转载 2019-04-11 13:01:40 · 328 阅读 · 0 评论 -
Linux查找find命令详解
在 Linux 命令中,find用于在指定目录下查找文件。任何位于参数之前的字符串都将被视为欲查找的目录名,其支持按名称查找、按正则表达式查找、按文件大小查找、按文件权限查找等多种查询方式。如果在使用该命令时,不设置任何参数,则find命令将在当前目录下查找子目录与文件,并且将查找到的子目录和文件全部进行显示。语法:find + 目标目录(路径) + <选项> + 参数常用选项列...转载 2019-02-22 09:22:35 · 236 阅读 · 0 评论 -
在Linux中开机自动运行普通用户脚本程序
测试环境:Fedora7,管理员:root,普通用户:test1实现目标:在Linux启动时,自动运行位于普通用户test1根目录下的脚本程序test.py,该程序会在每次执行时自动向本地日志文件追加一条记录,源码如下:from datetime import datetimenow=datetime.now()f=open('tes转载 2016-10-11 14:47:01 · 5948 阅读 · 0 评论 -
Linux bash 特殊命令备忘
1. 显示当前目录下的所有子目录(不显示文件名称):原创 2014-10-23 18:32:40 · 853 阅读 · 0 评论 -
C语言中的typeof关键字
from: http://module77.is-programmer.com/posts/22102.htmltypeof关键字是C语言中的一个新扩展。typeof的参数可以是两种形式:表达式或类型。下面是使用表达式的的例子: typeof(x[0](1)这里假设x是一个函数指针数组,这样就可以得到这个函数返回值的类型了。如果将typeof用于表达式,则该表达式不会转载 2014-07-15 09:21:46 · 1054 阅读 · 0 评论 -
linux驱动的Makefile编写
Makefile如下:obj-m := hello.o KERNEL_DIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules clean: rm *.o *.ko *.mod.c原创 2014-07-17 11:51:00 · 1021 阅读 · 0 评论 -
container_of()宏
from:http://www.cnblogs.com/sdphome/archive/2011/09/14/2176624.html转载 2014-07-15 09:22:13 · 759 阅读 · 0 评论 -
Linux多线程编程简例6个
//创建多线程#include #include #include #include #include pthread_t ntid;void printids(const char *s){ pid_t pid; pthread_t tid; pid = getpid(); tid = pthread_self(); printf("%s pid %u tid原创 2012-08-28 17:00:16 · 1483 阅读 · 0 评论 -
学习linux编程的资源汇总
驱动编程:http://blog.csdn.net/fudan_abc/?viewmode=contents应用编程:http://www.eefocus.com/html/09-11/26160910394Yba.shtmlLinux内核源代码下载:http://www.kernel.org/原创 2012-08-21 17:33:08 · 953 阅读 · 0 评论 -
Ubuntu-11.10之Gedit中文乱码问题
缺省配置下,用Ubuntu 的文本编辑器(gedit)打开GB18030/GBK/GB2312 等类型的中文编码文本文件时,将会出现乱码。 出现这种情况的原因是,gedit 使用一个编码匹配列表,只有在这个列表中的编码才会进行匹配,不在这个列表中的编码将显示为乱码。 您要做的就是将GB18030 加入这个匹配列表。 1、命令行方式转载 2012-08-20 08:59:48 · 1037 阅读 · 0 评论 -
Linux驱动编程(一)
简单的Linux驱动代码:// mem.c文件#include #include MODULE_LICENSE("GPL");static int mem_init(void){ printk(KERN_ALERT "hello, kernel\n"); return 0;}static void mem_exit(void){ printk(KERN_ALER原创 2012-08-16 16:56:29 · 1645 阅读 · 0 评论 -
linux编程1: makefile的编写
makefile例如:test: add.o sub.o gcc -o test add.o sub.oadd.o: add.c test.h gcc -c add.csub.o: sub.c test.h gcc -c sub.c clean: rm -rf test rm -rf *.o格式是:要生成的文件名(含后缀名):所依赖的文件列表(含后缀名)原创 2012-02-29 22:22:15 · 1088 阅读 · 0 评论 -
Linux编程2: 进程
先来个例程:#include #include #include int main(int argc, char* argv[]){ pid_t pid; pid = fork(); if(0 == pid) { printf("This is child process, %d\n", getpid()); slee原创 2012-03-01 22:12:14 · 772 阅读 · 0 评论