ssize_t write(int fd, const void *buf, size_t count);
_syscall3(int , write, int, fd, const void *,buf, unsigned int, count); <-- 매크로
#define _syscall3(type, name, type1, arg1, type2, arg2, type3,arg3) \
type name(type1, arg1, type2, arg2, type3, arg3) \
{
long __res ; \
__asm__ volatile("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name) , "b", ((long)(arg1)) , "c" ((long)(arg2)), \
"d" ((long))(arg3)) : "memory"); \
__syscall_return(type, __res); \
}
_syscall3(int , write, int, fd, const void *,buf, unsigned int, count); <-- 매크로
#define _syscall3(type, name, type1, arg1, type2, arg2, type3,arg3) \
type name(type1, arg1, type2, arg2, type3, arg3) \
{
long __res ; \
__asm__ volatile("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name) , "b", ((long)(arg1)) , "c" ((long)(arg2)), \
"d" ((long))(arg3)) : "memory"); \
__syscall_return(type, __res); \
}
'OS이야기' 카테고리의 다른 글
문자 디바이스 호출과정 (0) | 2011.12.31 |
---|---|
EXPORT_SYMBOL (1) | 2011.12.24 |
메모리 회수처리 (0) | 2011.12.23 |
swap_info_struct (0) | 2011.12.23 |
do_mmap_pgoff (0) | 2011.12.23 |