Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/gethostname.3c
Real path: /usr/share/man/man3c/gethostname.3c
Zurück
'\" te .\" Copyright (c) 2004, 2021, Oracle and/or its affiliates. .\" Copyright (c) 1983, Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. .TH gethostname 3C "3 Nov 2021" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME gethostname, sethostname \- get or set name of current host .SH SYNOPSIS .LP .nf #include <unistd.h> \fBint\fR \fBgethostname\fR(\fBchar *\fR\fIname\fR, \fBsize_t\fR \fInamelen\fR); .fi .LP .nf \fBint\fR \fBsethostname\fR(\fBchar *\fR\fIname\fR, \fBsize_t\fR \fInamelen\fR); .fi .SH DESCRIPTION .sp .LP The \fBgethostname()\fR function returns the standard host name for the current zone, as previously set by \fBsethostname()\fR. The \fInamelen\fR argument specifies the size of the array pointed to by \fIname\fR. The returned name is null-terminated unless insufficient space is provided. .sp .LP The \fBsethostname()\fR function sets the host name of the currrent zone to be \fIname\fR, which has length \fInamelen\fR. This call requires the {\fBPRIV_SYS_ADMIN\fR} privilege and is normally used only when the system is booted. .sp .LP Host names are limited to \fBMAXHOSTNAMELEN\fR characters, currently 256, defined in the <\fBnetdb.h\fR> header. .SH RETURN VALUES .sp .LP Upon successful completion, \fBgethostname()\fR and \fBsethostname()\fR return 0. Otherwise, they return \(mi1 and set \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The \fBgethostname()\fR and \fBsethostname()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fIname\fR argument is an invalid address. .RE .sp .LP The \fBsethostname()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 9n .rt The {\fBPRIV_SYS_ADMIN\fR} privilege was not asserted in the effective set of the calling process. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level MT-Safe _ Standard See \fBstandards\fR(7). .TE .sp .SH SEE ALSO .sp .LP \fBhostname\fR(1), \fBsysinfo\fR(2), \fBuname\fR(2), \fBgethostid\fR(3C), \fBattributes\fR(7), \fBprivileges\fR(7), \fBstandards\fR(7)