int read(int fd, char *buf, size_t count); ------------------------------------------ On error, -1 is returned, and errno is set appropriately (to a positive number). x86/Linux 00000000 pushl %ebp 00000001 movl %esp,%ebp 00000003 pushl %ebx 00000004 movl $0x3,%eax 00000009 movl 0x8(%ebp),%ebx 0000000c movl 0xc(%ebp),%ecx 0000000f movl 0x10(%ebp),%edx 00000012 int $0x80 00000014 testl %eax,%eax 00000016 jnl 00000024 00000018 negl %eax 0000001a movl %eax,0x0 0000001f movl $0xffffffff,%eax 00000024 popl %ebx 00000025 movl %ebp,%esp 00000027 popl %ebp RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 0000001b R_386_32 errno Alpha/Digital UNIX __read: 0x10: 43e07400 addq zero, 0x3, v0 0x14: 00000083 call_pal callsys 0x18: e6600005 beq a3, 0x30 0x1c: c3a00000 br gp, 0x20 0x20: 27bd0001 ldah gp, 1(gp) 0x24: 23bd8030 lda gp, -32720(gp) 0x28: a79d8010 ldq at, -32752(gp) 0x2c: 6bfc0000 jmp zero, (at), _cerror 0x30: 6bfa8001 ret zero, (ra), 1