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.
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
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.
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 >
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. >
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.
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) ?