Sponsored Content
Top Forums UNIX for Advanced & Expert Users What happens when an exe/lib links to another shared one: Post 302087202 by jim mcnamara on Wednesday 30th of August 2006 09:48:00 AM
Old 08-30-2006
The library in Linux is actually a link? eg. mylib.so is a link and is not updated to point to mylib.so.1.3

You should not depend on checksums to validate libraries. There should be a simple module in there, call it getversion(), with a static what string
Code:
static char *pvcsmodulename="@(#)mycompany modulename v 1.5   13 Jun 2003 14:06 $";
char  *getversion(void)
{
    return pvcsmodulename;
}

You can run what against the library to see the version, and your code can internally call getversion() if it needs it.
 

8 More Discussions You Might Find Interesting

1. Programming

how To edit exe to insert a serial no wich can be usd by runing exe

At time of installation I have to open the resource. and i have to insert a string serial number in the exe. please provide me code to edit the exe (in solaris) to insert a serial number which can be used by exe at run time. (6 Replies)
Discussion started by: ssahu
6 Replies

2. HP-UX

shared lib issue

im not good with this stuff but the app guys game to me with a problem with there c++ program on a new box, any ideas? bin- ./qeng Bus error (core dumped) bin- ./gdb qeng core Wildebeest is free software and you are welcome to distribute copies of it under certain conditions; type "show... (4 Replies)
Discussion started by: csaunders
4 Replies

3. Red Hat

ls: /lib/libattr.so.1: no version information available (required by /lib/libacl.so.1)

Hello, I'm experimenting a problem on my rh server. Red Hat Enterprise Linux AS release 3 (Taroon Update 8) 2.4.21-47.ELsmp #1 SMP i686 i686 i386 GNU/Linux It started with a segmentation fault on #id root To resolve it, I've installed coreutils-4.5.3-28.4.i386.rpm But, I... (6 Replies)
Discussion started by: gogol_bordello
6 Replies

4. Programming

Can I create a shared object by using an static lib?

for example, I have a static lib name liba.a it offers some interface such a1();a2(); but i do not have the source code of liba.a; If i would like to create a shared object, and offer the similar interface of a1 and a2; Is there a way to fulfill such requirement? thanks. (7 Replies)
Discussion started by: flost
7 Replies

5. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

6. Shell Programming and Scripting

Shared File system- lib access issue

I have a C++ binary executable installed in a file system which is shared across multiple solaris boxes. When I start this executable from one of the boxes,I am able to start only 4 parallel instances and from the 5th instance onwards I am getting the following error. fatal: libdb2.so.1:... (2 Replies)
Discussion started by: prasperl
2 Replies

7. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

8. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies
DLCLOSE(P)						     POSIX Programmer's Manual							DLCLOSE(P)

NAME
dlclose - close a dlopen object SYNOPSIS
#include <dlfcn.h> int dlclose(void *handle); DESCRIPTION
The dlclose() function shall inform the system that the object referenced by a handle returned from a previous dlopen() invocation is no longer needed by the application. The use of dlclose() reflects a statement of intent on the part of the process, but does not create any requirement upon the implementa- tion, such as removal of the code or symbols referenced by handle. Once an object has been closed using dlclose() an application should assume that its symbols are no longer available to dlsym(). All objects loaded automatically as a result of invoking dlopen() on the refer- enced object shall also be closed if this is the last reference to it. Although a dlclose() operation is not required to remove structures from an address space, neither is an implementation prohibited from doing so. The only restriction on such a removal is that no object shall be removed to which references have been relocated, until or unless all such references are removed. For instance, an object that had been loaded with a dlopen() operation specifying the RTLD_GLOBAL flag might provide a target for dynamic relocations performed in the processing of other objects-in such environments, an application may assume that no relocation, once made, shall be undone or remade unless the object requiring the relocation has itself been removed. RETURN VALUE
If the referenced object was successfully closed, dlclose() shall return 0. If the object could not be closed, or if handle does not refer to an open object, dlclose() shall return a non-zero value. More detailed diagnostic information shall be available through dlerror(). ERRORS
No errors are defined. The following sections are informative. EXAMPLES
The following example illustrates use of dlopen() and dlclose(): ... /* Open a dynamic library and then close it ... */ #include <dlfcn.h> void *mylib; int eret; mylib = dlopen("mylib.so", RTLD_LOCAL | RTLD_LAZY); ... eret = dlclose(mylib); ... APPLICATION USAGE
A conforming application should employ a handle returned from a dlopen() invocation only within a given scope bracketed by the dlopen() and dlclose() operations. Implementations are free to use reference counting or other techniques such that multiple calls to dlopen() referenc- ing the same object may return the same object for handle. Implementations are also free to reuse a handle. For these reasons, the value of a handle must be treated as an opaque object by the application, used only in calls to dlsym() and dlclose(). RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
dlerror() , dlopen() , dlsym() , the Base Definitions volume of IEEE Std 1003.1-2001, <dlfcn.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 DLCLOSE(P)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy