Whamcloud - gitweb
use one place for syscall.h
[fs/lustre-release.git] / libsysio / src / stdlib.c
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  * 
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  * 
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  */
17
18 /*
19  * stdlib.c
20  *
21  * The only purpose of this file is help liblustre adaptive to more
22  * applications, and specifically for running on Linux. The ideal
23  * final solution would be remove this completely and only rely on
24  * system call interception. Unfortunately we failed to find that
25  * way at the moment.
26  *
27  * Initially we try the simplest implementation here, just get a confidence
28  * it could work.
29  *
30  */
31 #if !(defined(BSD) || defined(REDSTORM))
32
33 #include <stdlib.h>
34 #include <errno.h>
35 #include <fcntl.h>
36 #include <dirent.h>
37
38 #include <sysio.h>
39
40 #include "sysio-symbols.h"
41
42 /***********************************************************
43  * FIXME workaround for linux only                         *
44  ***********************************************************/
45
46 #define LINUX
47 #if defined(LINUX)
48 ssize_t getxattr(char *path, char *name, void *value, size_t size)
49 {
50         errno = ENOSYS;
51         return -1;
52 }
53
54 ssize_t lgetxattr(char *path, char *name, void *value, size_t size)
55 {
56         errno = ENOSYS;
57         return -1;
58 }
59
60 ssize_t fgetxattr(int fd, char *name, void *value, size_t size)
61 {
62         errno = ENOSYS;
63         return -1;
64 }
65
66 long setxattr(char *path, char *name, void *value, size_t size, int flags)
67 {
68         errno = ENOSYS;
69         return -1;
70 }
71
72 long lsetxattr(char *path, char *name, void *value, size_t size, int flags)
73 {
74         errno = ENOSYS;
75         return -1;
76 }
77
78 long fsetxattr(int fd, char *name, void *value, size_t size, int flags)
79 {
80         errno = ENOSYS;
81         return -1;
82 }
83
84 long listxattr(char *path, char *list, size_t size)
85 {
86         errno = ENOSYS;
87         return -1;
88 }
89
90 long llistxattr(char *path, char *list, size_t size)
91 {
92         errno = ENOSYS;
93         return -1;
94 }
95
96 long flistxattr(int fd, char *list, size_t size)
97 {
98         errno = ENOSYS;
99         return -1;
100 }
101
102 long removexattr(char *path, char *name)
103 {
104         errno = ENOSYS;
105         return -1;
106 }
107
108 long lremovexattr(char *path, char *name)
109 {
110         errno = ENOSYS;
111         return -1;
112 }
113
114 long fremovexattr(int fd, char *name)
115 {
116         errno = ENOSYS;
117         return -1;
118 }
119 #endif
120
121 #endif