mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 01:40:28 +00:00
rename UNIX_SOCKET_NAME_MAX to kNtUnixSocketNameMax
This commit is contained in:
parent
aabc834374
commit
55b3d86eef
2 changed files with 8 additions and 8 deletions
|
@ -79,12 +79,12 @@ textwindows size_t __normntpath(char16_t *p, size_t n) {
|
||||||
* @error ENAMETOOLONG
|
* @error ENAMETOOLONG
|
||||||
*/
|
*/
|
||||||
textwindows int __mkwin32_sun_path(
|
textwindows int __mkwin32_sun_path(
|
||||||
const char *path, char sun_path[hasatleast UNIX_SOCKET_NAME_MAX]) {
|
const char *path, char sun_path[hasatleast kNtUnixSocketNameMax]) {
|
||||||
// 1. Need +1 for NUL-terminator
|
// 1. Need +1 for NUL-terminator
|
||||||
if (!path || (IsAsan() && !__asan_is_valid_str(path))) {
|
if (!path || (IsAsan() && !__asan_is_valid_str(path))) {
|
||||||
return efault();
|
return efault();
|
||||||
}
|
}
|
||||||
char16_t tmp_path[UNIX_SOCKET_NAME_MAX];
|
char16_t tmp_path[kNtUnixSocketNameMax];
|
||||||
char *p = sun_path;
|
char *p = sun_path;
|
||||||
const char *q = path;
|
const char *q = path;
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
|
@ -98,15 +98,15 @@ textwindows int __mkwin32_sun_path(
|
||||||
} else if (IsSlash(q[0]) && q[1] == 't' && q[2] == 'm' && q[3] == 'p' &&
|
} else if (IsSlash(q[0]) && q[1] == 't' && q[2] == 'm' && q[3] == 'p' &&
|
||||||
(IsSlash(q[4]) || !q[4])) {
|
(IsSlash(q[4]) || !q[4])) {
|
||||||
if (!q[4] || !q[5]) return efault();
|
if (!q[4] || !q[5]) return efault();
|
||||||
GetTempPath(UNIX_SOCKET_NAME_MAX, tmp_path);
|
GetTempPath(kNtUnixSocketNameMax, tmp_path);
|
||||||
n = tprecode16to8(p, UNIX_SOCKET_NAME_MAX, tmp_path).ax;
|
n = tprecode16to8(p, kNtUnixSocketNameMax, tmp_path).ax;
|
||||||
p += n;
|
p += n;
|
||||||
q += 5;
|
q += 5;
|
||||||
}
|
}
|
||||||
for (; n < UNIX_SOCKET_NAME_MAX; n++) {
|
for (; n < kNtUnixSocketNameMax; n++) {
|
||||||
if (!(*p++ = *q++)) break;
|
if (!(*p++ = *q++)) break;
|
||||||
}
|
}
|
||||||
if (n == UNIX_SOCKET_NAME_MAX) {
|
if (n == kNtUnixSocketNameMax) {
|
||||||
return efault();
|
return efault();
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "libc/nt/struct/overlapped.h"
|
#include "libc/nt/struct/overlapped.h"
|
||||||
COSMOPOLITAN_C_START_
|
COSMOPOLITAN_C_START_
|
||||||
|
|
||||||
#define UNIX_SOCKET_NAME_MAX 108
|
#define kNtUnixSocketNameMax 108
|
||||||
|
|
||||||
bool isdirectory_nt(const char *);
|
bool isdirectory_nt(const char *);
|
||||||
bool isregularfile_nt(const char *);
|
bool isregularfile_nt(const char *);
|
||||||
|
@ -12,7 +12,7 @@ bool issymlink_nt(const char *);
|
||||||
bool32 ntsetprivilege(int64_t, const char16_t *, uint32_t);
|
bool32 ntsetprivilege(int64_t, const char16_t *, uint32_t);
|
||||||
char16_t *__create_pipe_name(char16_t *);
|
char16_t *__create_pipe_name(char16_t *);
|
||||||
size_t __normntpath(char16_t *, size_t);
|
size_t __normntpath(char16_t *, size_t);
|
||||||
int __mkwin32_sun_path(const char *, char[hasatleast UNIX_SOCKET_NAME_MAX]);
|
int __mkwin32_sun_path(const char *, char[hasatleast kNtUnixSocketNameMax]);
|
||||||
int __mkntpath(const char *, char16_t[hasatleast PATH_MAX]);
|
int __mkntpath(const char *, char16_t[hasatleast PATH_MAX]);
|
||||||
int __mkntpath2(const char *, char16_t[hasatleast PATH_MAX], int);
|
int __mkntpath2(const char *, char16_t[hasatleast PATH_MAX], int);
|
||||||
int __mkntpathath(int64_t, const char *, int, char16_t[hasatleast PATH_MAX]);
|
int __mkntpathath(int64_t, const char *, int, char16_t[hasatleast PATH_MAX]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue