OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [initial/] [uclinux/] [uC-libc/] [include/] [unistd.h] - Blame information for rev 1769

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* unistd.h <ndf@linux.mit.edu> */
2
#include <features.h>
3
#include <sys/types.h>
4
 
5
#ifndef __UNISTD_H
6
#define __UNISTD_H
7
 
8
#include <errno.h>
9
#include <asm/unistd.h>
10
 
11
#define STDIN_FILENO 0
12
#define STDOUT_FILENO 1
13
#define STDERR_FILENO 2
14
 
15
 
16
 
17
extern int close __P ((int));
18
extern size_t read __P ((int __fd, char * __buf, size_t __nbytes));
19
extern size_t write __P ((int __fd, __const char * __buf, size_t __n));
20
extern off_t lseek __P ((int __fd, off_t __n, int __whence));
21
extern int pipe __P ((int __pipedes[2]));
22
extern unsigned int alarm __P ((unsigned int __seconds));
23
extern int sleep __P ((unsigned int __seconds));
24
extern void usleep __P ((unsigned long __microseconds));
25
extern int pause __P ((void));
26
extern char*    crypt __P((__const char *__key, __const char *__salt));
27
extern int isatty __P ((int __fd));
28
extern int readlink __P ((__const char *__path, char *__buf, size_t __len));
29
extern int link __P ((__const char *__from, __const char *__to));
30
extern int symlink __P ((__const char *__from, __const char *__to));
31
extern int readlink __P ((__const char *__path, char *__buf, size_t __len));
32
extern int unlink __P ((__const char *__name));
33
extern char *getcwd __P ((char *__buf, size_t __size));
34
extern int fchdir __P ((int __fd));
35
extern int chdir __P ((__const char *__path));
36
extern int chown __P ((__const char *__file,
37
                       uid_t __owner, gid_t __group));
38
 
39
extern int fchown __P ((int __fd,
40
                       uid_t __owner, gid_t __group));
41
 
42
extern int fsync __P ((int __fd));
43
 
44
extern int sync __P ((void));
45
 
46
extern int rmdir __P ((__const char *__path));
47
 
48
extern int rename __P((__const char* _old, __const char* _new));
49
 
50
extern int access __P ((__const char *__name, int __type));
51
 
52
extern int      reboot __P ((int __magic, int __magic_too, int __flag));
53
 
54
extern int mkstemp __P ((char * __template));
55
extern char * mktemp __P ((char * __template));
56
 
57
extern int _clone __P ((int (*fn)(void *arg), void *child_stack, int flags, void *arg));
58
 
59
 
60
#if 0                                                                         
61
#ifndef SYS_fork
62
#define SYS_fork 2
63
#endif
64
 
65
#define vfork() ({ \
66
register long __res __asm__ ("%d0"); \
67
__asm__ __volatile__ ("trap  #0" \
68
                      : "=g" (__res) \
69
                      : "0" (SYS_fork) \
70
                      : "%d0"); \
71
__res; \
72
})
73
#endif
74
 
75
#define vfork() ({                                              \
76
register unsigned long __res __asm__ ("r11") = __NR_fork;       \
77
__asm__ __volatile__ ("l.sys    1" : "=r" (__res): "r" (__res));\
78
__asm__ __volatile__ ("l.nop");                                 \
79
if (__res >= (unsigned long)-4096) {                            \
80
        errno = -__res;                                         \
81
        __res = (pid_t)-1;                                      \
82
}                                                               \
83
(pid_t)__res;                                                   \
84
})
85
 
86
 
87
#define fork fork_not_available_use_vfork
88
#define clone clone_not_available_use__clone
89
 
90
 
91
#ifndef SEEK_SET
92
#define SEEK_SET 0
93
#define SEEK_CUR 1
94
#define SEEK_END 2
95
#endif
96
 
97
#ifndef R_OK
98
#define R_OK    4               /* Test for read permission.  */
99
#define W_OK    2               /* Test for write permission.  */
100
#define X_OK    1               /* Test for execute permission.  */
101
#define F_OK    0                /* Test for existence.  */
102
#endif
103
 
104
#endif /* __UNISTD_H */
105
 
106
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.