Re: About using mixing libc and rump APIs in the same code

  • From: Liming Sun <liming.sun5@xxxxxxxxx>
  • To: Antti Kantee <pooka@xxxxxx>
  • Date: Wed, 3 Jun 2015 08:20:26 -0400

By the way, below is a small change which appears to fix the link issue I
saw yesterday.

diff --git a/configure b/configure
index 2713aec..202d73a 100755
--- a/configure
+++ b/configure
@@ -12528,7 +12528,7 @@ fi
EXTRA_LIBS=""
case $target_os in #(
linux*) :
- EXTRA_LIBS="-lrumpnet_sockin -lrumpnet_net -lrumpnet
-lrumpkern_sys_linux" ;; #(
+ EXTRA_LIBS="-lrumpnet_sockin -lrumpnet_net -lrumpnet" ;; #(
solaris*) :
EXTRA_LIBS="-lrumpkern_sys_sunos" ;; #(
cygwin*) :

On Tue, Jun 2, 2015 at 10:20 PM, Liming Sun <liming.sun5@xxxxxxxxx> wrote:

Thanks! fs-utils seems exactly what I was looking for...
I got some link error (like below) when compiling fs_utils, but the
Makefile gave me enough information to write a small example which seems
working.

/home/lsun/workspace/gitrepo/rump/rumpctrl/rumpdyn/lib/librumpkern_sys_linux.so:
undefined reference to `rumpns_compat_50_sys_settimeofday'


On Tue, Jun 2, 2015 at 3:36 PM, Antti Kantee <pooka@xxxxxx> wrote:

[generally speaking, if you want to start discussing another subject,
please start another thread]

On 02/06/15 19:03, Liming Sun wrote:

I guess this question might have been discussed... is it possible to call
regular libc functions and rump APIs (such as rump_sys_XXXX) in the same
C
file?


If you are running in host namespace, yes. If you are running in full
rump kernel namespace, no. For examples of the former, see
buildrump.sh/tests. For examples of the latter, see rumprun.

For example, is there an easy way to implement a 'cp' command to copy
between Linux host FS and the rump FS ?


That's a very multifaceted question. You can use e.g. rumpctrl/dd to
move single files against live rump servers or the fsu_ecp command from
fs-utils against cold images. fs-utils doesn't not currently work against
live servers, but in theory it would not be a big task to adjust it to work
that way. (fs-utils is also a good example of how to call both host
syscalls and rump kernel syscalls in the same program)



Other related posts: