MCPcopy Index your code
hub / github.com/F-Stack/f-stack / gethostname

Function gethostname

tools/libutil/tests/trimdomain_test.c:50–58  ·  view source on GitHub ↗

* Evily override gethostname(3) so trimdomain always gets the same result. * This makes the tests much easier to write and less likely to fail on * oddly configured systems. */

Source from the content-addressed store, hash-verified

48 * oddly configured systems.
49 */
50int
51gethostname(char *name, size_t namelen)
52{
53 if (strlcpy(name, TESTFQDN, namelen) > namelen) {
54 errno = ENAMETOOLONG;
55 return (-1);
56 }
57 return (0);
58}
59
60void
61testit(const char *input, int hostsize, const char *output, const char *test)

Callers 7

trimdomainFunction · 0.50
inet6.cFile · 0.50
routenameFunction · 0.50
xo_vsyslogFunction · 0.50
uds_get_xskmap_fdFunction · 0.50
proc_info_preparse_argsFunction · 0.50
ngx_init_cycleFunction · 0.50

Calls 1

strlcpyFunction · 0.50

Tested by

no test coverage detected