1825780 Members
2530 Online
109687 Solutions
New Discussion

Missing files on linux

 
Kernel Tunable parmeter
Occasional Contributor

Missing files on linux

I have one application that is running properly on HP-UX but if I run same on Linux, it is failing.That application is using function calls like svc_create().These functions are missing on Linux. could you please tell what is alternative way to resolve this issue.

Thanks in advance
Manish.
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: Missing files on linux

> Missing files on linux

Which files are missing?

> [...] Linux, [...]

Not a very detailed description of anything.

> [...] is failing [...]

Not a very detailed description of anything.

As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations.

> [...] These functions are missing on Linux.
> [...]

They are? Evidence?

Is the (mysterious, unidentified) "one
application" failing when you run it, or are
you having trouble building it?
Kernel Tunable parmeter
Occasional Contributor

Re: Missing files on linux

Hi Steven Schweda,

thanks for your prompt reply.

clio_svc.o: In function `main':
clio_svc.c:(.text+0xaf85): undefined reference to `svc_create'
collect2: ld returned 1 exit status
+ (( 1 ))
+ print -u2 'cc -o ./clio_svc clio_util.o clio_xdr.o clio_svc.o -pthread -lc -lnsl failed'
cc -o ./clio_svc clio_util.o clio_xdr.o clio_svc.o -pthread -lc -lnsl failed
+ return 1
make: *** [all] Error 1


In above error, "svc_create" is undefined reference. but on HP-UX we are not seeing this error and application is running.
Matti_Kurkela
Honored Contributor

Re: Missing files on linux

svc_create() is a function call of the SunRPC library (RFC 1050, RFC 1057).

I don't have any experience with RPC programming of any kind, but browsing through "man rpc" on Linux and "man svc_create" on HP-UX suggests that svc_create() is just a way to perform the work of svc_create() + svc_register() in one step, possibly creating services for multiple protocols at once.

For the purpose of porting the application from HP-UX to Linux, you might create your own svc_create() function. You should make it take exactly the same arguments as HP-UX svc_create(), then make the appropriate svc_create() and svc_register() calls. You might even make it into a separate library, so that next time you are porting an application that uses svc_create(), you can just add that library to the application's compilation process.

On HP-UX, the man page indicates svc_create uses two external sources of arguments for choosing the service type(s) to create: the NETPATH environment variable (if it exists), and the "netconf database". On Linux, the netconf database probably doesn't exist (I have no idea what it might be). So you'll have to make some implementation decisions of your own here.

The svc_create() does not allow you to specify which TCP/UDP port your service(s) should use, but in Linux, you can optionally set up a socket, bind it to the port you want and then use svctcp_create() or svcudp_bufcreate() and then svc_register() on the socket to turn it into a RPC service. Having the RPC services in fixed ports makes it easier to allow access to RPC services through firewalls.

(If you want the old behavior of assigning arbitrary ports for RPC services, use the constant RPC_ANYSOCK as the socket, in which case the svctcp_create() or svcudp_bufcreate() will automatically create a new socket for the service.)

MK
MK
Kernel Tunable parmeter
Occasional Contributor

Re: Missing files on linux

Hi MK,

Thanks a lot, it really appreciated for your prompt reply and all it worked for me and now m able to successfully run the application on Linux.

Regards
Manish