[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FreeBSD linprocfs and mount_linprocfs Porting?

Can anyone see a good reason to NOT port the FreeBSD linprocfs and
mount_linprocfs to OpenBSD?

There are troublesome executables which use information in the linux
/proc filesystem to figure out their own location. Current linux
emulation doesn't handle this properly since the readlink() call returns
info from the BSD /proc file system. In some of these cases, you can
build a simple wrapper for the executable in order to get it to work. 

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

  char buff[1024];
  sprintf(buff, "sudo mkdir /emul/linux/proc/%d", getpid());
  sprintf(buff, "sudo ln -s /home/username/program/programname
/emul/linux/proc/%d/exe", getpid());

  execlp("./programname", "./programname", NULL);

FreeBSD has a more complete solution to the Linux /proc filesystem
problems, so situations like the above can be solved with a simple
command like:

# mount_linprocfs linprocfs /compat/linux/proc

There's some work starting up right now to port the FreeBSD code to
NetBSD, so I'm curious if any such work has been done in OpenBSD and
whether or not it's wanted in the project?

If anyone knows a "good reason" to *NOT* port this to OpenBSD, I'd like
to know about it.

If there's no reason against porting it, I'll do it.


Visit your host, monkey.org