![]() |
| ||
| write() error code Hi, I'm writing a small application which reads and writes to some files. MY problem is that when I write to the file in my program, I get an error, %eax is set to -14. strerror(-14) returns unknown error, and I was told on irc that posix write() doesn't return -14. As far as I can tell everything is fine with the syscall, I've triple checked everything, but it keeps failing, nothing is written to the file. .equ SYS_WRITE, 4 Thanks in advance for any help |
| ||
| Re: write() error code Can you add more then that snippet. And add comments! That 80x86 assembler you're using is camouflaging the assembly code making it harder to read due to its abstraction methodology. |
| ||
| Re: write() error code Been doing some research. You're using a Linux assembler that uses the AT&T syntax? It uses a reverse encoding and different operands. You're passing the character and not the address of the character to the file I/O. .equ SYS_WRITE, 4 I've used a multitude of assemblers before but never LINUX. This is untested so hope it works. |
| ||
| Re: write() error code yeah I'm using GAS, GNU assembler which uses AT&T syntax. You're right, I'm passing the number instead of a pointer, man I've missed how useless the error messages are in assembly :) thanks a lot that fixed the problem. Below is the updated code for clarity. I have a buffer, of size 1 byte, which I used earlier in the program to read in a number. #write 7(max) to file |
| All times are GMT -4. The time now is 2:12 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC