ChinaUnix.net
相关文章推荐:

linux modules 返回值

当函数是判断时,一般返回0作为false, 非0作为true 当返回值代表状态时,0表示成功是普遍认同的, 但非0的情况下,正负返回值有什么区别,看APUE时,有时候返回-1,有时又返回1 知道的朋友说一下自己的理解,谢了

by _nothing - C/C++ - 2014-03-25 11:50:35 阅读(1828) 回复(5)

相关讨论

刚用到system函数,要根据其返回值来做进一步操作,可是system的返回值并不等于其调用的程序的返回值,man了没看懂,后来在网上搜索了一下,终于看到了一个DX的理解,记录之。 引自: 原文 [color="#0000ff"]要分成两部分来说:  1,在程序中,用exit来设置进程的退出值时,虽然该函数的参数类型为int型,但再父进程中只能取到其值的低8位.所以用exit返回值时,高于255的值是没有意义的.  2,对于system函数,返回值是由两部分组...

by piginthetree - Linux文档专区 - 2009-07-22 13:55:00 阅读(1572) 回复(0)

转载几篇文章,留待以后参考

How to: Compile linux kernel modules
http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html

"hello world" 简单内核模块 
http://blank-dic.blog.163.com/blog/static/31018622201122111262729/

insmod: no symbol version for module_layout 
http://blank-dic.blog.163.com/blog/st...

by lerd - 移动操作系统 - 2011-12-22 08:51:12 阅读(618) 回复(0)

共享内存的基本用法: shmget shmat 调用都没有问题 对shmat做了封装,示意代码如下 char* LinkShm(int shm_id, int flag) { char *shmptr; shmptr = shmat(shm_id,NULL,flag); return shm_ptr; } 然后调用返回的值,一直是错误的,调用代码如下: char* shmptr; shmptr = LinkShm(shm_id,0); 使用gdb调试发现,函数LinkShm()中的shmptr的值是对的,返回给调用者指针shmptr时shmat返回的64位地址,高位4字节给截断了,...

by kelvin_yin - Linux环境编程 - 2012-06-29 09:31:25 阅读(1947) 回复(3)

在写一本shell中有这样一段,想进行数据库expdp 导出,但当导出出错时 $?仍然返回0, 应该如何修改呢 谢谢 su - oracle -c "expdp system/$DB_SYSTEM_PASSWD schemas=$schemas include=table directory=TEMP_DIR1 dumpfile="$schemas"_USER.dmp logfile=exp"$schemas"_USER.log" >> $logfile SQLPLUS_RET=$? if [ ${SQLPLUS_RET} -eq 0 ]; then echo "NOTE: Data exporting succeeded without error !" ...

by pjghost - Linux新手园地 - 2012-04-01 15:18:48 阅读(1044) 回复(1)

linux创建进程函数fork()正确调用一次的时候有两个返回值: 子进程返回:0 父进程返回:>0的整数(返回子进程ID号) 而错误的时候返回-1 而在介绍fork()函数时的应用例子一般都为以下结构:如下例: #include #include #include #include int main(void) { pid_t result; /*调用fork函数,其返回值为result*/ result = fork(); /*通过result的值来判断fork函数的返回情况,首...

by gdgn_526345 - 嵌入式开发 - 2012-10-10 13:02:19 阅读(6895) 回复(6)

网上高人说学习内核 通过写module开始 那是一个捷径 今天就初步的学习了下 module 就写篇以防以后查询吧 主要是参考下面得网页 来写的 还是挺好的 http://dirac.org/linux/writing/lkmpg/2.6/chinese/lkmpg_chs/#AEN30 但是按照他第二章步骤来出现了很多问题 不得不依从从网上查找资料 慢慢解决 如下 首先得把 hello module编译成功吧 首先得明白一个问题 这个hello module是用运行的内核来编译的 具...

by zjlikaifa - Linux文档专区 - 2009-08-13 17:11:09 阅读(864) 回复(0)

Finding hidden kernel modules (the extrem way) --------by madsys 1 Introduction 2 The technique of module hiding 3 Countermeasure -- brute force 4 Problem of unmapped 5 Greetings 6 References 7 Code 1 Introduction This paper presents a method for how to find out the hidden modules in linux system. Generaly speaking, most of the attackers intend to hide their modules after taking down the ...

by khyang - Linux文档专区 - 2006-03-29 19:00:55 阅读(717) 回复(0)

memcpy使用户空间函数,可以用在内核模块的设计上吗?是否可以这样理解,内核模块的所有变量都是工作在内核空间,因此不能使用用户空间的函数?

by ruger - 内核源码 - 2007-04-10 13:56:20 阅读(8260) 回复(3)

linux Device Drivers, 2nd Edition By Alessandro Rubini & Jonathan Corbet 2nd Edition June 2001 0-59600-008-1, Order Number: 0081 586 pages, $39.95 Chapter 2 Building and Running modules Contents: Kernel modules Versus Applications Compiling and Loading The Kernel Symbol Table Initialization and Shutdown Using Resources Automatic and Manual Configuration Doing It in User Space Backward Compatibi...

by pascal4123 - Linux文档专区 - 2006-09-20 14:42:15 阅读(862) 回复(0)

如果你想要升级你的Debian/Ubuntu linux内核,或者你希望为内核开发新的模块,或者您要为某个硬件写新的驱动程序……这一切都涉及到Debian/Ubuntu linux内核编程。 作为一个内核编程者,有那么几个软件是你必须要有的,看作是你进行内核编程的几件法宝吧,下面我一一列举出来: 1、gcc 大名鼎鼎的gcc我想没有人不知道的吧?它是任何编程者必然要先安装的一个武器了。不过一般如果你是安装的Debian系统,应该已经默认安装了的。要是...

by ZSHAO - Linux文档专区 - 2006-09-10 14:43:49 阅读(558) 回复(0)