return hostname;
}
-// Construct a string according to a format. Caller frees.
-char*
-format(const char* format, ...)
-{
- va_list ap;
- va_start(ap, format);
-
- char* ptr = nullptr;
- if (vasprintf(&ptr, format, ap) == -1) {
- fatal("Out of memory in format");
- }
- va_end(ap);
-
- if (!*ptr) {
- fatal("Internal error in format");
- }
- return ptr;
-}
-
// This is like setenv.
void
x_setenv(const char* name, const char* value)
bool write_fd(int fd, const void* buf, size_t size);
bool copy_fd(int fd_in, int fd_out);
const char* get_hostname();
-char* format(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
void x_setenv(const char* name, const char* value);
void x_unsetenv(const char* name);
#ifndef HAVE_LOCALTIME_R