ldopen man page on DigitalUNIX

Man page or keyword search:  
man Server   12896 pages
apropos Keyword Search (all sections)
Output format
DigitalUNIX logo
[printable version]

ldopen(3)							     ldopen(3)

       ldopen, ldaopen - open a common object file for reading

       #include	 <stdio.h>  #include  <filehdr.h>  #include  <syms.h> #include

       LDFILE *ldopen(
	       char *filename,
	       LDFILE *ldptr ); LDFILE *ldaopen(
	       char *filename,
	       LDFILE *oldptr ); ldreadst(
	       LDFILE *ldptr,
	       int flags );


       The ldopen() and ldclose() routines provide uniform  access  to	simple
       object  files and to object files that are members of archive files. An
       archive of common object files can be processed as if it were a	series
       of simple common object files.

       If  ldptr  has  the  value NULL, ldopen() opens filename, allocates and
       initializes the LDFILE structure, and returns a pointer to  the	struc‐
       ture to the calling program.

       If ldptr is valid and TYPE(ldptr) is the archive magic number, ldopen()
       reinitializes the LDFILE structure for the next archive member of file‐

       The  ldopen()  and  ldclose()  functions	 work  in  concert.  ldclose()
       returns FAILURE only when TYPE(ldptr) is the archive magic  number  and
       there  is another file in the archive to be processed. Only then should
       ldopen() be called with the current value of ldptr. In all other cases,
       and  particularly  when	a  new	filename is opened, ldopen() should be
       called with a ldptr argument.

       The following is a prototype for the use of ldopen() and ldclose():

       /* for each filename to be processed */;

       ldptr = NULL; do
	if ( (ldptr = ldopen(filename, ldptr)) != NULL )

	/* check magic number */;
	/* process the file */;
	} } while (ldclose(ldptr) == FAILURE );

       If the value of oldptr is not NULL, ldaopen() opens filename again  and
       allocates  and  initializes  a new LDFILE structure, copying the fields
       from oldptr.  ldaopen() returns a pointer to the new LDFILE  structure.
       This  new  pointer  is  independent of the old pointer, oldptr. The two
       pointers can be used concurrently to read separate parts of the	object
       file. For example, one pointer can be used to step sequentially through
       the relocation information while the other is used to read indexed sym‐
       bol table entries.

       The  ldopen()  and  ldaopen()  functions	 open filename for reading. If
       filename cannot be opened or if memory for the LDFILE structure	cannot
       be  allocated,  both  functions return NULL. A successful open does not
       ensure that the given file is a	common	object	file  or  an  archived
       object file.

       The  ldopen() function causes the symbol table header and file descrip‐
       tor table to be read. Further access,  by  using	 ldptr,	 causes	 other
       appropriate  sections  of  the symbol table to be read (for example, if
       you call ldtbread(), the symbols or externals are read). To force  sec‐
       tions  for  the symbol table in memory, call ldreadst() with ST_P* con‐
       stants ORed together from st_support.h.

       The program must be loaded with the object file access routine  library

       fopen(3), ldclose(3), ldfcn(4)


List of man pages available for DigitalUNIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net