diff options
Diffstat (limited to 'wrapper.c')
-rw-r--r-- | wrapper.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -679,3 +679,16 @@ void sleep_millisec(int millisec) { poll(NULL, 0, millisec); } + +int xgethostname(char *buf, size_t len) +{ + /* + * If the full hostname doesn't fit in buf, POSIX does not + * specify whether the buffer will be null-terminated, so to + * be safe, do it ourselves. + */ + int ret = gethostname(buf, len); + if (!ret) + buf[len - 1] = 0; + return ret; +} |