Deleted Added
full compact
linux_misc.c (116173) linux_misc.c (117723)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * 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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * 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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 116173 2003-06-10 21:29:12Z obrien $");
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 117723 2003-07-18 10:26:09Z phk $");
31
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/blist.h>
36#include <sys/fcntl.h>
37#include <sys/imgact_aout.h>
38#include <sys/jail.h>

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

103 char _f[22]; /* Pads structure to 64 bytes */
104};
105#ifndef __alpha__
106int
107linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
108{
109 struct l_sysinfo sysinfo;
110 vm_object_t object;
31
32#include "opt_mac.h"
33
34#include <sys/param.h>
35#include <sys/blist.h>
36#include <sys/fcntl.h>
37#include <sys/imgact_aout.h>
38#include <sys/jail.h>

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

103 char _f[22]; /* Pads structure to 64 bytes */
104};
105#ifndef __alpha__
106int
107linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
108{
109 struct l_sysinfo sysinfo;
110 vm_object_t object;
111 int i;
111 int i, j;
112 struct timespec ts;
113
114 /* Uptime is copied out of print_uptime() in kern_shutdown.c */
115 getnanouptime(&ts);
116 i = 0;
117 if (ts.tv_sec >= 86400) {
118 ts.tv_sec %= 86400;
119 i = 1;

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

139 for (object = TAILQ_FIRST(&vm_object_list); object != NULL;
140 object = TAILQ_NEXT(object, object_list))
141 if (object->shadow_count > 1)
142 sysinfo.sharedram += object->resident_page_count;
143
144 sysinfo.sharedram *= PAGE_SIZE;
145 sysinfo.bufferram = 0;
146
112 struct timespec ts;
113
114 /* Uptime is copied out of print_uptime() in kern_shutdown.c */
115 getnanouptime(&ts);
116 i = 0;
117 if (ts.tv_sec >= 86400) {
118 ts.tv_sec %= 86400;
119 i = 1;

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

139 for (object = TAILQ_FIRST(&vm_object_list); object != NULL;
140 object = TAILQ_NEXT(object, object_list))
141 if (object->shadow_count > 1)
142 sysinfo.sharedram += object->resident_page_count;
143
144 sysinfo.sharedram *= PAGE_SIZE;
145 sysinfo.bufferram = 0;
146
147 if (swapblist == NULL) {
148 sysinfo.totalswap= 0;
149 sysinfo.freeswap = 0;
150 } else {
151 sysinfo.totalswap = swapblist->bl_blocks * 1024;
152 sysinfo.freeswap = swapblist->bl_root->u.bmu_avail * PAGE_SIZE;
153 }
147 swap_pager_status(&i, &j);
148 sysinfo.totalswap= i * PAGE_SIZE;
149 sysinfo.freeswap = (i - j) * PAGE_SIZE;
154
155 sysinfo.procs = 20; /* Hack */
156
157 return copyout(&sysinfo, args->info, sizeof(sysinfo));
158}
159#endif /*!__alpha__*/
160
161#ifndef __alpha__

--- 1158 unchanged lines hidden ---
150
151 sysinfo.procs = 20; /* Hack */
152
153 return copyout(&sysinfo, args->info, sizeof(sysinfo));
154}
155#endif /*!__alpha__*/
156
157#ifndef __alpha__

--- 1158 unchanged lines hidden ---