summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/gethostname.c
Commit message (Collapse)AuthorAgeFilesLines
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Remove the kludge, as asked in the Makefile:ache2006-05-221-3/+0
| | | | | | # If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c. Reviewed by: ume
* Include a couple of headers to ensure consistency between the prototype andstefanf2005-09-121-0/+1
| | | | the function definition.
* Add a kluge suggested by Marcel to paper over the difference betweenwollman2003-08-191-0/+3
| | | | | | | | | | | | gethostname()'s old and new signatures without requiring a library bump. Note that programs which called gethostname() with a negative argument were already broken, since the same type conversion was done by the old implementation. Add a note in the Makefile so that whoever next bumps the libc revision will delete the kluge at the same time (as it will no longer be necessary). This is only operative on 64-bit platforms. Submitted by: marcel
* Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEMwollman2003-08-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | when the buffer is not long enough to hold the current host name. POSIX does not standardize error returns for gethostname(), so it doesn't matter which one we use, but ENAMETOOLONG is at least a little more intuitive, and mi suggests the existence of prior art. I've been running with this change for a while on my home machine with no effect. At the same time, I've updated the prototype for gethostname() to use the correct standard type (size_t) for the namelen argument. All of the in-tree callers fall into one of the following categories: 1) Call perror() or equivalent when gethostname() fails. 2) Ignore gethostname()'s return value entirely, potentially resulting in data corruption if the buffer is too small. 3) Fall back to a (possibly sensible) default value if gethostname() fails. Many of the callers I examined shows signs of confusion about the correct sizing of the host name buffer. gethostname(3) now has more information about this, as well as updated standards information. PR: 48114 Submitted by: mi (in part)
* Fix the style of the SCM ID's.obrien2002-03-221-0/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* gethostname() returns int, not long. Answered my own question byjkh1996-12-051-1/+1
| | | | | RTFM'ing. Either both the header files and the man pages are wrong or this code is, and I'll take the majority decision. :-)
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+55
OpenPOWER on IntegriCloud