19 lines
791 B
C
19 lines
791 B
C
// POSIX compatibility support for posix path.
|
|
|
|
#pragma once
|
|
// posix_path.h - POSIX <-> native path translation.
|
|
|
|
// SYNTHETIC sentinel returned from PosixTranslatePath for /dev/null and
|
|
// /dev/zero; the caller must handle these before passing to any syscall.
|
|
#define SYNTH_DEVNULL "\x01<devnull>"
|
|
#define SYNTH_DEVZERO "\x01<devzero>"
|
|
|
|
// Translate a POSIX path to a native kernel path.
|
|
// Returns a pointer to 'out' on success, or SYNTH_DEVNULL / SYNTH_DEVZERO
|
|
// for those synthetic devices. 'out' must be at least 512 bytes.
|
|
const char* PosixTranslatePath(const char* in, char* out, size_t outSize);
|
|
|
|
// Translate a native kernel path back to a POSIX-style path.
|
|
// Strips the drive letter prefix and flips backslashes.
|
|
void NativeToPosix(const char* in, char* out, size_t outSize);
|