add chdir
[snitchaser:mainline.git] / src / arch / x86 / interp / syscalls / write.c
1 /* 
2  * write.c
3  * by WN @ Jun. 01, 2010
4  */
5
6 #include "syscall_handler.h"
7 #include <common/debug.h>
8 #include <xasm/syscall.h>
9
10 #ifdef PRE_LIBRARY
11 /* do nothing */
12 #endif
13
14 #ifdef POST_LIBRARY
15 DEF_HANDLER(write)
16 {
17         TRACE(LOG_SYSCALL, "write\n");
18         return 0;
19 }
20 #endif
21
22 #ifdef REPLAY_LIBRARY
23 DEF_HANDLER(write)
24 {
25         TRACE(LOG_SYSCALL, "write\n");
26         int r = regs->eax;
27         if (r > 0) {
28                 if ((regs->ebx == 1) || (regs->ebx == 2))
29                         INTERNAL_SYSCALL_int80(write, 3,
30                                         regs->ebx, regs->ecx, regs->edx);
31         }
32         return 0;
33 }
34 #endif
35
36 // vim:ts=4:sw=4
37