| ... | ... | @@ -2056,7 +2056,7 @@ pub const libc = struct { |
| 2056 | 2056 | |
| 2057 | 2057 | /// char *mkdtemp(char *template); |
| 2058 | 2058 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkdtemp.html |
| 2059 | | pub extern fn mkdtemp(template: [*:0]u8) [*:0]u8; |
| 2059 | pub extern fn mkdtemp(template: [*:0]u8) ?[*:0]u8; |
| 2060 | 2060 | |
| 2061 | 2061 | /// int mkfifo(const char *path, mode_t mode); |
| 2062 | 2062 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkfifo.html |
| ... | ... | @@ -3481,3 +3481,8 @@ pub fn pthread_cond_broadcast(cond: *pthread_cond_t) !void { |
| 3481 | 3481 | if (rc != 0) return errno.fromInt(rc); |
| 3482 | 3482 | std.debug.assert(rc == 0); |
| 3483 | 3483 | } |
| 3484 | pub fn mkdtemp(template: [*:0]u8) ![*:0]u8 { |
| 3485 | const rc = libc.mkdtemp(template); |
| 3486 | if (rc == null) return errno.fromInt(errno.fromLibC()); |
| 3487 | return rc.?; |
| 3488 | } |