Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - resmgr_attach fuction -( ls -l /dev - Bad file descriptor): (2 Items)
   
resmgr_attach fuction -( ls -l /dev - Bad file descriptor)  
Hi,

I have created the resource manager using resmgr_attach function.

iofunc_attr_init(&attr,S_IFNAM | 0666,0,0);
memset(&resmgr_attr, 0, sizeof resmgr_attr);
resmgr_attr.nparts_max = 1;
resmgr_attr.msg_max_size = 2048;

iofunc_func_init(_RESMGR_CONNECT_NFUNCS, &mdio_connect, _RESMGR_IO_NFUNCS, &mdio_io);

/* devctl function to perform MII read/write */
mdio_connect.open = mdio_open;
mdio_io.devctl = io_devctl;

mdioHdl->rid = resmgr_attach(mdioHdl->dpp, &resmgr_attr, "/dev/mii", 0,
			0, &mdio_connect, &mdio_io,0);


After successfull attach.If i do ls -l /dev - its giving ls: Bad file descriptor (./mii).

please help me on this..

The following are logs
=============

# ls -l
ls: Bad file descriptor (./mii)
total 8912897
n------rw-  1 root      0                 0 Jan 01 00:40 bpf
n------rw-  1 root      0                 0 Jan 01 00:40 bpf0
crw-rw-rw-  1 root      0            0,   1 Jan 01 00:00 console
nrw-rw-rw-  1 root      0                 0 Jan 01 00:40 crypto
nrw-rw-rw-  1 root      0                 0 Jan 01 00:21 dbgmem
brw-r-----  1 root      0            4,   0 Jan 01 00:00 fs0
brw-r-----  1 root      0            4,   1 Jan 01 00:21 fs0p0
brw-r-----  1 root      0            4,   2 Jan 01 00:21 fs0p1
crw-rw-rw-  1 root      0            0,   1 Jan 01 00:21 i2c0
nrw-rw-rw-  1 root      0                 0 Jan 01 00:21 i2c_bus_a
nrw-rw-rw-  1 root      0                 0 Jan 01 00:21 i2c_bus_b
-rw-------  1 root      0         4294967295 Jan 01 00:40 mem
dr-xr-xr-x  2 root      0                 0 Jan 01 00:40 mqueue

Thanks and Regards
K.Senthil
Re: resmgr_attach fuction -( ls -l /dev - Bad file descriptor)  
> mdio_connect.open = mdio_open;
> mdio_io.devctl = io_devctl;
>   
I don't know what your code does so it's hard to help you. Could be a 
problem with your open function...

Please refer to Writing a Resource Manager, it is very good:
http://www.qnx.com/developers/docs/6.4.1/neutrino/resmgr/about.html

/P