ChinaUnix.net
相关文章推荐:

scp linux 系统调用 错误码

请问各位大侠 磁盘I/O 是慢系统调用吗?APUE上这句话不知道怎么理解: The notable exception to these slow system calls is anything related to disk I/O. Although a read or a write of a disk file can block the caller temporarily (while the disk driver queues the request and then the request is executed), unless a hardware error occurs, the I/O operation always returns and unblocks the caller quickly. ...

by wliang511 - C/C++ - 2009-03-20 12:17:41 阅读(1511) 回复(2)

相关讨论

linux系统调用讲义 linux系统调用的实现 linux中的系统调用 linux中怎样编译和定制内核 linux系统调用的实现 Unix/linux操作系统的体系结构及系统调用介绍 什么是操作系统和系统调用 操作系统是从硬件抽象出来的虚拟机,在该虚拟机上用户可以运行应用程序。它负责直接与硬件交互,向用户程序提供公共服务,并使它们同硬件特性隔离。因为程序不应该依赖于下层的硬件,只有这样应用程序才能很方便的在各种不同的U...

by xzh2002 - 内核/嵌入技术 - 2003-06-15 13:48:30 阅读(806) 回复(0)

在内核模块中,获取sys_call_table的地址,函数如下: unsigned int get_sys_call_table(void) { unsigned int sys_call_off; unsigned int sys_call_table; char* p; int i; asm("sidt %0":"=m"(idtr)); printk("addr of idtr: %x\n", &idtr); memcpy(&idt, idtr.base+8*0x80, sizeof(idt)); sys_call_off=((idt.off2<<16)|idt.off1); printk("addr of idt 0x80: %x\n", sys_cal...

by guotie - C/C++ - 2009-05-19 11:33:03 阅读(1594) 回复(6)

linux技术应用开发技术祥解》 第7章,第一个程序,系统调用的。怎么不能通过编译? 代码: #include <linux/unistd.h> #include _syscall1(time_t,time,time_t *,tloc) main() {      time_t the_time;      the_time=time((time_t *)0);      printf("time:%ld",the_time); }

by hackqiang - C/C++ - 2009-04-04 14:59:59 阅读(2343) 回复(10)

ssize_t ret; while (len != 0 && (ret = read (fd, buf, len)) != 0) { if (ret == -1) { if (errno == EINTR) continue; perror ("read"); break; } len -= ret; buf += ret; } 谁知道下面这段代码怎么解释,特别是那个break if (errno == EINTR) continue; perror ("rea...

by scudong - C/C++ - 2008-11-10 23:31:43 阅读(3926) 回复(15)

1. 名称:: getpwuid/getpwnam 功能: Getpassword file entry 头文件: #include 函数原形: struct passwd *getpwuid(uid_t uid); struct passwd *getpwnam(const char *name); 参数: Uid 用户id 返回值: 若成功则返回指针,若出错则返回NULL Getpwuid函数由ls(1)程序使用,它将i节点中的数值用户id映射为用户登录名。在键入登录名时,getpwnam函数由login(1)程序使用。 这些系统信息都是在/ect/passwd文件中读...

by 湖光倒影 - 程序开发 - 2006-09-10 23:33:53 阅读(1014) 回复(0)

最近看x86info的代码, 其中linux和FreeBSD的cpuid()函数各自有一个实现,但是调用的native_cpuid()函数是一致的: 都调用了sched_getaffinity(), 但是我印象里这个函数是linux特有的系统调用, 难道FreeBSD也支持它? PS: 我在考虑把x86info移植到solaris上。

by albcamus - BSD - 2009-04-08 21:55:30 阅读(3768) 回复(3)

请问一下:下面的程序为什么不会输出 :hello! int main() { execl("/bin/ls","ls","-l",NULL); prinf("hello!"); exit(0); } 假如本进程叫作进程1,那么它在执行完execl之后是不是进程1的代码区已被ls的代码区所覆盖了,而不能执行进程1中下面的部分,还是别的原因,小弟想知道它的机制和原理,请各位高手不吝赐教!谢谢。

by helun - C/C++ - 2008-12-07 10:05:44 阅读(3086) 回复(6)

1. 名称:: getpid 功能: 获得进程id. 头文件: #include 函数原形: pid_t getpid(void); 参数: 无 返回值: 进程id. 每个进程都有一个非负整数表示的唯一进程id。系统中有一些专用的进程该进程是内核的一部分,它并不执行任何磁盘上的程序。因此也被称为系统进程。 进程1通常是init进程,在自举过程完成时有内核调用。此进程负责在自举内核后启动一个UNIX系统。init通常读与系统有关的初始化文件(/ect/re*文件...

by 湖光倒影 - 程序开发 - 2006-09-10 23:36:20 阅读(895) 回复(0)

1. 名称:: exit/_exit 功能: 终止一个进程 头文件: #include (exit) #include (_exit) 函数原形: void exit(int status); void _exit(int status); 参数: status 终止状态 返回值: 无 exit和_exit函数用于正常终止一个程序:_exit立即进入内核,exit则先执行一些清除处理,然后进入内核。 exit函数总是执行一个标准I/O库的清除关闭操作,对于所有打开流调用fclose函数,把所缓存中的所有数据都写...

by 湖光倒影 - 程序开发 - 2006-09-10 23:34:38 阅读(707) 回复(0)