file/device open count

Hello,

I need to find a way to “read” an open count of file/device from C program.
(in qnx4 there was dev_info function with open_count). I searched the web
and this newsgroups and couldn’t find it…But stty </dev/ser1 displays this
information…

Any help?

Thanks, Pavol Kycina

Pavol Kycina <xkycina@microstep-hdo.sk> wrote:

Hello,

I need to find a way to “read” an open count of file/device from C program.
(in qnx4 there was dev_info function with open_count). I searched the web
and this newsgroups and couldn’t find it…But stty </dev/ser1 displays this
information…

Any help?

struct _ttyinfo info;

devctl( fd, DCMD_CHR_TTYINFO, &info, sizeof info, NULL );

info.opencount

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Pavol Kycina wrote:

I need to find a way to “read” an open count of file/device from C program.
(in qnx4 there was dev_info function with open_count). I searched the web
and this newsgroups and couldn’t find it…But stty </dev/ser1 displays this
information…

struct _fdinfo info;

io_fdinfo(fd, 0, &info, NULL, 0);

info.count, info.rcount, info.wcount

Thanks to both of you…

Pavol Kycina

“John Garvey” <jgarvey@qnx.com> wrote in message
news:d5drvq$n42$1@inn.qnx.com

Pavol Kycina wrote:
I need to find a way to “read” an open count of file/device from C
program.
(in qnx4 there was dev_info function with open_count). I searched the
web
and this newsgroups and couldn’t find it…But stty </dev/ser1 displays
this
information…

struct _fdinfo info;

io_fdinfo(fd, 0, &info, NULL, 0);

info.count, info.rcount, info.wcount