File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -22,16 +22,17 @@ pub const GetCwdError = posix.GetCwdError;
2222/// The result is a slice of `out_buffer`, from index `0`.
2323/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
2424/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
25- pub fn getCwd (out_buffer : []u8 ) ! []u8 {
25+ pub fn getCwd (out_buffer : []u8 ) GetCwdError ! []u8 {
2626 return posix .getcwd (out_buffer );
2727}
2828
29- pub const GetCwdAllocError = Allocator .Error || posix .GetCwdError ;
29+ // Same as GetCwdError, minus error.NameTooLong + Allocator.Error
30+ pub const GetCwdAllocError = Allocator .Error || error {CurrentWorkingDirectoryUnlinked } || posix .UnexpectedError ;
3031
3132/// Caller must free the returned memory.
3233/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
3334/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
34- pub fn getCwdAlloc (allocator : Allocator ) ! []u8 {
35+ pub fn getCwdAlloc (allocator : Allocator ) GetCwdAllocError ! []u8 {
3536 // The use of max_path_bytes here is just a heuristic: most paths will fit
3637 // in stack_buf, avoiding an extra allocation in the common case.
3738 var stack_buf : [fs .max_path_bytes ]u8 = undefined ;
You can’t perform that action at this time.
0 commit comments