1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >TCP/IP Library Reference</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Stack Support for eCos"
23 HREF="net-common-tcpip.html"><LINK
26 HREF="net-common-dhcp.html"><LINK
29 HREF="net-common-tcpip-manpages-gethostname.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-dhcp.html"
71 HREF="net-common-tcpip-manpages-gethostname.html"
84 NAME="TCPIP-LIBRARY-REFERENCE">Chapter 38. TCP/IP Library Reference</H1
94 HREF="tcpip-library-reference.html#NET-COMMON-TCPIP-MANPAGES-GETDOMAINNAME"
99 HREF="net-common-tcpip-manpages-gethostname.html"
104 HREF="net-common-tcpip-manpages-byteorder.html"
109 HREF="net-common-tcpip-manpages-ethers.html"
114 HREF="net-common-tcpip-manpages-getaddrinfo.html"
119 HREF="net-common-tcpip-manpages-gethostbyname.html"
124 HREF="net-common-tcpip-manpages-getifaddrs.html"
129 HREF="net-common-tcpip-manpages-getnameinfo.html"
134 HREF="net-common-tcpip-manpages-getnetent.html"
139 HREF="net-common-tcpip-manpages-getprotoent.html"
144 HREF="net-common-tcpip-manpages-getrrsetbyname.html"
149 HREF="net-common-tcpip-manpages-getservent.html"
154 HREF="net-common-tcpip-manpages-if-nametoindex.html"
159 HREF="net-common-tcpip-manpages-inet.html"
164 HREF="net-common-tcpip-manpages-inet6-option-space.html"
165 >inet6_option_space</A
169 HREF="net-common-tcpip-manpages-inet6-rthdr-space.html"
170 >inet6_rthdr_space</A
174 HREF="net-common-tcpip-manpages-inet-net.html"
179 HREF="net-common-tcpip-manpages-ipx.html"
184 HREF="net-common-tcpip-manpages-iso-addr.html"
189 HREF="net-common-tcpip-manpages-link-addr.html"
194 HREF="net-common-tcpip-manpages-net-addrcmp.html"
199 HREF="net-common-tcpip-manpages-ns.html"
204 HREF="net-common-tcpip-manpages-resolver.html"
209 HREF="net-common-tcpip-manpages-accept.html"
214 HREF="net-common-tcpip-manpages-bind.html"
219 HREF="net-common-tcpip-manpages-connect.html"
224 HREF="net-common-tcpip-manpages-getpeername.html"
229 HREF="net-common-tcpip-manpages-getsockname.html"
234 HREF="net-common-tcpip-manpages-getsockopt.html"
239 HREF="net-common-tcpip-manpages-ioctl.html"
244 HREF="net-common-tcpip-manpages-poll.html"
249 HREF="net-common-tcpip-manpages-select.html"
254 HREF="net-common-tcpip-manpages-send.html"
259 HREF="net-common-tcpip-manpages-shutdown.html"
264 HREF="net-common-tcpip-manpages-socket.html"
269 HREF="net-common-tcpip-manpages-socketpair.html"
279 NAME="NET-COMMON-TCPIP-MANPAGES-GETDOMAINNAME">getdomainname</H1
288 >GETDOMAINNAME(3) System Library Functions Manual GETDOMAINNAME(3)
291 getdomainname, setdomainname - get/set YP domain name of current host
294 #include <unistd.h>
297 getdomainname(char *name, size_t namelen);
300 setdomainname(const char *name, size_t namelen);
303 The getdomainname() function returns the YP domain name for the current
304 processor, as previously set by setdomainname(). The parameter namelen
305 specifies the size of the name array. If insufficient space is provided,
306 the returned name is truncated. The returned name is always null termi-
309 setdomainname() sets the domain name of the host machine to be name,
310 which has length namelen. This call is restricted to the superuser and
311 is normally used only when the system is bootstrapped.
314 If the call succeeds a value of 0 is returned. If the call fails, a
315 value of -1 is returned and an error code is placed in the global vari-
319 The following errors may be returned by these calls:
321 [EFAULT] The name or namelen parameter gave an invalid address.
323 [EPERM] The caller tried to set the domain name and was not
327 domainname(1), gethostid(3), gethostname(3), sysctl(3), sysctl(8), yp(8)
330 Domain names are limited to MAXHOSTNAMELEN (from <sys/param.h>) charac-
331 ters, currently 256. This includes the terminating NUL character.
333 If the buffer passed to getdomainname() is too small, other operating
334 systems may not guarantee termination with NUL.
337 The getdomainname function call appeared in SunOS 3.x.
351 SUMMARY="Footer navigation table"
362 HREF="net-common-dhcp.html"
380 HREF="net-common-tcpip-manpages-gethostname.html"
396 HREF="net-common-tcpip.html"