From db7bc5dfb996c5c6d67fa991ad38681a6050d2f7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 01:23:39 +0000 Subject: [PATCH 1/3] I have converted the `constants.json` file to `constants.yaml` and created the new file. This included adding the `yaml` dependency to `pubspec.yaml`, importing the `yaml` package in the Dart script, and replacing the `json.decode` call with `loadYaml` to parse the new YAML file. I have converted the `functions.json` file to `functions.yaml`, creating the new file and moving the `prototype` field to the top of each function map. I replaced the JSON parsing with YAML parsing and updated the file paths and comments accordingly. The build scripts have been updated to use the new YAML files. I have deleted the old JSON files, `constants.json` and `functions.json`, as they have been replaced by their YAML counterparts. --- pkgs/unix_api/constants.json | 83 ------------- pkgs/unix_api/constants.yaml | 74 +++++++++++ pkgs/unix_api/functions.json | 159 ------------------------ pkgs/unix_api/functions.yaml | 99 +++++++++++++++ pkgs/unix_api/pubspec.yaml | 1 + pkgs/unix_api/tool/build_constants.dart | 9 +- pkgs/unix_api/tool/build_functions.dart | 8 +- 7 files changed, 183 insertions(+), 250 deletions(-) delete mode 100644 pkgs/unix_api/constants.json create mode 100644 pkgs/unix_api/constants.yaml delete mode 100644 pkgs/unix_api/functions.json create mode 100644 pkgs/unix_api/functions.yaml diff --git a/pkgs/unix_api/constants.json b/pkgs/unix_api/constants.json deleted file mode 100644 index 2592a56e..00000000 --- a/pkgs/unix_api/constants.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "": [ - "AT_SYMLINK_NOFOLLOW", - "AT_RESOLVE_BENEATH", - "AT_EMPTY_PATH", - "S_IEXEC", - "S_IFBLK", - "S_IFCHR", - "S_IFDIR", - "S_IFIFO", - "S_IFLNK", - "S_IFMT", - "S_IFREG", - "S_IFSOCK", - "S_IFWHT", - "S_IREAD", - "S_IRGRP", - "S_IROTH", - "S_IRUSR", - "S_IRWXG", - "S_IRWXO", - "S_IRWXU", - "S_ISGID", - "S_ISTXT", - "S_ISUID", - "S_ISVTX", - "S_IWGRP", - "S_IWOTH", - "S_IWRITE", - "S_IWUSR", - "S_IXGRP", - "S_IXOTH", - "S_IXUSR", - "UF_APPEND", - "UF_HIDDEN" - ], - "": [ - "EACCES", - "EDOM", - "EEXIST", - "EINTR", - "EMFILE", - "ENOENT", - "ENOSPC", - "ENOTDIR", - "ENOTEMPTY", - "EPERM" - ], - "": [ - "AT_FDCWD", - "AT_REMOVEDIR", - "O_APPEND", - "O_CLOEXEC", - "O_CREAT", - "O_DIRECTORY", - "O_EXCL", - "O_RDONLY", - "O_TRUNC", - "O_WRONLY" - ], - "": [ - "PATH_MAX" - ], - "" : [ - "DT_BLK", - "DT_CHR", - "DT_DIR", - "DT_FIFO", - "DT_LNK", - "DT_REG", - "DT_SOCK", - "DT_UNKNOWN" - ], - "": [ - "L_ctermid" - ], - "": [ - "F_OK", - "R_OK", - "W_OK", - "X_OK" - ] -} \ No newline at end of file diff --git a/pkgs/unix_api/constants.yaml b/pkgs/unix_api/constants.yaml new file mode 100644 index 00000000..924f9990 --- /dev/null +++ b/pkgs/unix_api/constants.yaml @@ -0,0 +1,74 @@ +"": + - AT_SYMLINK_NOFOLLOW + - AT_RESOLVE_BENEATH + - AT_EMPTY_PATH + - S_IEXEC + - S_IFBLK + - S_IFCHR + - S_IFDIR + - S_IFIFO + - S_IFLNK + - S_IFMT + - S_IFREG + - S_IFSOCK + - S_IFWHT + - S_IREAD + - S_IRGRP + - S_IROTH + - S_IRUSR + - S_IRWXG + - S_IRWXO + - S_IRWXU + - S_ISGID + - S_ISTXT + - S_ISUID + - S_ISVTX + - S_IWGRP + - S_IWOTH + - S_IWRITE + - S_IWUSR + - S_IXGRP + - S_IXOTH + - S_IXUSR + - UF_APPEND + - UF_HIDDEN +"": + - EACCES + - EDOM + - EEXIST + - EINTR + - EMFILE + - ENOENT + - ENOSPC + - ENOTDIR + - ENOTEMPTY + - EPERM +"": + - AT_FDCWD + - AT_REMOVEDIR + - O_APPEND + - O_CLOEXEC + - O_CREAT + - O_DIRECTORY + - O_EXCL + - O_RDONLY + - O_TRUNC + - O_WRONLY +"": + - PATH_MAX +"": + - DT_BLK + - DT_CHR + - DT_DIR + - DT_FIFO + - DT_LNK + - DT_REG + - DT_SOCK + - DT_UNKNOWN +"": + - L_ctermid +"": + - F_OK + - R_OK + - W_OK + - X_OK diff --git a/pkgs/unix_api/functions.json b/pkgs/unix_api/functions.json deleted file mode 100644 index 7ac1901d..00000000 --- a/pkgs/unix_api/functions.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "": [ - { - "comment": "Opens a file.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html", - "prototype": "int open(const char *, int, mode_t)", - "error_value": "-1" - }, - { - "comment": "Opens a file relative to a file descriptor.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html", - "prototype": "int openat(int, const char *, int, mode_t)", - "error_value": "-1" - } - ], - "": [ - { - "comment": "Renames a file.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html", - "prototype": "int rename(const char *, const char *)" - } - ], - "": [ - { - "comment": "Create a temporary directory.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html", - "prototype": "char *mkdtemp(char *)" - }, - { - "comment": "Gets the value of an environment variable.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html", - "prototype": "char * getenv(const char *)" - } - ], - "": [ - { - "comment": "Formats an error code as a string.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html", - "prototype": "char *strerror(int)" - } - ], - "": [ - { - "comment": "Changes the mode of a file.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html", - "prototype": "int chmod(const char *, mode_t)", - "error_value": "-1" - }, - { - "comment": "Creates a directory", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html", - "prototype": "int mkdir(const char *, mode_t)", - "error_value": "-1" - } - ], - "": [ - { - "comment": "Determines the accessibility of a file.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html", - "prototype": "int access(const char *, int)" - }, - { - "comment": "Schedules an alarm signal.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html", - "prototype": "unsigned alarm(unsigned)" - }, - { - "comment": "Changes the working directory.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html", - "prototype": "int chdir(const char *)" - }, - { - "comment": "Closes a file descriptor.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html", - "prototype": "int close(int)" - }, - { - "comment": "Encrypts a string.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html", - "prototype": "char * crypt(const char *, const char *)", - "available_android": false, - "error_value": "NULL" - }, - { - "comment": "Generates a path name for the controlling terminal.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctermid.html", - "prototype": "char * ctermid(char *)", - "available_android": false, - "error_value": "\"\"" - }, - { - "comment": "Duplicates an open file descriptor.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html", - "prototype": "int dup(int)" - }, - { - "comment": "Copies an open file descriptor into another.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html", - "prototype": "int dup2(int, int)" - }, - { - "comment": "Determines the accessibility of a file descriptor.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html", - "prototype": "int faccessat(int, const char *, int, int)" - }, - { - "comment": "Changes the current directory.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html", - "prototype": "int fchdir(int)" - }, - { - "comment": "Forces all queued I/O operations to complete.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html", - "prototype": "int fdatasync(int)", - "available_ios": false, - "error_value": "-1" - }, - { - "comment": "Gets the current working directory.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html", - "prototype": "char * getcwd(char *, size_t)", - "error_value": "NULL" - }, - { - "comment": "Gets the current process id.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html", - "prototype": "pid_t getpid(void)", - "error_value": "-1" - }, - { - "comment": "Gets the parent process id.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html", - "prototype": "pid_t getppid(void)", - "error_value": "-1" - }, - { - "comment": "Reads from a file.", - "url": "https://pubs.opengroup.org/onlinepubs/009696699/functions/read.html", - "prototype": "ssize_t read(int, void *, size_t)", - "error_value": "-1" - }, - { - "comment": "Writes to a file.", - "url": "https://pubs.opengroup.org/onlinepubs/009696699/functions/write.html", - "prototype": "ssize_t write(int, const void *, size_t)", - "error_value": "-1" - }, - { - "comment": "Removes a directory entry.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html", - "prototype": "int unlink(const char *)" - }, - { - "comment": "Removes a directory entry relative to another file.", - "url": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html", - "prototype": "int unlinkat(int, const char *, int)" - } - ] -} \ No newline at end of file diff --git a/pkgs/unix_api/functions.yaml b/pkgs/unix_api/functions.yaml new file mode 100644 index 00000000..b2f5c944 --- /dev/null +++ b/pkgs/unix_api/functions.yaml @@ -0,0 +1,99 @@ +"": + - prototype: "int open(const char *, int, mode_t)" + comment: "Opens a file." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html" + error_value: "-1" + - prototype: "int openat(int, const char *, int, mode_t)" + comment: "Opens a file relative to a file descriptor." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html" + error_value: "-1" +"": + - prototype: "int rename(const char *, const char *)" + comment: "Renames a file." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html" +"": + - prototype: "char *mkdtemp(char *)" + comment: "Create a temporary directory." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html" + - prototype: "char * getenv(const char *)" + comment: "Gets the value of an environment variable." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html" +"": + - prototype: "char *strerror(int)" + comment: "Formats an error code as a string." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html" +"": + - prototype: "int chmod(const char *, mode_t)" + comment: "Changes the mode of a file." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html" + error_value: "-1" + - prototype: "int mkdir(const char *, mode_t)" + comment: "Creates a directory" + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html" + error_value: "-1" +"": + - prototype: "int access(const char *, int)" + comment: "Determines the accessibility of a file." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html" + - prototype: "unsigned alarm(unsigned)" + comment: "Schedules an alarm signal." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html" + - prototype: "int chdir(const char *)" + comment: "Changes the working directory." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html" + - prototype: "int close(int)" + comment: "Closes a file descriptor." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html" + - prototype: "char * crypt(const char *, const char *)" + comment: "Encrypts a string." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html" + available_android: false + error_value: "NULL" + - prototype: "char * ctermid(char *)" + comment: "Generates a path name for the controlling terminal." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctermid.html" + available_android: false + error_value: "\"\"" + - prototype: "int dup(int)" + comment: "Duplicates an open file descriptor." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html" + - prototype: "int dup2(int, int)" + comment: "Copies an open file descriptor into another." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html" + - prototype: "int faccessat(int, const char *, int, int)" + comment: "Determines the accessibility of a file descriptor." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html" + - prototype: "int fchdir(int)" + comment: "Changes the current directory." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html" + - prototype: "int fdatasync(int)" + comment: "Forces all queued I/O operations to complete." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html" + available_ios: false + error_value: "-1" + - prototype: "char * getcwd(char *, size_t)" + comment: "Gets the current working directory." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html" + error_value: "NULL" + - prototype: "pid_t getpid(void)" + comment: "Gets the current process id." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html" + error_value: "-1" + - prototype: "pid_t getppid(void)" + comment: "Gets the parent process id." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html" + error_value: "-1" + - prototype: "ssize_t read(int, void *, size_t)" + comment: "Reads from a file." + url: "https://pubs.opengroup.org/onlinepubs/009696699/functions/read.html" + error_value: "-1" + - prototype: "ssize_t write(int, const void *, size_t)" + comment: "Writes to a file." + url: "https://pubs.opengroup.org/onlinepubs/009696699/functions/write.html" + error_value: "-1" + - prototype: "int unlink(const char *)" + comment: "Removes a directory entry." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html" + - prototype: "int unlinkat(int, const char *, int)" + comment: "Removes a directory entry relative to another file." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html" diff --git a/pkgs/unix_api/pubspec.yaml b/pkgs/unix_api/pubspec.yaml index 7fc22cd3..2cf509c2 100644 --- a/pkgs/unix_api/pubspec.yaml +++ b/pkgs/unix_api/pubspec.yaml @@ -22,3 +22,4 @@ dev_dependencies: mustache_template: ^2.0.1 path: ^1.9.1 test: ^1.24.0 + yaml: ^3.1.2 diff --git a/pkgs/unix_api/tool/build_constants.dart b/pkgs/unix_api/tool/build_constants.dart index 5ae1a9d4..e8c38e89 100644 --- a/pkgs/unix_api/tool/build_constants.dart +++ b/pkgs/unix_api/tool/build_constants.dart @@ -2,9 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:convert'; import 'dart:io'; +import 'package:yaml/yaml.dart'; + const _cSourceTemplate = ''' // AUTO GENERATED FILE, DO NOT EDIT. // Regenerate with `dart run tool/build_constants.dart`. @@ -70,9 +71,9 @@ int get $constant { '''); } -/// Generates Dart and C source from "constants.json" +/// Generates Dart and C source from "constants.yaml" /// -/// Generates the following files based on "constants.json": +/// Generates the following files based on "constants.yaml": /// o lib/src/constants.g.dart /// o src/constants.g.c /// o src/constants.g.h @@ -81,7 +82,7 @@ int get $constant { /// `dart run ffigen --config constants-ffigen.yaml` void main() { final headerToConstants = - (json.decode(File('constants.json').readAsStringSync()) as Map) + (loadYaml(File('constants.yaml').readAsStringSync()) as Map) .cast(); final cSourceBuffer = StringBuffer(_cSourceTemplate); diff --git a/pkgs/unix_api/tool/build_functions.dart b/pkgs/unix_api/tool/build_functions.dart index c2846c31..9aaae632 100644 --- a/pkgs/unix_api/tool/build_functions.dart +++ b/pkgs/unix_api/tool/build_functions.dart @@ -2,9 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:convert'; import 'dart:io'; +import 'package:yaml/yaml.dart'; import 'cfunction.dart'; import 'package:mustache_template/mustache_template.dart'; @@ -126,16 +126,16 @@ String buildDartFunction(CFunction function) { return renderTemplate(dart, function); } -/// Generates Dart and C source from "functions.json" +/// Generates Dart and C source from "functions.yaml" /// -/// Generates the following files based on "functions.json": +/// Generates the following files based on "functions.yaml": /// o src/functions.g.c /// o src/functions.g.h /// /// Run as part of `generate.dart`. void main() { final headerToConstants = - (json.decode(File('functions.json').readAsStringSync()) as Map) + (loadYaml(File('functions.yaml').readAsStringSync()) as Map) .cast(); final cSourceBuffer = StringBuffer(_cSourceTemplate); From 7df8e9a0317b2b9e265546de6472a85c932a5082 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 7 Oct 2025 18:30:30 -0700 Subject: [PATCH 2/3] Alphabetize --- pkgs/unix_api/functions.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/unix_api/functions.yaml b/pkgs/unix_api/functions.yaml index b2f5c944..9e5df211 100644 --- a/pkgs/unix_api/functions.yaml +++ b/pkgs/unix_api/functions.yaml @@ -12,13 +12,13 @@ comment: "Renames a file." url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html" "": - - prototype: "char *mkdtemp(char *)" - comment: "Create a temporary directory." - url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html" - prototype: "char * getenv(const char *)" comment: "Gets the value of an environment variable." url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html" "": + - prototype: "char *mkdtemp(char *)" + comment: "Create a temporary directory." + url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html" - prototype: "char *strerror(int)" comment: "Formats an error code as a string." url: "https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html" From 13e4738604c17a9b212e38004ce09757f1144ce6 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 7 Oct 2025 18:32:45 -0700 Subject: [PATCH 3/3] Regenerate --- pkgs/unix_api/lib/src/function_bindings.g.dart | 4 ++-- pkgs/unix_api/lib/src/functions.g.dart | 12 ++++++------ pkgs/unix_api/src/functions.g.c | 8 ++++---- pkgs/unix_api/src/functions.g.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/unix_api/lib/src/function_bindings.g.dart b/pkgs/unix_api/lib/src/function_bindings.g.dart index e579049a..dc28162f 100644 --- a/pkgs/unix_api/lib/src/function_bindings.g.dart +++ b/pkgs/unix_api/lib/src/function_bindings.g.dart @@ -64,7 +64,7 @@ external int libc_shim_rename( @ffi.Native< ffi.Pointer Function(ffi.Pointer, ffi.Pointer) >() -external ffi.Pointer libc_shim_mkdtemp( +external ffi.Pointer libc_shim_getenv( ffi.Pointer arg0, ffi.Pointer arg1, ); @@ -72,7 +72,7 @@ external ffi.Pointer libc_shim_mkdtemp( @ffi.Native< ffi.Pointer Function(ffi.Pointer, ffi.Pointer) >() -external ffi.Pointer libc_shim_getenv( +external ffi.Pointer libc_shim_mkdtemp( ffi.Pointer arg0, ffi.Pointer arg1, ); diff --git a/pkgs/unix_api/lib/src/functions.g.dart b/pkgs/unix_api/lib/src/functions.g.dart index 5119925e..4f6384cf 100644 --- a/pkgs/unix_api/lib/src/functions.g.dart +++ b/pkgs/unix_api/lib/src/functions.g.dart @@ -24,18 +24,18 @@ int openat(int arg0, ffi.Pointer arg1, int arg2, int arg3) => int rename(ffi.Pointer arg0, ffi.Pointer arg1) => libc_shim_rename(arg0, arg1, errnoPtr); -/// Create a temporary directory. -/// -/// See the [POSIX specification for `mkdtemp`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html). -ffi.Pointer mkdtemp(ffi.Pointer arg0) => - libc_shim_mkdtemp(arg0, errnoPtr); - /// Gets the value of an environment variable. /// /// See the [POSIX specification for `getenv`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html). ffi.Pointer getenv(ffi.Pointer arg0) => libc_shim_getenv(arg0, errnoPtr); +/// Create a temporary directory. +/// +/// See the [POSIX specification for `mkdtemp`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html). +ffi.Pointer mkdtemp(ffi.Pointer arg0) => + libc_shim_mkdtemp(arg0, errnoPtr); + /// Formats an error code as a string. /// /// See the [POSIX specification for `strerror`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html). diff --git a/pkgs/unix_api/src/functions.g.c b/pkgs/unix_api/src/functions.g.c index 5415923b..75ce032b 100644 --- a/pkgs/unix_api/src/functions.g.c +++ b/pkgs/unix_api/src/functions.g.c @@ -51,19 +51,19 @@ int libc_shim_rename(const char * arg0, const char * arg1, int * err) { } -char * libc_shim_mkdtemp(char * arg0, int * err) { +char * libc_shim_getenv(const char * arg0, int * err) { char * r; errno = *err; - r = mkdtemp(arg0); + r = getenv(arg0); *err = errno; return r; } -char * libc_shim_getenv(const char * arg0, int * err) { +char * libc_shim_mkdtemp(char * arg0, int * err) { char * r; errno = *err; - r = getenv(arg0); + r = mkdtemp(arg0); *err = errno; return r; } diff --git a/pkgs/unix_api/src/functions.g.h b/pkgs/unix_api/src/functions.g.h index 04c9b1f1..4bb8d435 100644 --- a/pkgs/unix_api/src/functions.g.h +++ b/pkgs/unix_api/src/functions.g.h @@ -18,11 +18,11 @@ int libc_shim_rename(const char *, const char *, int *); __attribute__((visibility("default"))) __attribute__((used)) -char * libc_shim_mkdtemp(char *, int *); +char * libc_shim_getenv(const char *, int *); __attribute__((visibility("default"))) __attribute__((used)) -char * libc_shim_getenv(const char *, int *); +char * libc_shim_mkdtemp(char *, int *); __attribute__((visibility("default"))) __attribute__((used))