Chinaunix首页 | 论坛 | 博客
  • 博客访问: 182180
  • 博文数量: 76
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 831
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-31 00:52
文章分类

全部博文(76)

文章存档

2010年(58)

2009年(18)

我的朋友

分类:

2010-04-09 13:10:53

get_fs( ) and set_fs( )


     mm_segment_t old_fs;
old_fs = get_fs();
set_fs (KERNEL_DS);
........
set_fs(old_fs)
If you want to invoke a sys call from the kernel space, then you need to save the 
kernel data segment before the call and restore that after you are done.
The piece of code you mention does exactly that.

Refer to

阅读(651) | 评论(0) | 转发(0) |
0

上一篇:__builtin_return_address

下一篇:Linux使用笔记

给主人留下些什么吧!~~