mig4nto lib & global names

Hello,
I tried to use the mig4nto library to get my old QNX4 programs running on
QNX 6.1. It works fine on local node but it cannot locate global names on
network. I know that for the name_attach()/name_open() functions the
global names aren’t supported yet. Are the global names working with
qnx_name_attach()/qnx_name_locate() functions from the mig4nto library?
Thank you,
Jan.

Jan Ptacek <ptacek@esys.cz> wrote in
news:Pine.LNX.4.44.0202111746570.10656-100000@mail.esys.cz:

Hello,
I tried to use the mig4nto library to get my old QNX4 programs running
on QNX 6.1. It works fine on local node but it cannot locate global
names on network. I know that for the name_attach()/name_open()
functions the global names aren’t supported yet. Are the global names
working with qnx_name_attach()/qnx_name_locate() functions from the
mig4nto library? Thank you,

It looks like the qnx_name_attach() only view the local nid/0 as the only
valid one.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

In article Xns91B3A87DB4C1Camalloryqnxcom@209.226.137.4, “Adam Mallory”
<amallory@qnx.com> wrote:

It looks like the qnx_name_attach() only view the local nid/0 as the
only valid one.

Any ETA when that might change ?

-Th

“Thomas Hentschel” <nntp.spam.trap@hentschel.net> wrote in
news:a4d183$i4e$1@inn.qnx.com:

In article Xns91B3A87DB4C1Camalloryqnxcom@209.226.137.4, “Adam Mallory”
amallory@qnx.com> > wrote:


It looks like the qnx_name_attach() only view the local nid/0 as the
only valid one.


Any ETA when that might change ?

You should contact your sales rep. for more information on ETA.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thomas Hentschel <nntp.spam.trap@hentschel.net> wrote:

In article Xns91B3A87DB4C1Camalloryqnxcom@209.226.137.4, “Adam Mallory”
amallory@qnx.com> > wrote:


It looks like the qnx_name_attach() only view the local nid/0 as the
only valid one.


Any ETA when that might change ?

Here is a little sample how to do global_name_open() yourself.

-xtang

#include <sys/dispatch.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <share.h>

int global_name_open(const char *name, int flags)
{
int fd;
DIR *dir;
struct dirent *dent;
char *newname;

if ((fd = name_open(name, 0)) != -1 || (flags & NAME_FLAG_ATTACH_GLOBAL) == 0) {
return fd;
}

if ((dir = opendir("/net")) == NULL) {
errno = ENOENT;
return -1;
}

while (dent = readdir(dir)) {
newname = alloca(strlen("/net/") + strlen(dent->d_name) +
strlen("/dev/name/global/") + strlen(name) + 1);
if (!newname) {
errno = ENOMEM;
return -1;
}
sprintf(newname, “/net/%s/dev/name/global/%s”, dent->d_name, name);
fd = _connect(_NTO_SIDE_CHANNEL, newname, 0, O_RDWR, SH_DENYNO,
_IO_CONNECT_OPEN, 1, _IO_FLAG_RD | _IO_FLAG_WR,
_FTYPE_NAME, 0, 0, 0, 0, 0, 0);
if (fd != -1) {
closedir(dir);
return fd;
}
}

closedir(dir);
errno = ENOENT;
return -1;
}

Steve: Is this documented? If so, where?

\

Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:a4du1g$35v$2@nntp.qnx.com

Thomas Hentschel <> nntp.spam.trap@hentschel.net> > wrote:
In article Xns91B3A87DB4C1Camalloryqnxcom@209.226.137.4, “Adam
Mallory”
amallory@qnx.com> > wrote:


It looks like the qnx_name_attach() only view the local nid/0 as the
only valid one.


Any ETA when that might change ?

Here is a little sample how to do global_name_open() yourself.

-xtang

#include <sys/dispatch.h
#include <dirent.h
#include <errno.h
#include <fcntl.h
#include <share.h

int global_name_open(const char *name, int flags)
{
int fd;
DIR *dir;
struct dirent *dent;
char *newname;

if ((fd = name_open(name, 0)) != -1 || (flags &
NAME_FLAG_ATTACH_GLOBAL) == 0) {
return fd;
}

if ((dir = opendir("/net")) == NULL) {
errno = ENOENT;
return -1;
}

while (dent = readdir(dir)) {
newname = alloca(strlen("/net/") + strlen(dent->d_name) +

strlen("/dev/name/global/") + strlen(name) + 1);
if (!newname) {
errno = ENOMEM;
return -1;
}
sprintf(newname, “/net/%s/dev/name/global/%s”,
dent->d_name, name);
fd = _connect(_NTO_SIDE_CHANNEL, newname, 0, O_RDWR,
SH_DENYNO,
_IO_CONNECT_OPEN, 1, _IO_FLAG_RD
| _IO_FLAG_WR,
_FTYPE_NAME, 0, 0, 0, 0, 0, 0);
if (fd != -1) {
closedir(dir);
return fd;
}
}

closedir(dir);
errno = ENOENT;
return -1;
}

Bill Caroselli <qtps@earthlink.net> wrote:
: Steve: Is this documented? If so, where?

I don’t know if it is documented anywhere, but it looks useful. I’ll see
where we can put it.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems