-
Notifications
You must be signed in to change notification settings - Fork 2
/
attr.c
98 lines (82 loc) · 2.12 KB
/
attr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Hack to enable per user settings for NWN.
*
* Copyright 2004 - David Holland [email protected]
* Copyright 2008 - David Holland [email protected]
*
* Do what you want with the code, just maintain
* the copyright, and give credit
*
* No, none of this code is particularly efficient, but it
* arguably doesn't have to be, as at worst, it's specifically
* targetted towards NWN, and hopefully you don't have more than
* a few hundred save games..
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include <limits.h>
#include <dlfcn.h>
#include <pwd.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdarg.h>
#ifdef XATTR
#include <attr/xattr.h>
#endif
#include "code.h"
#ifdef XATTR
ssize_t getxattr (const char *path, const char *name, void *value, size_t size) {
errno = ENOTSUP;
return(-1);
}
ssize_t lgetxattr (const char *path, const char *name, void *value, size_t size) {
errno = ENOTSUP;
return(-1);
}
ssize_t fgetxattr (int filedes, const char *name, void *value, size_t size) {
errno = ENOTSUP;
return(-1);
}
int setxattr (const char *path, const char *name, const void *value, size_t size, int flags) {
errno = ENOTSUP;
return(-1);
}
int lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags) {
errno = ENOTSUP;
return(-1);
}
int fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags) {
errno = ENOTSUP;
return(-1);
}
ssize_t listxattr (const char *path, char *list, size_t size) {
errno = ENOTSUP;
return(-1);
}
ssize_t llistxattr (const char *path, char *list, size_t size) {
errno = ENOTSUP;
return(-1);
}
ssize_t flistxattr (int filedes, char *list, size_t size) {
errno = ENOTSUP;
return(-1);
}
int removexattr (const char *path, const char *name) {
errno = ENOTSUP;
return(-1);
}
int lremovexattr (const char *path, const char *name) {
errno = ENOTSUP;
return(-1);
}
int fremovexattr (int filedes, const char *name) {
errno = ENOTSUP;
return(-1);
}
#endif