/******************************************** *created By: Prometheus *Date : 2009-5-19 ********************************************/ #include #include #include #include #include #include static void cp_old_stat(struct inode * inode, struct old_stat * statbuf) { struct old_stat tmp; printk("VFS: Warning: %s using old stat() call. Recompile your binary.\n", ...
by taozhijiangscu - Linux文档专区 - 2009-05-19 19:39:49 阅读(740) 回复(0)
/******************************************** *created By: Prometheus *Date : 2009-5-19 ********************************************/ /* * color="red">linux/fs/open.c * * copyright (c) 1991, 1992 Linus Torvalds */ #include #include #include #include #include #include #include #include #include #include #include #include #include extern void fcntl_remove_locks(struct task...
都说多读代码,然后反复练习,学习的比较快,请问哪里有这样的代码呢?请大家给个地址,谢谢。 [ 本帖最后由 z_h_m 于 2006-2-16 19:42 编辑 ]
版本color="red">linux-2.6.28
/* drivers/leds/leds-s3c24xx.c
*
* (c) 2006 Simtec Electronics
* http://armcolor="red">linux.simtec.co.uk/
* Ben Dooks <[email]ben@simtec.co.uk[/email]>
*
* S3c24XX - LEDs GPIO driver
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include
http://t1w.www-6.cacheibm.com/jp/e-business/cp/open/prodigy2_interstitial_b.swf
http://t1w.www-6.cacheibm.com/jp/e-business/cp/open/prodigy2_interstitial_b.swf
/* * color="red">linux/fs/open.c * * (c) 1991 Linus Torvalds */ #include string.h> #include errno.h> #include fcntl.h> #include sys/types.h> #include utime.h> #include sys/stat.h> #include color="red">linux/sched.h> #include color="red">linux/tty.h> #include color="red">linux/kernel.h> #include asm/segment.h> int sys_ustat(int dev, struct ustat * ubuf)// 取文件系统信息系统调用函数。 { return -ENOSYS; } int sys_utime(char * filename, s...
open 函数用于打开和创建文件。以下是 open 函数的简单描述 #include int open(const char *pathname, int oflag, ... /* mode_t mode */); 返回值:成功则返回文件描述符,否则返回 -1 对于 open 函数来说,第三个参数(...)仅当创建新文件时才使用,用于指定文件的访问权限位(access permission bits)。pathname 是待打开/创建文件的路径名(如 c:/cpp/a.cpp);oflag 用于指定文件...
我用gedit创建或打开一个文件一次会调用很多次系统调用吗?我想在文件创建的时候打印一条内核消息,但是每次都会打印很多条,请问,如何让内核只打印一条消息
color="red">linux 下 调用open函数返回一个文件描述符,这个open操作是仅仅生成一个标识指向该文件?还是将该文件的内容全部或部分调入cache??