.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified 22 July 1995 by Michael Chastain : .\" 'gethostname' is real system call on Linux/Alpha. .\" Modified Fri Jan 31 16:30:53 1997 by Eric S. Raymond .\" Modified 2000-06-04, 2001-12-15 by aeb .\" Translation (c) 1998 Przemek Borys .\" Last update: A. Krzysztofowicz , Jan 2002, .\" manpages 1.47 .\" .TH GETHOSTNAME 2 2001-12-15 "Linux 2.5.0" "Podręcznik programisty Linuksa" .SH NAZWA gethostname, sethostname \- pobranie/ustawienie nazwy hosta .SH SKŁADNIA .B #include .sp .BI "int gethostname(char *" name ", size_t " len ); .br .BI "int sethostname(const char *" name ", size_t " len ); .SH OPIS \fI Uwaga! To tłumaczenie może być nieaktualne!\fP .PP Funkcje te służą do zmiany nazwy hosta obecnego procesora. Funkcja .B gethostname() zwraca w tablicy \fIname\fP o długości \fIlen\fP bajtów zakończoną znakiem NUL nazwę hosta (ustawioną uprzednio przez .BR sethostname() ). W przypadku, gdy zakończona znakiem NUL nazwa hosta się nie mieści, nie jest zwracany błąd ale nazwa hosta jest obcinana. Nie jest określone, czy obcięta nazwa hosta będzie zakończona znakiem NUL. .SH "WARTOŚĆ ZWRACANA" Po pomyślnym zakończeniu zwracane jest zero. Po błędzie zwracane jest \-1 i odpowiednio ustawiane jest .I errno . .SH BŁĘDY .TP .B EINVAL .I len jest ujemne, lub dla .BR sethostname , .I len jest większe od maksymalnej dozwolonej wartości, lub dla .B gethostname na Linuksie/i386 .I len jest mniejsze niż właściwy rozmiar. (W tym ostatnim przypadku glibc 2.1 zwraca ENAMETOOLONG.) .TP .B EPERM Dla .BR sethostname , wywołujący nie był superużytkownikiem. .TP .B EFAULT .I name jest nieprawidłowym adresem. .SH "ZGODNE Z" SVr4, 4.4BSD (funkcja pierwotnie pojawiła się w 4.2BSD). POSIX 1003.1-2001 definiuje .B gethostname ale nie .BR sethostname . .SH USTERKI Dla wielu kombinacji jąder Linuksa / libc .B gethostname zwraca błąd zamiast zwrócić obciętą nazwę hosta. .SH UWAGI SUSv2 gwarantuje, że `nazwy hostów są ograniczone do 255 bajtów'. POSIX 1003.1-2001 gwarantuje, że `nazwy hostów (bez kończącego NUL) są ograniczone do HOST_NAME_MAX bajtów'. .SH "ZOBACZ TAKŻE" .BR getdomainname (2), .BR setdomainname (2), .BR uname (2) .SH "INFORMACJE O TŁUMACZENIU" Powyższe tłumaczenie pochodzi z nieistniejącego już Projektu Tłumaczenia Manuali i \fImoże nie być aktualne\fR. W razie zauważenia różnic między powyższym opisem a rzeczywistym zachowaniem opisywanego programu lub funkcji, prosimy o zapoznanie się z oryginalną (angielską) wersją strony podręcznika za pomocą polecenia: .IP man \-\-locale=C 2 gethostname .PP Prosimy o pomoc w aktualizacji stron man \- więcej informacji można znaleźć pod adresem http://sourceforge.net/projects/manpages\-pl/.