| ... | @@ -34,7 +34,7 @@ pub const Watch = @import("fs/watch.zig").Watch; | ... | @@ -34,7 +34,7 @@ pub const Watch = @import("fs/watch.zig").Watch; |
| 34 | /// fit into a UTF-8 encoded array of this length. | 34 | /// fit into a UTF-8 encoded array of this length. |
| 35 | /// The byte count includes room for a null sentinel byte. | 35 | /// The byte count includes room for a null sentinel byte. |
| 36 | pub const MAX_PATH_BYTES = switch (builtin.os.tag) { | 36 | pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 37 | .linux, .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .haiku, .solaris => os.PATH_MAX, | 37 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .solaris => os.PATH_MAX, |
| 38 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. | 38 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. |
| 39 | // If it would require 4 UTF-8 bytes, then there would be a surrogate | 39 | // If it would require 4 UTF-8 bytes, then there would be a surrogate |
| 40 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. | 40 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. |
| ... | @@ -54,10 +54,10 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) { | ... | @@ -54,10 +54,10 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 54 | /// (depending on the platform) this assumption may not hold for every configuration. | 54 | /// (depending on the platform) this assumption may not hold for every configuration. |
| 55 | /// The byte count does not include a null sentinel byte. | 55 | /// The byte count does not include a null sentinel byte. |
| 56 | pub const MAX_NAME_BYTES = switch (builtin.os.tag) { | 56 | pub const MAX_NAME_BYTES = switch (builtin.os.tag) { |
| 57 | .linux, .macos, .ios, .freebsd, .dragonfly => os.NAME_MAX, | 57 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly => os.NAME_MAX, |
| 58 | // Haiku's NAME_MAX includes the null terminator, so subtract one. | 58 | // Haiku's NAME_MAX includes the null terminator, so subtract one. |
| 59 | .haiku => os.NAME_MAX - 1, | 59 | .haiku => os.NAME_MAX - 1, |
| 60 | .netbsd, .openbsd, .solaris => os.MAXNAMLEN, | 60 | .solaris => os.system.MAXNAMLEN, |
| 61 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. | 61 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. |
| 62 | // If it would require 4 UTF-8 bytes, then there would be a surrogate | 62 | // If it would require 4 UTF-8 bytes, then there would be a surrogate |
| 63 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. | 63 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. |