Installation of Oracle10g Express Edition on FreeBSD 5.4-RELEASE
Divacky Roman
xdivac02 at stud.fit.vutbr.cz
Sat Jun 24 11:10:07 UTC 2006
> --- compat/linux/linux_misc.c.orig Fri Apr 1 01:17:42 2005
> +++ compat/linux/linux_misc.c Wed Jun 21 11:14:05 2006
> @@ -711,8 +711,9 @@ linux_times(struct thread *td, struct li
> tms.tms_cutime = CONVTCK(td->td_proc->p_stats->p_cru.ru_utime);
> tms.tms_cstime = CONVTCK(td->td_proc->p_stats->p_cru.ru_stime);
>
> - if ((error = copyout(&tms, args->buf, sizeof(tms))))
> - return error;
> + if (args->buf != NULL)
> + if ((error = copyout(&tms, args->buf, sizeof(tms))))
> + return error;
>
> microuptime(&tv);
> td->td_retval[0] = (int)CONVTCK(tv);
this looks ok... a different version was commited
> --- compat/linprocfs/linprocfs.c.orig Fri Apr 1 01:27:16 2005
> +++ compat/linprocfs/linprocfs.c Wed Jun 21 11:14:10 2006
> @@ -515,7 +515,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
> sbuf_printf(sb, "%d", p->p_pid);
> #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg)
> PS_ADD("comm", "(%s)", p->p_comm);
> - PS_ADD("statr", "%c", '0'); /* XXX */
> + PS_ADD("statr", "%c", 'S'); /* XXX */
> PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0);
> PS_ADD("pgrp", "%d", p->p_pgid);
> PS_ADD("session", "%d", p->p_session->s_sid);
> @@ -535,7 +535,7 @@ linprocfs_doprocstat(PFS_FILL_ARGS)
> PS_ADD("priority", "%d", 0); /* XXX */
> PS_ADD("timeout", "%u", 0); /* XXX */
> PS_ADD("itrealvalue", "%u", 0); /* XXX */
> - PS_ADD("starttime", "%d", 0); /* XXX */
> + PS_ADD("starttime", "%d", 1); /* XXX */
> PS_ADD("vsize", "%ju", (uintmax_t)kp.ki_size);
> PS_ADD("rss", "%ju", P2K((uintmax_t)kp.ki_rssize));
> PS_ADD("rlim", "%u", 0); /* XXX */
this looks "almost ok" netchild@ is working on a patch which puts there
real values... thnx for the idea
> The third patch corrects a bug (or maybe a feature) in the pseudofs
> code (it is necessary for linprocfs). The case is, if you assemble
> linprocfs and try such a program, then the read function will read not
> 4 as it was asked but one point less, that is, as it is easily
> calculated, 3 bytes:
>
> File test.c
>
> #include <sys/types.h>
> #include <sys/uio.h>
> #include <unistd.h>
> #include <fcntl.h>
>
> main () {
> int fd, count;
> char buf[10];
>
> fd = open("/compat/linux/proc/self/cmdline", O_RDONLY);
> count = read(fd, buf, 4);
> buf[4] = '\0';
> printf("count = %d, buf = %s\n", count, buf);
> }
>
> I am not sure whether the third correction is absolutely right;
> moreover, I am not sure as to its place in the code. This question is
> to real kernel hackers.
pls, can you explain how this manifest in the oracle? I agree that this is a
bug but I am not sure why noone noticed this. the fact is that most people use
"cat /proc/x/y" and cat reads 1024 bytes in this case so this doesnt manifest
> File patch3
>
> --- fs/pseudofs/pseudofs_vnops.c.orig Mon Sep 6 22:38:01 2004
> +++ fs/pseudofs/pseudofs_vnops.c Wed Jun 21 11:14:14 2006
> @@ -530,7 +530,7 @@ pfs_read(struct vop_read_args *va)
> PRELE(proc);
> PFS_RETURN (EIO);
> }
> - sb = sbuf_new(sb, NULL, buflen, 0);
> + sb = sbuf_new(sb, NULL, buflen+1, 0);
> if (sb == NULL) {
> if (proc != NULL)
> PRELE(proc);
this is wrong...
what about this:
Index: pseudofs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/pseudofs/pseudofs_vnops.c,v
retrieving revision 1.59
diff -u -r1.59 pseudofs_vnops.c
--- pseudofs_vnops.c 22 Feb 2006 18:57:49 -0000 1.59
+++ pseudofs_vnops.c 24 Jun 2006 11:08:59 -0000
@@ -515,7 +515,7 @@
if (uio->uio_offset < 0 || uio->uio_resid < 0 ||
(offset = uio->uio_offset) != uio->uio_offset ||
(resid = uio->uio_resid) != uio->uio_resid ||
- (buflen = offset + resid) < offset || buflen > INT_MAX) {
+ (buflen = offset + resid + 1) < offset || buflen > INT_MAX) {
if (proc != NULL)
PRELE(proc);
PFS_RETURN (EINVAL);
More information about the freebsd-emulation
mailing list