Deleted Added
full compact
linux_misc.c (183612) linux_misc.c (184789)
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * Copyright (c) 1994-1995 S�ren Schmidt
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * Copyright (c) 1994-1995 S�ren Schmidt
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 183612 2008-10-04 19:23:30Z kib $");
31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 184789 2008-11-09 10:45:13Z ed $");
32
33#include "opt_compat.h"
34#include "opt_mac.h"
35
36#include <sys/param.h>
37#include <sys/blist.h>
38#include <sys/fcntl.h>
39#if defined(__i386__)

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

1677 td->td_retval[0] = 20 - td->td_retval[0];
1678 return error;
1679}
1680
1681int
1682linux_sethostname(struct thread *td, struct linux_sethostname_args *args)
1683{
1684 int name[2];
32
33#include "opt_compat.h"
34#include "opt_mac.h"
35
36#include <sys/param.h>
37#include <sys/blist.h>
38#include <sys/fcntl.h>
39#if defined(__i386__)

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

1677 td->td_retval[0] = 20 - td->td_retval[0];
1678 return error;
1679}
1680
1681int
1682linux_sethostname(struct thread *td, struct linux_sethostname_args *args)
1683{
1684 int name[2];
1685 int error;
1685
1686#ifdef DEBUG
1687 if (ldebug(sethostname))
1688 printf(ARGS(sethostname, "*, %i"), args->len);
1689#endif
1690
1691 name[0] = CTL_KERN;
1692 name[1] = KERN_HOSTNAME;
1686
1687#ifdef DEBUG
1688 if (ldebug(sethostname))
1689 printf(ARGS(sethostname, "*, %i"), args->len);
1690#endif
1691
1692 name[0] = CTL_KERN;
1693 name[1] = KERN_HOSTNAME;
1693 return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname,
1694 args->len, 0, 0));
1694 mtx_lock(&Giant);
1695 error = userland_sysctl(td, name, 2, 0, 0, 0, args->hostname,
1696 args->len, 0, 0);
1697 mtx_unlock(&Giant);
1698 return (error);
1695}
1696
1697int
1699}
1700
1701int
1702linux_setdomainname(struct thread *td, struct linux_setdomainname_args *args)
1703{
1704 int name[2];
1705 int error;
1706
1707#ifdef DEBUG
1708 if (ldebug(setdomainname))
1709 printf(ARGS(setdomainname, "*, %i"), args->len);
1710#endif
1711
1712 name[0] = CTL_KERN;
1713 name[1] = KERN_NISDOMAINNAME;
1714 mtx_lock(&Giant);
1715 error = userland_sysctl(td, name, 2, 0, 0, 0, args->name,
1716 args->len, 0, 0);
1717 mtx_unlock(&Giant);
1718 return (error);
1719}
1720
1721int
1698linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
1699{
1700 struct linux_emuldata *em, *td_em, *tmp_em;
1701 struct proc *sp;
1702
1703#ifdef DEBUG
1704 if (ldebug(exit_group))
1705 printf(ARGS(exit_group, "%i"), args->error_code);

--- 165 unchanged lines hidden ---
1722linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
1723{
1724 struct linux_emuldata *em, *td_em, *tmp_em;
1725 struct proc *sp;
1726
1727#ifdef DEBUG
1728 if (ldebug(exit_group))
1729 printf(ARGS(exit_group, "%i"), args->error_code);

--- 165 unchanged lines hidden ---