Subversion Repositories Kolibri OS

Rev

Rev 4921 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4921 Serge 1
/* unlink.c -- remove a file.
2
 *
3
 * Copyright (c) 1995 Cygnus Support
4
 *
5
 * The authors hereby grant permission to use, copy, modify, distribute,
6
 * and license this software and its documentation for any purpose, provided
7
 * that existing copyright notices are retained in all copies and that this
8
 * notice is included verbatim in any distributions. No written agreement,
9
 * license, or royalty fee is required for any of the authorized uses.
10
 * Modifications to this software may be copyrighted by their authors
11
 * and need not follow the licensing terms described here, provided that
12
 * the new terms are clearly indicated on the first page of each file where
13
 * they apply.
14
 */
15
#include 
16
#include 
17
#include 
18
#include 
19
 
20
#include "glue.h"
21
 
5215 serge 22
static int delete_file(const char *path)
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"
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)
40
     :"ebx");
41
  return retval;
42
};
43
 
44
 
4921 Serge 45
int
46
_DEFUN (unlink, (path),
47
        char * path)
48
{
5215 serge 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)
59
        errno = ENOENT;
60
    else
61
        errno = EIO;
62
 
63
    return (-1);
4921 Serge 64
}
65
 
66
int
67
_DEFUN(link, (old, new),
68
       const char *old _AND
69
       const char *new)
70
{
71
  errno = EIO;
72
  return (-1);
73
}
74
 
75
clock_t
76
times (struct tms *tp)
77
{
78
  return -1;
79
}
80