| ... | @@ -2913,6 +2913,7 @@ pub const OpenSelfExeError = error{ | ... | @@ -2913,6 +2913,7 @@ pub const OpenSelfExeError = error{ |
| 2913 | /// On Windows, file paths cannot contain these characters: | 2913 | /// On Windows, file paths cannot contain these characters: |
| 2914 | /// '/', '*', '?', '"', '<', '>', '|' | 2914 | /// '/', '*', '?', '"', '<', '>', '|' |
| 2915 | BadPathName, | 2915 | BadPathName, |
| | 2916 | Overflow, |
| 2916 | Unexpected, | 2917 | Unexpected, |
| 2917 | } || os.OpenError || SelfExePathError || os.FlockError; | 2918 | } || os.OpenError || SelfExePathError || os.FlockError; |
| 2918 | | 2919 | |
| ... | @@ -2991,7 +2992,15 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { | ... | @@ -2991,7 +2992,15 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { |
| 2991 | // TODO could this slice from 0 to out_len instead? | 2992 | // TODO could this slice from 0 to out_len instead? |
| 2992 | return mem.sliceTo(out_buffer, 0); | 2993 | return mem.sliceTo(out_buffer, 0); |
| 2993 | }, | 2994 | }, |
| 2994 | .openbsd, .haiku => { | 2995 | .haiku => { |
| | 2996 | // The only possible issue when looking for the self image path is |
| | 2997 | // when the buffer is too short. |
| | 2998 | // TODO replace with proper constants |
| | 2999 | if (os.find_path(null, 1000, null, out_buffer.ptr, out_buffer.len) != 0) |
| | 3000 | return error.Overflow; |
| | 3001 | return mem.sliceTo(out_buffer, 0); |
| | 3002 | }, |
| | 3003 | .openbsd => { |
| 2995 | // OpenBSD doesn't support getting the path of a running process, so try to guess it | 3004 | // OpenBSD doesn't support getting the path of a running process, so try to guess it |
| 2996 | if (os.argv.len == 0) | 3005 | if (os.argv.len == 0) |
| 2997 | return error.FileNotFound; | 3006 | return error.FileNotFound; |