Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for .daemon

Status
Not open for further replies.

damorrison

Programmer
Aug 27, 2006
3
US
I'm new to AIX and am porting an app that was written for Linux and has already been ported to some other UNIX OSs. In the source code there is a call to "daemon (0,0) that is causing a link error (Undefined symbol: .daemon). Does anybody know where this exists in AIX? I've tried dumping out the contents to all of the shared libraries but have so far come up empty. There is a comment to the effect that on Solaris it is in libresolve....
 
probaly in the named section.

can you give us the function prototype declaration for other Unixes? That can be helpful..


hth
 
Err, found this in my notes (also on IBM's website) These header files are for socket programming.




/usr/include/netinet/in.h Defines Internet constants and structures.
/usr/include/arpa/nameser.h Contains Internet name server information.
/usr/include/netdb.h Contains data definitions for socket subroutines.
/usr/include/resolv.h Contains resolver global definitions and variables.
/usr/include/sys/socket.h Contains data definitions and socket structures.
/usr/include/sys/socketvar.h Defines the kernel structure per socket and contains buffer queues.
/usr/include/sys/types.h Contains data type definitions.
/usr/include/sys/un.h Defines structures for the UNIX(R) interprocess communication domain.
/usr/include/sys/ndd_var.h Defines structures for the operating system Network Device Driver (NDD) domain.
/usr/include/sys/atmsock.h Contains constants and structures for the Asynchronous Transfer Mode (ATM) protocol in the operating system NDD domain.

Is this what you are looking for?
Keep in mind, inet.h is needed for any IP addr translations...

hth
 
On Solaris, the app explicitly declares the function:

#if defined(SOLARIS)
extern int daemon(int, int); /* defined in libresolv of all places */
#endif

I don't see any such declaration for the other platforms - it must be in one of the standard header files. I can go ahead and add the prototype declaration into the app for AIX, but it won't help me get past the undefined symbol linkage error.
 
I found an Apple/Darwin man page that shows the function as residing in libc - at least on that platform. I don't see it there (there is a function called .OKdaemon though) on my AIX system. So my questions is, if it is not in libc on AIX, where is it? Thanks!

From the Apple/Darwin man page

NAME
daemon -- run in the background

LIBRARY
Standard C Library (libc, -lc)

SYNOPSIS
#include <stdlib.h>

int
daemon(int nochdir, int noclose);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top