From 69aec538b456402170dc723af417ba5c05389c32 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Feb 2013 00:08:53 +0100 Subject: qmail 1.03 import --- hostname.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 hostname.c (limited to 'hostname.c') diff --git a/hostname.c b/hostname.c new file mode 100644 index 0000000..39c7f87 --- /dev/null +++ b/hostname.c @@ -0,0 +1,17 @@ +#include "substdio.h" +#include "subfd.h" +#include "readwrite.h" +#include "exit.h" + +char host[256]; + +void main() +{ + host[0] = 0; /* sigh */ + gethostname(host,sizeof(host)); + host[sizeof(host) - 1] = 0; + substdio_puts(subfdoutsmall,host); + substdio_puts(subfdoutsmall,"\n"); + substdio_flush(subfdoutsmall); + _exit(0); +} -- cgit v1.2.3