Subversion Repositories Kolibri OS

Rev

Rev 1408 | Rev 9057 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. int write_file(const char *path,const void *buff,
  3.                unsigned offset,unsigned count,unsigned *writes)
  4. {
  5.      int retval;
  6.      unsigned cnt;
  7.      __asm__ __volatile__(
  8.      "pushl $0 \n\t"
  9.      "pushl $0 \n\t"
  10.      "movl %%eax, 1(%%esp) \n\t"
  11.      "pushl %%ebx \n\t"
  12.      "pushl %%edx \n\t"
  13.      "pushl $0 \n\t"
  14.      "pushl %%ecx \n\t"
  15.      "pushl $3 \n\t"
  16.      "movl %%esp, %%ebx \n\t"
  17.      "mov $70, %%eax \n\t"
  18.      "int $0x40 \n\t"
  19.      "addl $28, %%esp \n\t"
  20.      :"=a" (retval), "=b"(cnt)
  21.      :"a"(path),"b"(buff),"c"(offset),"d"(count));
  22.      if(writes)
  23.         *writes = cnt;
  24.     return retval;
  25. };
  26.