Subversion Repositories Kolibri OS

Rev

Rev 6591 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6591 Rev 9057
Line -... Line 1...
-
 
1
#include 
Line 1... Line 2...
1
int write_file(const char *path,const void *buff,
2
 
2
               unsigned offset,unsigned count,unsigned *writes)
3
int write_file(const char *path,const void *buff,
3
{
4
               unsigned offset,unsigned count,unsigned *writes)
4
     int retval;
5
{
5
     unsigned cnt;
6
    ksys70_t k;
6
     __asm__ __volatile__(
-
 
7
     "pushl $0 \n\t"
7
    k.p00 = 3;
8
     "pushl $0 \n\t"
8
    k.p04 = offset;
9
     "movl %%eax, 1(%%esp) \n\t"
-
 
10
     "pushl %%ebx \n\t"
-
 
11
     "pushl %%edx \n\t"
9
    k.p12 = count;
12
     "pushl $0 \n\t"
10
    k.cbuf16 = buff;
13
     "pushl %%ecx \n\t"
-
 
14
     "pushl $3 \n\t"
11
    k.p20 = 0;
15
     "movl %%esp, %%ebx \n\t"
-
 
16
     "mov $70, %%eax \n\t"
-
 
17
     "int $0x40 \n\t"
12
    k.p21 = path;
18
     "addl $28, %%esp \n\t"
13
    int status;
19
     :"=a" (retval), "=b"(cnt)
14
    unsigned bytes_written_v;
20
     :"a"(path),"b"(buff),"c"(offset),"d"(count));
-
 
21
     if(writes)
15
    FS_Service(&k, &bytes_written_v);
22
        *writes = cnt;
16
    if (!status){
-
 
17
        *writes = bytes_written_v;
23
    return retval;
18
    }
24
};
19
    return status;