DCL 4.0
Loading...
Searching...
No Matches
_unistd.h File Reference
#include <unistd.h>

Go to the source code of this file.

Macros

#define __DCL_UNISTD_H__   20100119

Functions

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)

Macro Definition Documentation

◆ __DCL_UNISTD_H__

#define __DCL_UNISTD_H__   20100119

Definition at line 2 of file _unistd.h.

Function Documentation

◆ __access()

DCLCAPI int __access ( const String & _path,
int _type )
Returns
== NULL or -1, see errno

Definition at line 22 of file _unistd.cpp.

23{
24 STRTOMBS_ER(_path, path);
25 return access(path, _type);
26}
#define STRTOMBS_ER(str, mbs)
Definition __strumbs.h:33

◆ __chdir()

DCLCAPI int __chdir ( const String & _path)

Definition at line 40 of file _unistd.cpp.

41{
42 STRTOMBS_ER(_path, path);
43 return chdir(path);
44}

◆ __chown()

DCLCAPI int __chown ( const String & _path,
uid_t _owner,
gid_t _group )

Definition at line 28 of file _unistd.cpp.

29{
30 STRTOMBS_ER(_path, path);
31 return chown(path, _owner, _group);
32}

◆ __getcwd()

DCLCAPI int __getcwd ( String & _r)

Definition at line 46 of file _unistd.cpp.

47{
48 char buf[PATH_MAX + 1];
49 char* s = getcwd(buf, sizeof(buf));
50 if (s) {
51 MBSTOSTR_ER(s, (size_t)-1, _r);
52 return 0;
53 }
54 return -1;
55}
#define MBSTOSTR_ER(mbs, nmbs, str)
Definition __strumbs.h:19
ByteBuffer * buf
_r
Definition SQLField.cpp:260

◆ __getdomainname()

DCLCAPI int __getdomainname ( String _r)

Definition at line 122 of file _unistd.cpp.

123{
124 char buf[PATH_MAX + 1];
125 int n = getdomainname(buf, sizeof(buf));
126 if (n == 0)
127 MBSTOSTR_ER(buf, (size_t)-1, _r);
128 return n;
129}
void CharsetConvertException *size_t n
Definition SQLField.cpp:253

◆ __gethostname()

DCLCAPI int __gethostname ( String & r)

Definition at line 113 of file _unistd.cpp.

114{
115 char buf[PATH_MAX + 1];
116 int n = gethostname(buf, sizeof(buf));
117 if (n == 0)
118 MBSTOSTR_ER(buf, (size_t)-1, _r);
119 return n;
120}

◆ __getlogin()

DCLCAPI int __getlogin ( String & _r)

Definition at line 104 of file _unistd.cpp.

105{
106 char buf[PATH_MAX + 1];
107 int n = getlogin_r(buf, sizeof(buf));
108 if (n == 0)
109 MBSTOSTR_ER(buf, (size_t)-1, _r);
110 return n;
111}

◆ __lchown()

DCLCAPI int __lchown ( const String & _path,
uid_t _owner,
gid_t _group )

Definition at line 34 of file _unistd.cpp.

35{
36 STRTOMBS_ER(_path, path);
37 return lchown(path, _owner, _group);
38}

◆ __link()

DCLCAPI int __link ( const String & _from,
const String & _to )

Definition at line 66 of file _unistd.cpp.

67{
68 STRTOMBS_ER(_from, from);
69 STRTOMBS_ER(_to, to);
70 return link(from, to);
71}

◆ __readlink()

DCLCAPI ssize_t __readlink ( const String & _path,
String & _r )

Definition at line 80 of file _unistd.cpp.

81{
82 STRTOMBS_ER(_path, path);
83 char buf[PATH_MAX + 1];
84 ssize_t n = readlink(path, buf, sizeof(buf));
85 if (n != -1) {
87 return _r.length();
88 }
89 return n;
90}

◆ __rmdir()

DCLCAPI int __rmdir ( const String & _path)

Definition at line 98 of file _unistd.cpp.

99{
100 STRTOMBS_ER(_path, path);
101 return rmdir(path);
102}

◆ __symlink()

DCLCAPI int __symlink ( const String & _from,
const String & _to )

Definition at line 73 of file _unistd.cpp.

74{
75 STRTOMBS_ER(_from, from);
76 STRTOMBS_ER(_to, to);
77 return symlink(from, to);
78}

◆ __truncate()

DCLCAPI int __truncate ( const String & _path,
off_t _len )

Definition at line 131 of file _unistd.cpp.

132{
133 STRTOMBS_ER(_path, path);
134 return truncate(path, _len);
135}

◆ __ttyname()

DCLCAPI int __ttyname ( int fd,
String & _r )

Definition at line 57 of file _unistd.cpp.

58{
59 char buf[PATH_MAX + 1];
60 int n = ttyname_r(fd, buf, sizeof(buf));
61 if (n == 0)
62 MBSTOSTR_ER(buf, (size_t)-1, _r);
63 return n;
64}

◆ __unlink()

DCLCAPI int __unlink ( const String & _path)

Definition at line 92 of file _unistd.cpp.

93{
94 STRTOMBS_ER(_path, path);
95 return unlink(path);
96}