Subversion Repositories Kolibri OS

Rev

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

Rev 4921 Rev 5215
Line 17... Line 17...
17
#include 
17
#include 
18
#include 
18
#include 
Line 19... Line 19...
19
 
19
 
Line -... Line 20...
-
 
20
#include "glue.h"
20
#include "glue.h"
21
 
-
 
22
static int delete_file(const char *path)
21
 
23
{
-
 
24
     int retval;
-
 
25
     __asm__ __volatile__ (
-
 
26
     "pushl $0 \n\t"
-
 
27
     "pushl $0 \n\t"
-
 
28
     "movl %1, 1(%%esp) \n\t"
-
 
29
     "pushl $0 \n\t"
-
 
30
     "pushl $0 \n\t"
-
 
31
     "pushl $0 \n\t"
22
/*
32
     "pushl $0 \n\t"
-
 
33
     "pushl $8 \n\t"
-
 
34
     "movl %%esp, %%ebx \n\t"
-
 
35
     "movl $70, %%eax \n\t"
-
 
36
     "int $0x40 \n\t"
-
 
37
     "addl $28, %%esp \n\t"
-
 
38
     :"=a" (retval)
-
 
39
     :"r" (path)
23
 * unlink -- since we have no file system,
40
     :"ebx");
-
 
41
  return retval;
-
 
42
};
24
 *           we just return an error.
43
 
25
 */
44
 
26
int
45
int
27
_DEFUN (unlink, (path),
46
_DEFUN (unlink, (path),
-
 
47
        char * path)
-
 
48
{
-
 
49
    int err;
-
 
50
 
-
 
51
    printf("%s %s\n", __FUNCTION__, path);
-
 
52
 
-
 
53
    err = delete_file(path);
-
 
54
 
-
 
55
    if (!err)
-
 
56
        return 0;
-
 
57
 
-
 
58
    if (err == 5)
28
        char * path)
59
        errno = ENOENT;
-
 
60
    else
29
{
61
        errno = EIO;
30
  errno = EIO;
62
 
Line 31... Line 63...
31
  return (-1);
63
    return (-1);
32
}
64
}