| 2007 | #if NETBSD_INSPIRED && !USE_TIMEX_T |
| 2008 | |
| 2009 | timezone_t |
| 2010 | tzalloc(char const *name) |
| 2011 | { |
| 2012 | timezone_t sp = malloc(sizeof *sp); |
| 2013 | if (sp) { |
| 2014 | int err = zoneinit(sp, name, TZLOAD_TZSTRING); |
| 2015 | if (err != 0) { |
| 2016 | free(sp); |
| 2017 | errno = err; |
| 2018 | return NULL; |
| 2019 | } |
| 2020 | } else if (!HAVE_MALLOC_ERRNO) |
| 2021 | errno = ENOMEM; |
| 2022 | return sp; |
| 2023 | } |
| 2024 | |
| 2025 | #ifndef FREE_PRESERVES_ERRNO |
| 2026 | # if ((defined _POSIX_VERSION && 202405 <= _POSIX_VERSION) \ |
nothing calls this directly
no test coverage detected