Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 8
Query the resource database
#include <sys/rsrcdbmgr.h>
#include <sys/rsrcdbmsg.h>
int rsrcdbmgr_query_name( rsrc_alloc_t *list,
int listcnt,
int start,
pid_t pid );
char *name );
unsigned type );
- list
- NULL, or an array of
rsrc_alloc_t
structures that the function can fill with information about the resources
that it finds.
For more information about this structure, see the documentation for
rsrcdbmgr_create().
- listcnt
- The number of entries in the array.
- start
- The index that you want to start searching at.
- pid
- Which blocks to query:
- -1: query all blocks.
- 0: query all free blocks.
- > 0: query blocks owned by the process with the given pid.
- name
- The name of the resource to query.
For more information, see
rsrcdbmgr_attach().
- type
- The subtype to query; 0, or one of the following:
- RSRCDBMGR_DMA_CHANNEL — DMA channel
- RSRCDBMGR_IO_PORT — I/O port address
- RSRCDBMGR_IRQ — Interrupt address
- RSRCDBMGR_MEMORY — Memory address
- RSRCDBMGR_PCI_MEMORY — PCI memory address
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The rsrcdbmgr_query_name() function queries the
database for listcnt count of type resources
in use, beginning at the index start.
If you make the query with a non-NULL list,
then the function stores
a maximum of found listcnt resources in the array.
If list is NULL or
listcnt is 0, then the function returns
the number of resources of type in the database.
If list is non-NULL, then the
function returns the number of type resources
available in the system.
If an error occurs, the function returns -1 and sets
errno.
- EINVAL
- Invalid argument
- ENOMEM
- Insufficient memory to allocate internal data structures.
List all of the memory resource blocks available in the system:
rsrc_alloc_t list[20];
int size, count = 0, start = 0;
while (1) {
count = rsrcdbmgr_query_name( list, 20, start, -1, "memory", 0);
if (count == -1)
break;
size = min( count-start, 20 ); /* In case more than 20 blocks
were returned. */
printf( "Retrieved %d of a possible %d resource blocks", \
size, count);
for (count=0; count<size; count++) {
printf( "RSRC[%d] Start %d End %d \n", \
start+count, list[count].start, list[count].end);
}
start += size; /* Loop again, in case there are more than
20 blocks. */
}
QNX Neutrino
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
rsrcdbmgr_attach()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 234
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/rsrcdbmgr_query_name.html on line 234