FreeBSD Bugzilla – Attachment 14844 Details for
Bug 27759
linux sysinfo system call is needed for maya batch mode to work.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.34 KB, created by
Jim.Pirzyk
on 2001-05-30 02:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jim.Pirzyk
Created:
2001-05-30 02:10:00 UTC
Size:
5.34 KB
patch
obsolete
>*** ./sys/i386/linux/linux_dummy.c.orig Wed Jul 19 22:31:56 2000 >--- ./sys/i386/linux/linux_dummy.c Fri Dec 1 08:51:52 2000 >*************** >*** 74,80 **** > DUMMY(idle); > DUMMY(vm86old); > DUMMY(swapoff); >- DUMMY(sysinfo); > DUMMY(adjtimex); > DUMMY(create_module); > DUMMY(init_module); >--- 74,79 ---- >*************** >*** 109,112 **** > DUMMY(ftruncate64); > DUMMY(stat64); > DUMMY(lstat64); >- DUMMY(fstat64); >--- 108,110 ---- >*** ./sys/i386/linux/linux_sysent.c.orig Tue Aug 8 16:28:16 2000 >--- ./sys/i386/linux/linux_sysent.c Thu Nov 30 17:42:29 2000 >*************** >*** 133,139 **** > { 0, (sy_call_t *)linux_vm86old }, /* 113 = linux_vm86old */ > { AS(linux_wait4_args), (sy_call_t *)linux_wait4 }, /* 114 = linux_wait4 */ > { 0, (sy_call_t *)linux_swapoff }, /* 115 = linux_swapoff */ >! { 0, (sy_call_t *)linux_sysinfo }, /* 116 = linux_sysinfo */ > { AS(linux_ipc_args), (sy_call_t *)linux_ipc }, /* 117 = linux_ipc */ > { AS(fsync_args), (sy_call_t *)fsync }, /* 118 = fsync */ > { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn }, /* 119 = linux_sigreturn */ >--- 133,139 ---- > { 0, (sy_call_t *)linux_vm86old }, /* 113 = linux_vm86old */ > { AS(linux_wait4_args), (sy_call_t *)linux_wait4 }, /* 114 = linux_wait4 */ > { 0, (sy_call_t *)linux_swapoff }, /* 115 = linux_swapoff */ >! { AS(linux_sysinfo_args), (sy_call_t *)linux_sysinfo }, /* 116 = linux_sysinfo */ > { AS(linux_ipc_args), (sy_call_t *)linux_ipc }, /* 117 = linux_ipc */ > { AS(fsync_args), (sy_call_t *)fsync }, /* 118 = fsync */ > { AS(linux_sigreturn_args), (sy_call_t *)linux_sigreturn }, /* 119 = linux_sigreturn */ >*** ./sys/i386/linux/linux_proto.h.orig Tue Aug 8 16:28:16 2000 >--- ./sys/i386/linux/linux_proto.h Thu Nov 30 17:41:12 2000 >*************** >*** 312,318 **** > register_t dummy; > }; > struct linux_sysinfo_args { >! register_t dummy; > }; > struct linux_ipc_args { > int what; char what_[PAD_(int)]; >--- 312,318 ---- > register_t dummy; > }; > struct linux_sysinfo_args { >! struct linux_sysinfo * buf; char buf_[PAD_(struct linux_sysinfo *)]; > }; > struct linux_ipc_args { > int what; char what_[PAD_(int)]; >*** ./sys/compat/linux/linux_misc.c.orig Tue Mar 27 18:33:47 2001 >--- ./sys/compat/linux/linux_misc.c Fri May 4 15:53:46 2001 >*************** >*** 40,45 **** >--- 40,46 ---- > #include <sys/imgact_aout.h> > #include <sys/mount.h> > #include <sys/namei.h> >+ #include <sys/resource.h> > #include <sys/resourcevar.h> > #include <sys/stat.h> > #include <sys/sysctl.h> >*************** >*** 48,59 **** >--- 49,64 ---- > #include <sys/wait.h> > #include <sys/time.h> > #include <sys/signalvar.h> >+ #include <sys/blist.h> >+ #include <sys/vmmeter.h> > > #include <vm/vm.h> > #include <vm/pmap.h> > #include <vm/vm_kern.h> > #include <vm/vm_map.h> > #include <vm/vm_extern.h> >+ #include <vm/vm_object.h> >+ #include <vm/swap_pager.h> > > #include <machine/frame.h> > #include <machine/limits.h> >*************** >*** 93,98 **** >--- 98,176 ---- > RLIMIT_MEMLOCK, -1 > }; > #endif /*!__alpha__*/ >+ >+ struct linux_sysinfo { >+ long uptime; /* Seconds since boot */ >+ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ >+ unsigned long totalram; /* Total usable main memory size */ >+ unsigned long freeram; /* Available memory size */ >+ unsigned long sharedram; /* Amount of shared memory */ >+ unsigned long bufferram; /* Memory used by buffers */ >+ unsigned long totalswap; /* Total swap space size */ >+ unsigned long freeswap; /* swap space still available */ >+ unsigned short procs; /* Number of current processes */ >+ char _f[22]; /* Pads structure to 64 bytes */ >+ }; >+ >+ int >+ linux_sysinfo(struct proc *p, struct linux_sysinfo_args *args) >+ { >+ struct linux_sysinfo sysinfo; >+ vm_object_t object; >+ int i; >+ struct timespec ts; >+ >+ /* Uptime is copied out of print_uptime() procedure in kern_shutdown.c */ >+ getnanouptime(&ts); >+ i = 0; >+ if (ts.tv_sec >= 86400) { >+ printf("%ldd", ts.tv_sec / 86400); >+ ts.tv_sec %= 86400; >+ i = 1; >+ } >+ if (i || ts.tv_sec >= 3600) { >+ printf("%ldh", ts.tv_sec / 3600); >+ ts.tv_sec %= 3600; >+ i = 1; >+ } >+ if (i || ts.tv_sec >= 60) { >+ printf("%ldm", ts.tv_sec / 60); >+ ts.tv_sec %= 60; >+ i = 1; >+ } >+ sysinfo.uptime=ts.tv_sec; >+ >+ /* Use the information from the mib to get our load averages */ >+ for (i = 0; i < 3; i++) >+ sysinfo.loads[i] = (double) averunnable.ldavg[i] / averunnable.fscale; >+ >+ sysinfo.totalram = physmem * PAGE_SIZE; >+ sysinfo.freeram = sysinfo.totalram - cnt.v_wire_count * PAGE_SIZE; >+ >+ sysinfo.sharedram = 0; >+ for (object = TAILQ_FIRST(&vm_object_list); object != NULL; >+ object = TAILQ_NEXT(object, object_list)) >+ if (object->shadow_count > 1) >+ sysinfo.sharedram += object->resident_page_count; >+ >+ sysinfo.sharedram *= PAGE_SIZE; >+ >+ sysinfo.bufferram = 0; >+ >+ if (swapblist == NULL) { >+ sysinfo.totalswap= 0; >+ sysinfo.freeswap = 0; >+ } else { >+ sysinfo.totalswap = swapblist->bl_blocks * 1024; >+ sysinfo.freeswap = swapblist->bl_root->u.bmu_avail * PAGE_SIZE; >+ } >+ >+ sysinfo.procs = 20; /* Hack */ >+ >+ return copyout((caddr_t)&sysinfo, (caddr_t)args->buf, >+ sizeof(struct linux_sysinfo)); >+ } >+ > > #ifndef __alpha__ > int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27759
: 14844