/************************************************* * Exim - an Internet mail transport agent * *************************************************/ /* Copyright (c) The Exim Maintainers 2025 - 2026 */ /* Copyright (c) Jeremy Harris 2016 - 2025 */ /* Copyright (c) University of Cambridge 2016 */ /* SPDX-License-Identifier: GPL-2.0-or-later */ /* See the file NOTICE for conditions of use and distribution. */ /* Solaris-specific code. This is concatenated onto the generic src/os.c file. */ #if defined(MISSING_UNSETENV_3) && !defined(COMPILE_UTILITY) # include "setenv.c" #endif #if _POSIX_C_SOURCE + 0 < 200809L int vdprintf(int fd, const char * fmt, va_list ap) { gstring * g; rmark reset_point = store_mark(); g = string_vformat(NULL, SVFMT_EXTEND | SVFMT_TAINT_NOCHK, fmt, ap); (void) write(fd, string_from_gstring(g), gstring_length(g)); store_reset(reset_point); return 0; } int dprintf(int fd, const char * fmt, ...) { int ret; va_list ap; va_start(ap, fmt); ret = vdprintf(fd, fmt, ap); va_end(ap); return ret; } # ifdef __SunOS_5_10 /* This should properly use size_t, but finding the defn seems too hard. For our purposes, ulong should be enough. */ unsigned long strnlen(const char * s, unsigned long maxlen) { size_t len = 0; while (len < maxlen && *s++) len++; return len; } # endif #endif /* End of os.c-SunOS5 */