易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

ARM Linux驱动的编译(2.6内核)

1、将驱动源码放在/drivers/char/下
 
2、修改drivers/char/Kconfig文件,添加以下内容:
config My_Buttons
        tristate "My_Buttons test"
        depends on ARCH_S3C2440
        default y if ARCH_S3C2440
        help
            This is my ldd!!!
 
3、修改/drivers/char/Makefile文件,添加以下内容:
obj-$(CONFIG_My_Buttons) += buttons.o
 
4、make menuconfig à save à make oldconfig à make dep à make zImage
 
5、更新内核,测试驱动
 
注意:红色部分必须相同!!! ......

linux中的守护进程daemon


一. 守护进程及其特性
(1)最重要的特征是后台运行
(2)必须与运行前的环境隔离开来。这些环境通常是守护进程从执行它的父进程中继承下来的。环境包  括还未关闭的文件描述符,控制终端,会话和进程组,工作目录以及文件创建淹模等。
(3)启动方式。可以由用户终端执行,也可以从启动脚本/etc/rc.d中启动。
总之,编写守护进程实际上是把一个普通进程按照上述的守护进程的特性改造成为守护进程。
二.守护进程的编程要点
1.在后台运行
 为避免挂起控制终端将daemon放入后台执行。方法是在进程中调用fork使父进程终止,让daemon 再子进程中后台执行。
2.脱离终端控制,登入会话和进程组
  在1的基础上,调用setsid()使第一个子进程成为会话组长。由于会话过程对终端的独占性,进程同时与控制终端脱离。
     setsid();
3.禁止进程重新打开控制终端
  现在,进程已经成为无终端的会话组长。但它可以重新申请打开一个控制终端。
    可以通过使进程不再成为会话组长来禁止进程重新打开控制终端:
if(pid=fork())
     exit(0); //结束第一子进程,第二子进程继续(第二子进程不再是会话组长)
4 ......

Linux下转换字符集(UTF8转换)(

  Linux下转换字符集(UTF8转换)(转) 收藏
 在LINUX上进行编码转换时,既可以利用iconv函数族编程实现,也可以利用iconv命令来实现,只不过后者是针对文件的,即将指定文件从一种编码转换为另一种编码。
一、利用iconv函数族进行编码转换
iconv函数族的头文件是iconv.h,使用前需包含之。
#include <iconv.h>
iconv函数族有三个函数,原型如下:
(1) iconv_t iconv_open(const char *tocode, const char *fromcode);
此函数说明将要进行哪两种编码的转换,tocode是目标编码,fromcode是原编码,该函数返回一个转换句柄,供以下两个函数使用。
(2) size_t iconv(iconv_t cd,char **inbuf,size_t *inbytesleft,char **outbuf,size_t *outbytesleft);
此函数从inbuf中读取字符,转换后输出到outbuf中,inbytesleft用以记录还未转换的字符数,outbytesleft用以记录输出缓冲的剩余空间。
(3) int iconv_close(iconv_t cd);
此函数用于关闭转换句柄,释放资源。
例子1: 用C语言实现的转换示例程序
/* f.c : 代码转换示例C程序 */具体讲,自己的验证实现是根据文中的f.c实现的
#include <iconv.h>
#define OUTLEN 255
main()
{
char *in_utf8 = "姝e?ㄥ? ......

Linux常用命令

一.Linux进入与退出系统
进入Linux系统:
必须要输入用户的账号,在系统安装过程中可以创建以下两种帐号:
  1.root–超级用户帐号(系统管理员),使用这个帐号可以在系统中做任何事情。
  2.普通用户–这个帐号供普通用户使用,可以进行有限的操作。
  一般的Linux使用者均为普通用户,而系统管理员一般使用超级用户帐号完成一些系统管理的工作。如果只需要完成一些由普通帐号就能完成的任务,建议不要使用超级用户帐号,以免无意中破坏系统。影响系统的正常运行。
  用户登录分两步:第一步,输入用户的登录名,系统根据该登录名识别用户;第二步,输入用户的口令,该口令是用户自己设置的一个字符串,对其他用户是保密的,是在登录时系统用来辨别真假用户的关键字。
  当用户正确地输入用户名和口令后,就能合法地进入系统。屏幕显示:
[root@loclhost /root] #
这时就可以对系统做各种操作了。注意超级用户的提示符是“#”,其他用户的提示符是“$”。
修改口令
为了更好的保护用户帐号的安全,Linux允许用户随时修改自己的口令,修改口令的命令是passwd,它将提示用户输入旧口令和新口令,之后还要求用户再次确认 ......

Why do We Choose Linux?

Linux, named after the inventor, Linus Torvalds, is a so different OS for everyone against Windows. To everyone who used to use Windows, Linux need us to do more for everything which we usually do by computer, such as playing a video.
Someone says, Linux is for the ones who are good at the computer technique. For example the programmer use Linux to program, or the mathematician use it to do the numerical work.. It’s right. Linux always used by the professional formerly, because this OS ask the operator knows a lot about the OS how to work. Compared to Linux, Windows seems very easy for us, and in the most time, clicking the mouse is enough.
But there are two problems for us. The first one is did we get all the licenses for the software we are using. I think there is almost no one can say ‘Yes, I did’ in China, who use Windows. In the daily life, we used the piracy of the OS and the application software, although we know is wrong. There a fact that we can’t aff ......

Why do We Choose Linux?

Linux, named after the inventor, Linus Torvalds, is a so different OS for everyone against Windows. To everyone who used to use Windows, Linux need us to do more for everything which we usually do by computer, such as playing a video.
Someone says, Linux is for the ones who are good at the computer technique. For example the programmer use Linux to program, or the mathematician use it to do the numerical work.. It’s right. Linux always used by the professional formerly, because this OS ask the operator knows a lot about the OS how to work. Compared to Linux, Windows seems very easy for us, and in the most time, clicking the mouse is enough.
But there are two problems for us. The first one is did we get all the licenses for the software we are using. I think there is almost no one can say ‘Yes, I did’ in China, who use Windows. In the daily life, we used the piracy of the OS and the application software, although we know is wrong. There a fact that we can’t aff ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [778] [779] [780] [781] 782 [783] [784] [785] [786] [787]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号