.\" -*- coding: UTF-8 -*- .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" Modified 1995-07-22 by Michael Chastain : .\" 'gethostname' is real system call on Linux/Alpha. .\" Modified 1997-01-31 by Eric S. Raymond .\" Modified 2000-06-04, 2001-12-15 by aeb .\" Modified 2004-06-17 by mtk .\" Modified 2008-11-27 by mtk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH gethostname 2 "17 november 2024" "Linux man\-pagina's 6.12" .SH NAAM gethostname, sethostname \- krijg/zet machinenaam .SH BIBLIOTHEEK Standard C library (\fIlibc\fP,\ \fI\-lc\fP) .SH SAMENVATTING .nf \fB#include \fP .P \fBint gethostname(char *\fP\fIname\fP\fB, size_t \fP\fIsize\fP\fB);\fP \fBint sethostname(const char *\fP\fIname\fP\fB, size_t \fP\fIsize\fP\fB);\fP .fi .P .RS -4 Feature Test Macro´s eisen in glibc (zie \fBfeature_test_macros\fP(7)): .RE .P \fBgethostname\fP(): .nf .\" The above is something of a simplification .\" also before glibc 2.3 there was a bit churn _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200112L || /* glibc 2.19 en eerder */ _BSD_SOURCE .fi .P \fBsethostname\fP(): .nf .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 Vanaf glibc 2.21: _DEFAULT_SOURCE In glibc 2.19 en 2.20: _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) Tot en met glibc 2.19: _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) .fi .SH BESCHRIJVING Deze systeem aanroepen worden gebruikt om de machinenaam van het systeem op te vragen of te veranderen. Preciezer gezegd, ze werken op de machinenaam die geassocieerd is met de UTS naamruimte van het aanroepende proces. .P \fBsethostname\fP() sets the hostname to the value given in the character array \fIname\fP. The \fIsize\fP argument specifies the number of bytes in \fIname\fP. (Thus, \fIname\fP does not require a terminating null byte.) .P \fBgethostname\fP() returns the null\-terminated hostname in the character array \fIname\fP, which has a size of \fIsize\fP bytes. If the null\-terminated hostname is too large to fit, then the name is truncated, and no error is returned (but see VERSIONS below). POSIX.1 says that if such truncation occurs, then it is unspecified whether the returned buffer includes a terminating null byte. .SH "EIND WAARDE" Bij succes wordt nul teruggegeven. Bij falen wordt \-1 teruggegeven en wordt \fIerrno\fP overeenkomstig gezet. .SH FOUTEN .TP \fBEFAULT\fP \fInaam\fP is een ongeldig adres. .TP \fBEINVAL\fP .\" Can't occur for gethostbyname() wrapper, since 'size' has an .\" unsigned type; can occur for the underlying system call. \fIsize\fP is negative or, for \fBsethostname\fP(), \fIsize\fP is larger than the maximum allowed size. .TP \fBENAMETOOLONG\fP (glibc \fBgethostname\fP()) \fIsize\fP is smaller than the actual size. (Before glibc 2.1, glibc uses \fBEINVAL\fP for this case.) .TP \fBEPERM\fP Met \fBsethostname\fP() had de aanroeper niet de benodigde \fBCAP_SYS_ADMIN\fP capaciteit in de gebruiker naamruimte geassocieerd met zijn UTS naamruimte (zie \fBnamespaces\fP(7)). .SH VERSIES SUSv2 garandeert dat "Machinenamen beperkt zijn tot 255 bytes". POSIX.1 garandeert dat "Machinenamen (exclusief het afsluitende NULL byte) beperkt zijn tot \fBHOST_NAME_MAX\fP bytes". Op Linux, is \fBHOST_NAME_MAX\fP is gedefinieerd met de waarde 64, hetgeen de limiet is geweest sinds Linux 1.0 (eerdere kernels kenden een limiet van 8 bytes). .SS "C library/kernel verschillen" The GNU C library does not employ the \fBgethostname\fP() system call; instead, it implements \fBgethostname\fP() as a library function that calls \fBuname\fP(2) and copies up to \fIsize\fP bytes from the returned \fInodename\fP field into \fIname\fP. Having performed the copy, the function then checks if the length of the \fInodename\fP was greater than or equal to \fIsize\fP, and if it is, then the function returns \-1 with \fIerrno\fP set to \fBENAMETOOLONG\fP; in this case, a terminating null byte is not included in the returned \fIname\fP. .SH "VOLDOET AAN" .TP \fBgethostname\fP() POSIX.1\-2008. .TP \fBsethostname\fP() Geen. .SH GESCHIEDENIS SVr4, 4.4BSD (deze functie verscheen voor het eerst in 4.2BSD).POSIX.1\-2001 en POSIX.1\-2008 bepalen \fBgethostname\fP(), maar niet \fBsethostname\fP(). .P .\" At least glibc 2.0 and glibc 2.1, older versions not checked Versions of glibc before glibc 2.2 handle the case where the length of the \fInodename\fP was greater than or equal to \fIsize\fP differently: nothing is copied into \fIname\fP and the function returns \-1 with \fIerrno\fP set to \fBENAMETOOLONG\fP. .SH "ZIE OOK" \fBhostname\fP(1), \fBgetdomainname\fP(2), \fBsetdomainname\fP(2), \fBuname\fP(2), \fButs_namespaces\fP(7) .PP .SH VERTALING De Nederlandse vertaling van deze handleiding is geschreven door Jos Boersema , Mario Blättermann en Luc Castermans . .PP Deze vertaling is vrije documentatie; lees de .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE of later over de Copyright-voorwaarden. Er is geen AANSPRAKELIJKHEID. .PP Indien U fouten in de vertaling van deze handleiding zou vinden, stuur een e-mail naar .MT debian-l10n-dutch@lists.debian.org .ME .