Forum Topic - makdev() with two / three parameters?:
   
makdev() with two / three parameters?  
during porting rpm5 to qnx i detected a difference in the number of parameters for makedev():

on netbsd it's defined as:
   #define makedev(x,y) <...>

on qnx it's defined as:
   #define makedev(node,major,minor) <...>

searching the internet i got the hint to change the calls on qnx in the following way (setting 'node' fixed to '0'):

   makedev(x,y) --> makedev(0,x,y)

okay, at least it compiles and seams to run. but i'm not sure, that it's working for all circumstances.

is there any known drawback, when doing it the mentioned way?

-piet


Re: makdev() with two / three parameters?  
On Tue, Jan 22, 2008 at 05:10:19AM -0500, Peter Kalbus wrote:
> during porting rpm5 to qnx i detected a difference in the number of parameters for makedev():
> 
> on netbsd it's defined as:
>    #define makedev(x,y) <...>
> 
> on qnx it's defined as:
>    #define makedev(node,major,minor) <...>
> 
> searching the internet i got the hint to change the calls on qnx in the following way (setting 'node' fixed to '0'):
> 
>    makedev(x,y) --> makedev(0,x,y)
> 
> okay, at least it compiles and seams to run. but i'm not sure, that it's working for all circumstances.
> 
> is there any known drawback, when doing it the mentioned way?
> 
> -piet

Most (all?) 3rd party code isn't QNET aware so to be totally
correct it should be:

#include <sys/netmgr.h>
makedev(ND_LOCAL_NODE, x, y);

Which is equivalent to what you had.

-seanb
Re: makdev() with two / three parameters?  
okay, so may current patch will work, that's good

i already addressed the point to the developers to see, if there's a chance to get the 2/3 parameter detection and 
handling included in the source package itself.

-piet
Re: makdev() with two / three parameters?  
what would be the best way to #ifdef around the include to get it exclusive on qnx systems:

#if defined(__QNX__)
  <...>
#endif

-piet
Re: makdev() with two / three parameters?  
On Tue, Jan 22, 2008 at 01:01:30PM -0500, Peter Kalbus wrote:
> what would be the best way to #ifdef around the include to get it exclusive on qnx systems:
> 
> #if defined(__QNX__)
>   <...>
> #endif

Use __QNXNTO__ instead.

-seanb
Re: makdev() with two / three parameters?  
thanks!

-piet