summaryrefslogtreecommitdiff
path: root/legacy/escape/src/lib/escape_unistd.h
diff options
context:
space:
mode:
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>2011-09-07 07:18:07 +0000
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>2011-09-07 07:18:07 +0000
commitf26611c3de57b4a90232aed44535e80d3c855ea7 (patch)
tree9ed07ed608ba4a47b17d6b62af791ef6cb1033ef /legacy/escape/src/lib/escape_unistd.h
parentdf91f38ffbbcbaa375e4f62d984d7ef1e3000d91 (diff)
Adding Escape: A compatibility library for jailbroken PS3s (PSL1GHT)
SVN revision: 63260
Diffstat (limited to '')
-rw-r--r--legacy/escape/src/lib/escape_unistd.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/legacy/escape/src/lib/escape_unistd.h b/legacy/escape/src/lib/escape_unistd.h
new file mode 100644
index 0000000000..3fc9385e88
--- /dev/null
+++ b/legacy/escape/src/lib/escape_unistd.h
@@ -0,0 +1,106 @@
1#ifndef __ESCAPE_UNISTD_H__
2#define __ESCAPE_UNISTD_H__
3
4
5/**
6 * @file escape_unistd.h
7 * @brief The file that provides functions ported from Unix in unistd.h.
8 * @defgroup Escape_Unistd_Group Unistd.h functions
9 *
10 * This header provides functions ported from Unix in unistd.h.
11 *
12 * @{
13 */
14
15/* Path function */
16/**
17 * @brief return the canonicalized absolute pathname
18 *
19 * @param path A path to canonicalize
20 * @param resolved_path A pointer of size PATH_MAX where to store the result
21 *
22 * realpath() expands all symbolic links and resolves references to /./, /../
23 * and extra '/' characters in the null-terminated string named by path to
24 * produce a canonicalized absolute pathname. The resulting pathname is
25 * stored as a null-terminated string, up to a maximum of PATH_MAX bytes,
26 * in the buffer pointed to by resolved_path. The resulting path will have
27 * no symbolic link, /./ or /../ components.
28 *
29 * If resolved_path is specified as NULL, then realpath() uses malloc(3)
30 * to allocate a buffer of up to PATH_MAX bytes to hold the resolved pathname,
31 * and returns a pointer to this buffer.
32 * The caller should deallocate this buffer using free(3).
33 *
34 */
35EAPI char *escape_realpath(const char *path, char *resolved_path);
36#ifdef realpath
37#undef realpath
38#endif
39#define realpath escape_realpath
40
41EAPI ssize_t escape_readlink(const char * path,
42 char * buf,
43 size_t bufsize);
44#ifdef readlink
45#undef readlink
46#endif
47#define readlink escape_readlink
48
49EAPI int escape_symlink(const char *path1, const char *path2);
50#ifdef symlink
51#undef symlink
52#endif
53#define symlink escape_symlink
54
55
56/**
57 * @brief check real user's permissions for a file
58 *
59 * @param pathname The path to check
60 * @param mode the permission to check
61 *
62 * access() checks whether the calling process can access the file pathname.
63 * If pathname is a symbolic link, it is dereferenced.
64 * The mode specifies the accessibility check(s) to be performed, and is either
65 * the value F_OK, or a mask consisting of the bitwise OR of one or more
66 * of R_OK, W_OK, and X_OK. F_OK tests for the existence of the file.
67 * R_OK, W_OK, and X_OK test whether the file exists and grants read, write,
68 * and execute permissions, respectively.
69 *
70 */
71EAPI int escape_access(const char *pathname, int mode);
72#ifdef access
73#undef access
74#endif
75#define access escape_access
76
77/**
78 * @brief Create a pair of sockets.
79 *
80 * @param fds A pointer that contains two sockets.
81 *
82 * Create a pair of sockets that can be use with select().
83 * Contrary to Unix, that functions does not
84 * create a pair of file descriptors.
85 *
86 * Conformity: Not applicable.
87 */
88EAPI int escape_pipe(int *fds);
89
90/**
91 * @def pipe(fds)
92 *
93 * Wrapper around escape_pipe().
94 */
95#define pipe(fds) escape_pipe(fds)
96
97
98//#define sync()
99
100
101/**
102 * @}
103 */
104
105
106#endif /* __ESCAPE_UNISTD_H__ */