Deleted Added
full compact
getdomainname.c (17145) getdomainname.c (17282)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35/*
36static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93";
37*/
38static const char rcsid[] =
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35/*
36static char sccsid[] = "From: @(#)gethostname.c 8.1 (Berkeley) 6/4/93";
37*/
38static const char rcsid[] =
39 "$Id: getdomainname.c,v 1.1 1994/08/08 00:40:23 wollman Exp $";
39 "$Id: getdomainname.c,v 1.2 1996/07/12 19:55:19 wollman Exp $";
40#endif /* LIBC_SCCS and not lint */
41
42#include <sys/param.h>
43#include <sys/sysctl.h>
44
45#include <unistd.h>
46
47int
48getdomainname(name, namelen)
49 char *name;
50 int namelen;
51{
52 int mib[2];
53 size_t size;
54
55 mib[0] = CTL_KERN;
40#endif /* LIBC_SCCS and not lint */
41
42#include <sys/param.h>
43#include <sys/sysctl.h>
44
45#include <unistd.h>
46
47int
48getdomainname(name, namelen)
49 char *name;
50 int namelen;
51{
52 int mib[2];
53 size_t size;
54
55 mib[0] = CTL_KERN;
56 mib[1] = KERN_DOMAINNAME;
56 mib[1] = KERN_NISDOMAINNAME;
57 size = namelen;
58 if (sysctl(mib, 2, name, &size, NULL, 0) == -1)
59 return (-1);
60 return (0);
61}
57 size = namelen;
58 if (sysctl(mib, 2, name, &size, NULL, 0) == -1)
59 return (-1);
60 return (0);
61}