#include <unistd.h>
Go to the source code of this file.
|
| DCLCAPI int | __access (const String &_path, int _type) |
| DCLCAPI int | __chown (const String &_path, uid_t _owner, gid_t _group) |
| DCLCAPI int | __lchown (const String &_path, uid_t _owner, gid_t _group) |
| DCLCAPI int | __chdir (const String &_path) |
| DCLCAPI int | __getcwd (String &_r) |
| DCLCAPI int | __ttyname (int fd, String &_r) |
| DCLCAPI int | __link (const String &_from, const String &_to) |
| DCLCAPI int | __symlink (const String &_from, const String &_to) |
| DCLCAPI ssize_t | __readlink (const String &_path, String &_r) |
| DCLCAPI int | __unlink (const String &_path) |
| DCLCAPI int | __rmdir (const String &_path) |
| DCLCAPI int | __getlogin (String &_r) |
| DCLCAPI int | __gethostname (String &r) |
| DCLCAPI int | __getdomainname (String _r) |
| DCLCAPI int | __truncate (const String &_path, off_t _len) |
◆ __DCL_UNISTD_H__
| #define __DCL_UNISTD_H__ 20100119 |
◆ __access()
| DCLCAPI int __access |
( |
const String & | _path, |
|
|
int | _type ) |
- Returns
- == NULL or -1, see errno
Definition at line 25 of file _unistd.cpp.
26{
28 return access(path, _type);
29}
#define STRTOMBS_ER(str, mbs)
◆ __chdir()
| DCLCAPI int __chdir |
( |
const String & | _path | ) |
|
Definition at line 43 of file _unistd.cpp.
44{
46 return chdir(path);
47}
◆ __chown()
| DCLCAPI int __chown |
( |
const String & | _path, |
|
|
uid_t | _owner, |
|
|
gid_t | _group ) |
Definition at line 31 of file _unistd.cpp.
32{
34 return chown(path, _owner, _group);
35}
◆ __getcwd()
| DCLCAPI int __getcwd |
( |
String & | _r | ) |
|
Definition at line 49 of file _unistd.cpp.
50{
51 char buf[PATH_MAX + 1];
52 char* s = getcwd(buf, sizeof(buf));
53 if (s) {
55 return 0;
56 }
57 return -1;
58}
#define MBSTOSTR_ER(mbs, nmbs, str)
◆ __getdomainname()
| DCLCAPI int __getdomainname |
( |
String | _r | ) |
|
Definition at line 125 of file _unistd.cpp.
126{
127 char buf[PATH_MAX + 1];
128 int n = getdomainname(buf, sizeof(buf));
129 if (n == 0)
131 return n;
132}
◆ __gethostname()
| DCLCAPI int __gethostname |
( |
String & | r | ) |
|
Definition at line 116 of file _unistd.cpp.
117{
118 char buf[PATH_MAX + 1];
119 int n = gethostname(buf, sizeof(buf));
120 if (n == 0)
122 return n;
123}
◆ __getlogin()
| DCLCAPI int __getlogin |
( |
String & | _r | ) |
|
Definition at line 107 of file _unistd.cpp.
108{
109 char buf[PATH_MAX + 1];
110 int n = getlogin_r(buf, sizeof(buf));
111 if (n == 0)
113 return n;
114}
◆ __lchown()
| DCLCAPI int __lchown |
( |
const String & | _path, |
|
|
uid_t | _owner, |
|
|
gid_t | _group ) |
Definition at line 37 of file _unistd.cpp.
38{
40 return lchown(path, _owner, _group);
41}
◆ __link()
| DCLCAPI int __link |
( |
const String & | _from, |
|
|
const String & | _to ) |
Definition at line 69 of file _unistd.cpp.
70{
73 return link(from, to);
74}
◆ __readlink()
| DCLCAPI ssize_t __readlink |
( |
const String & | _path, |
|
|
String & | _r ) |
Definition at line 83 of file _unistd.cpp.
84{
86 char buf[PATH_MAX + 1];
87 ssize_t n = readlink(path, buf, sizeof(buf));
88 if (n != -1) {
90 return _r.length();
91 }
92 return n;
93}
◆ __rmdir()
| DCLCAPI int __rmdir |
( |
const String & | _path | ) |
|
Definition at line 101 of file _unistd.cpp.
102{
104 return rmdir(path);
105}
◆ __symlink()
| DCLCAPI int __symlink |
( |
const String & | _from, |
|
|
const String & | _to ) |
Definition at line 76 of file _unistd.cpp.
77{
80 return symlink(from, to);
81}
◆ __truncate()
| DCLCAPI int __truncate |
( |
const String & | _path, |
|
|
off_t | _len ) |
Definition at line 134 of file _unistd.cpp.
135{
137 return truncate(path, _len);
138}
◆ __ttyname()
| DCLCAPI int __ttyname |
( |
int | fd, |
|
|
String & | _r ) |
Definition at line 60 of file _unistd.cpp.
61{
62 char buf[PATH_MAX + 1];
63 int n = ttyname_r(fd, buf, sizeof(buf));
64 if (n == 0)
66 return n;
67}
◆ __unlink()
| DCLCAPI int __unlink |
( |
const String & | _path | ) |
|
Definition at line 95 of file _unistd.cpp.
96{
98 return unlink(path);
99}