convert a numeric node ID into its string equivalent
#include <sys/vc.h> int qnx_nidtostr( nid_t nid, char *bufp, int maxbuf );
The qnx_nidtostr() function converts a numeric node ID into its string equivalent.
The maxbuf argument specifies the maximum length of the NUL-terminated string that can be placed in the buffer pointed to by bufp.
If the string is longer than maxbuf, it isn't terminated by a NUL character. |
The number of characters placed in the buffer.
#include <stdio.h> #include <unistd.h> #include <sys/vc.h> main (argc, argv) int argc; char *argv[]; { int i; char node_name[22]; i = qnx_nidtostr ( getnid(), node_name, 22); printf ("My node name is '%s'\n", node_name); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |