On Tue Apr 10 12, Jung-uk Kim wrote:
> On Tuesday 10 April 2012 07:39 pm, Jung-uk Kim wrote:
> > On Tuesday 10 April 2012 06:56 pm, Jung-uk Kim wrote:
> > > Th attached patch implements pipe2 syscall for Linuxulator, which
> > > is quite trivial. Although it was added in Linux 2.6.27 (thanks,
> > > netchild!), it is often used by popular Linux applications, e.g.,
> > > Adobe Flash plugin. Please note linux_pipe() was moved from MD
> > > files to sys/compat/linux/linux_file.c because both amd64 and
> > > i386 versions looked the same and I failed to see any reason. I
> > > also changed file descriptor argument from l_ulong * to l_int *,
> > > which seemed more appropriate. Any objections?
> >
> > Oops, I missed a patch for sys/kern/kern_descript.c:
> >
> > Index: sys/kern/kern_descrip.c
> > ===
> > --- sys/kern/kern_descrip.c (revision 234112)
> > +++ sys/kern/kern_descrip.c (working copy)
> > @@ -1681,6 +1681,8 @@ finstall(struct thread *td, struct file *fp,
> > int *
> > }
> > fhold(fp);
> > fdp->fd_ofiles[*fd] = fp;
> > + if ((flags & O_NONBLOCK) != 0)
> > + fp->f_flag |= FNONBLOCK;
> > if ((flags & O_CLOEXEC) != 0)
> > fdp->fd_ofileflags[*fd] |= UF_EXCLOSE;
> > FILEDESC_XUNLOCK(fdp);
> >
> > > * PS: This patch is also available from here:
> > >
> > > http://people.freebsd.org/~jkim/linux_pipe2.diff
> >
> > This patch is updated with it.
>
> Oops, oops... I found that non-blocking does not really work because
> finit() resets the flag later. The patch was re-done to set the
> non-blocking flag correctly.
>
> I'm really sorry about the mess.
i'm having problems with the patch. beforehand, playing music from
www.mixcloud.com worked. now the flash based player is initialising forever.
'ps alx' says the following about the npviewer.bin task:
UID PID PPID CPU PRI NIVSZRSS MWCHAN STAT TT TIME COMMAND
1001 1044 10340 40 0 0 0 -Z - 0:00,05
and procstat -a says:
PID PPID PGID SID TSID THR LOGINWCHAN EMUL COMM
0 0 0 0 0 11 -- - kernel
1 0 1 1 0 1 root wait FreeBSD ELF64 init
2 0 0 0 0 1 -ccb_scan - xpt_thrd
3 0 0 0 0 1 -psleep- pagedaemon
4 0 0 0 0 1 -psleep- vmdaemon
5 0 0 0 0 1 -pgzero- pagezero
6 0 0 0 0 1 -psleep- bufdaemon
7 0 0 0 0 1 -syncer- syncer
8 0 0 0 0 1 -vlruwt- vnlru
9 0 0 0 0 1 -sdflush - softdepflush
10 0 0 0 0 2 -- - idle
11 0 0 0 0 15 -- - intr
12 0 0 0 0 3 -- - geom
13 0 0 0 0 1 -- - yarrow
14 0 0 0 0 32 -- - usb
15 0 0 0 0 1 -- - schedcpu
325 1 325 325 0 1 root selectFreeBSD ELF64
wpa_supplicant
429 1 429 429 0 1 root selectFreeBSD ELF64 devd
616 1 616 616 0 1 root selectFreeBSD ELF64 syslogd
680 1 680 680 0 1 root selectFreeBSD ELF64 powerd
708 1 707 707 0 1 root nanslpFreeBSD ELF64 smartd
713 1 713 713 0 1 root selectFreeBSD ELF64 dbus-daemon
725 1 725 725 0 3 root uwait FreeBSD ELF64 musicpd
730 1 730 730 0 1 root selectFreeBSD ELF64 mpdscribble
771 1 771 771 0 1 root selectFreeBSD ELF64 sendmail
774 1 774 774 0 1 root pause FreeBSD ELF64 sendmail
778 1 778 778 0 1 root nanslpFreeBSD ELF64 cron
788 1 788 788 0 1 root selectFreeBSD ELF64 identd
816 1 816 816 816 1 arundel wait FreeBSD ELF64 login
817 1 817 817 817 1 root ttyin FreeBSD ELF64 getty
818 1 818 818 818 1 root ttyin FreeBSD ELF64 getty
819 1 819 819 819 1 root ttyin FreeBSD ELF64 getty
820 1 820 820 820 1 root ttyin FreeBSD ELF64 getty
821 1 821 821 821 1 root ttyin FreeBSD ELF64 getty
822 1 822 822 822 1 root ttyin FreeBSD ELF64 getty
823 1 823 823 823 1 root ttyin F