How to force text output in mount / io-net command ?

How to force text output in mount / io-net command ?

I’ve got line:
printf("\n Filter version: 1.0 \n");
in my module “nfm-my_filter.so” init function:
int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char
*options);

I tried:

mount -T io-net nfm-my_filter.so

mount -v -T io-net -v /home/nfm-my_filter.so

but the text “\n Filter version: 1.0 \n” doesn’t apper in console / tty :frowning:

If you are just debugging and want to see that your module is mounted,
you could try opening a specific tty and writing to it. If you are
wondering why the printf doesn’t work, consider that your module is
not a process, but a shared lib running in the context of io-net.
If you start io-net yourself in a console, you might get the output,
but then again, io-net might close stdout.

You might want to look into the slogf() family of functions.

Murf

Q wrote:

How to force text output in mount / io-net command ?

I’ve got line:
printf("\n Filter version: 1.0 \n");
in my module “nfm-my_filter.so” init function:
int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char
*options);

I tried:

mount -T io-net nfm-my_filter.so

mount -v -T io-net -v /home/nfm-my_filter.so

but the text “\n Filter version: 1.0 \n” doesn’t apper in console / tty > :frowning:

You might want to look into the slogf() family of functions.

ok, I’ll check it,
but I want to send text to default output (tty / console)
not to file;

I only want to show some info - I dont want to write to any file :slight_smile:

btw: do You know how to use nic_slogf () ?
I’ve add
#include <sys/slog.h>
#include <sys/slogcodes.h>
#include <drvr/nicsupport.h>
but the program can’t get this func. :frowning:

Q wrote:

You might want to look into the slogf() family of functions.


ok, I’ll check it,
but I want to send text to default output (tty / console)
not to file;

I only want to show some info - I dont want to write to any file > :slight_smile:

btw: do You know how to use nic_slogf () ?
I’ve add
#include <sys/slog.h
#include <sys/slogcodes.h
#include <drvr/nicsupport.h
but the program can’t get this func. > :frowning:

The slogf() family does not write to a file, but to slogger; read the

output with sloginfo. There may be a way to write to the default tty,
but I think you’ll find that using slogger is a far better way to
debug/monitor your code.

Murf

but I think you’ll find that using slogger is a far better way to
debug/monitor your code.

I DONT WANT TO DEBUG MY CODE.
/IT WORKS GOOD :slight_smile:

I WANT TO WRITE SOME INFO TO OUTPUT :slight_smile:
/CLEAR? :slight_smile:

Q <no@spam.pl> wrote:

but I think you’ll find that using slogger is a far better way to
debug/monitor your code.

I DONT WANT TO DEBUG MY CODE.
/IT WORKS GOOD > :slight_smile:

I WANT TO WRITE SOME INFO TO OUTPUT > :slight_smile:
/CLEAR? > :slight_smile:

printf() works. io-net doesn’t close stdout. Look at the
‘pidin fd’ / ‘sin fd’ output for io-net.

-seanb

I think one problem here might be what the “default” tty
means.
I think Q thinks it means the console that “mount” runs on,
something that
the driver, running as a shared library from io-net doesn’t know
about.

printf() works. io-net doesn’t close stdout. Look at the
‘pidin fd’ / ‘sin fd’ output for io-net.

so if the io-net console was closed
and I mount my filter in another console,
I don’t catch the printf in mount console,
becasue it went to io-net console (which is closed) ?