diff options
author | Ben Walton <bwalton@artsci.utoronto.ca> | 2011-12-02 23:04:17 -0500 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-12-03 13:30:02 +0100 |
commit | ab8fbf44bf4633d1c326940ce1d0715fb63936d4 (patch) | |
tree | dc2e9ce704c5fd8ee2408513044ce6fc4a7ec968 /modules | |
parent | 9b764306b5b16e3554b57631842d4fedc49df043 (diff) | |
download | gnulib-ab8fbf44bf4633d1c326940ce1d0715fb63936d4.tar.gz |
Add a new sethostname module
Define sethostname on platforms that do not provide the declaration.
Provide a function for platforms that lack it. The general handling
of the provided function is to simply return -1 and set errno to
ENOSYS. A specific handler is provided for Minix.
* lib/sethostname.c (sethostname): New file. Provide sethostname
for systems that lack it.
* m4/sethostname.m4 (gl_FUNC_SETHOSTNAME): New file. Detection of
sethostname declaration and function.
* modules/sethostname: New file. Define the sethostname module.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/sethostname | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/sethostname b/modules/sethostname new file mode 100644 index 0000000000..80087569c4 --- /dev/null +++ b/modules/sethostname @@ -0,0 +1,31 @@ +Description: +sethostname() function: Set machine's hostname. + +Files: +lib/sethostname.c +m4/sethostname.m4 +m4/gethostname.m4 + +Depends-on: +unistd +errno [test $HAVE_SETHOSTNAME = 0] + +configure.ac: +gl_FUNC_SETHOSTNAME +if test $HAVE_SETHOSTNAME = 0; then + AC_LIBOBJ([sethostname]) +fi +gl_UNISTD_MODULE_INDICATOR([sethostname]) + +Makefile.am: + +Include: +<unistd.h> + +Link: + +License: +LGPLv2+ + +Maintainer: +Ben Walton |