Commit Graph

141 Commits

Author SHA1 Message Date
Michael Kerrisk 82bd66b8b6 dlopen.3: Fix section ordering
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-08-08 05:54:15 +10:00
Michael Kerrisk 616c2730de remap_file_pages.2, sigaltstack.2, umask.2, wait4.2, basename.3, canonicalize_file_name.3, dlerror.3, dlopen.3, dlsym.3, sockatmark.3, strtok.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-06-20 14:00:37 +02:00
Michael Kerrisk 29b41e747f accept.2, acct.2, bind.2, clock_getres.2, connect.2, dup.2, epoll_create.2, eventfd.2, execve.2, fanotify_init.2, fcntl.2, fork.2, futex.2, get_robust_list.2, getcpu.2, getpeername.2, getrlimit.2, getsockname.2, getsockopt.2, gettimeofday.2, inotify_init.2, listen.2, membarrier.2, memfd_create.2, mlock.2, mmap.2, personality.2, pipe.2, poll.2, recv.2, send.2, sendfile.2, shmget.2, shutdown.2, sigreturn.2, socket.2, socketcall.2, socketpair.2, spu_create.2, swapon.2, time.2, timerfd_create.2, uselib.2, dlerror.3, dlopen.3, drand48.3, errno.3, fnmatch.3, getgrent.3, getgrnam.3, getlogin.3, getpwent.3, getpwnam.3, iconv.3, mq_open.3, opendir.3, random_r.3, sem_open.3, shm_open.3, tmpfile.3, tzset.3, random.4, fanotify.7, futex.7, vdso.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-29 13:48:42 +01:00
Michael Kerrisk 2e056718fc dlopen.3: Include a shell session showing build/run in EXAMPLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-05 10:46:28 +01:00
Michael Kerrisk 4373ccc072 dlopen.3: Change arguments to main() to "void" in EXAMPLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-05 10:46:22 +01:00
Michael Kerrisk b44cf4bcd4 dlopen.3: Correct the pathname used in EXAMPLE
Quoting Florian:

    This does not work because libm.so can be a linker script:

           handle = dlopen("libm.so", RTLD_LAZY);

    The proper way to do this is to include <gnu/lib-names.h>
    and use LIBM_SO.

See https://bugzilla.kernel.org/show_bug.cgi?id=108821

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-05 10:40:31 +01:00
Michael Kerrisk 1a08b97b56 dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-02 14:03:49 +01:00
Michael Kerrisk 8dbd75b8ba dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-11-17 10:36:03 +01:00
Michael Kerrisk 50008330de dlopen.3: Make it more explicit that LD_BIND_NOW overrides RTLD_LAZY
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-11-17 10:31:56 +01:00
Michael Kerrisk 460495ca58 ldd.1, sprof.1, accept.2, alarm.2, bind.2, chdir.2, clock_nanosleep.2, close.2, connect.2, dup.2, execve.2, fsync.2, getgid.2, getpeername.2, getsid.2, getsockname.2, getsockopt.2, getuid.2, io_getevents.2, kill.2, listen.2, lseek.2, mmap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nice.2, pause.2, pipe.2, rmdir.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select_tut.2, semctl.2, semop.2, setsid.2, shmctl.2, shmget.2, shmop.2, shutdown.2, sigaction.2, signal.2, socketpair.2, sync.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, times.2, truncate.2, umask.2, MB_CUR_MAX.3, a64l.3, abs.3, assert.3, atexit.3, atof.3, atoi.3, basename.3, bsearch.3, btowc.3, byteorder.3, catgets.3, catopen.3, clock.3, clock_getcpuclockid.3, closedir.3, confstr.3, crypt.3, ctermid.3, difftime.3, div.3, dladdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, drand48.3, encrypt.3, exit.3, fclose.3, ffs.3, fgetc.3, fgetwc.3, fgetws.3, flockfile.3, fmtmsg.3, fnmatch.3, fopen.3, fpathconf.3, fpclassify.3, fputwc.3, fputws.3, fseek.3, fseeko.3, ftok.3, fwide.3, getdate.3, getenv.3, getgrent.3, getgrnam.3, gethostid.3, getlogin.3, getnetent.3, getopt.3, getpwent.3, getpwnam.3, getsubopt.3, getutent.3, getwchar.3, grantpt.3, hsearch.3, iconv.3, iconv_close.3, iconv_open.3, if_nameindex.3, inet.3, inet_ntop.3, inet_pton.3, insque.3, isatty.3, isgreater.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, lockf.3, longjmp.3, lsearch.3, malloc.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, memccpy.3, memchr.3, memcmp.3, memmove.3, memset.3, mktemp.3, mq_close.3, mq_getattr.3, mq_receive.3, mq_send.3, mq_unlink.3, offsetof.3, popen.3, posix_memalign.3, posix_openpt.3, printf.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstacksize.3, pthread_equal.3, pthread_exit.3, pthread_getcpuclockid.3, pthread_kill.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_testcancel.3, ptsname.3, putenv.3, puts.3, putwchar.3, qsort.3, raise.3, random.3, readdir.3, regex.3, remove.3, rewinddir.3, seekdir.3, sem_destroy.3, sem_getvalue.3, sem_unlink.3, sem_wait.3, setenv.3, setjmp.3, setlocale.3, setlogmask.3, signbit.3, sigpause.3, sigset.3, sigsetops.3, sigwait.3, sleep.3, sockatmark.3, statvfs.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strlen.3, strpbrk.3, strptime.3, strspn.3, strstr.3, strtod.3, strtoimax.3, strtok.3, strtol.3, strtoul.3, strxfrm.3, swab.3, sysconf.3, system.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tmpfile.3, towctrans.3, tsearch.3, ttyname.3, tzset.3, ungetwc.3, unlocked_stdio.3, unlockpt.3, wcrtomb.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcslen.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstoimax.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wordexp.3, wprintf.3, fanotify.7, mq_overview.7, nptl.7, sem_overview.7, shm_overview.7, sigevent.7, symlink.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 18:21:22 +02:00
Michael Kerrisk 0fdbc11423 dlopen.3: Note a case where dlmopen() provides better isolation than RTLD_LOCAL
Cowritten-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk 6fd1b6ebb7 dlopen.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk 438168a249 dlopen.3: wfix
Reported-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk e8a1758ca3 dlopen.3: Reorganize conformance information for 'flags'
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk 6962fdf954 dlopen.3: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk b23510e5db dlopen.3: ATTRIBUTES: Note functions that are thread-safe
After research, we think
* dlopen(),
* dlmopen(),
* dlclose()
are thread-safe. But, there are not markings of them in
glibc document.

[mtk: Split out patch for formerly single dlopen.3 page]

Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:45 +02:00
Michael Kerrisk b198e0ae76 dlopen.3: Move atexit() discussion under "Initialization and Finalization"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 6ceba646b4 dlopen.3: Mention other functions in the dlopen API in the initial paragraph
Doing so helps orient the reader.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 747b2b0a98 dlopen.3: dlclose() will unload the object when all references have been released
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 9ebcbe1377 dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 982eac0dba dlopen.3: Corrections and improvements after comments from Carlos O'Donell
Reported-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 374b34d32e dlopen.3: Remove dlerror() content that was migrated to dlerror(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk b6779d1d8f dlopen.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk e83ed17d21 dlopen.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 7766185cf8 dlopen.3: EXAMPLE: Remove mention of "-rdynamic"
That option isn't needed for compiling and running this program.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 896c71d0bd dlopen.3: Remove content migrated to new dlsym() page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk c7c01315dc dlopen.3: Rework the discussion of initialization and finalization functions
Deemphasize the obsolete _init/_fini and give more prominence
to gcc constructors/destructors.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk e8290357ce dlopen.3: Move discussion of _init() and _fini() to NOTES
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 7e936c2917 dlopen.3: Remove reference to ld.so info page
The command "info ld.so" simply shows the man page...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 65175b1d2a dlopen.3: Note some dlmopen() restrictions
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk fe854f153e dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 43151de329 ldd.1, sprof.1, execve.2, dlopen.3, ld.so.8: Prefer "shared object" over "shared library"
The man pages variously use "shared library" or "shared object".
Try to more consistently use one term ("shared object"), while
also pointing out on a few pages that the terms are synonymous.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:44 +02:00
Michael Kerrisk 9c1697549f dlopen.3: Improvements after input from Carlos O'Donell
Reported-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk efdd68a5b2 dlopen.3: Document dlmopen(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 46db2df163 dlopen.3: SEE ALSO: add dlinfo(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 6c46d3bc43 dlopen.3: SEE ALSO: add dladdr(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 3f4c09d0d3 dlopen.3: Integrate dlvsym() discussion into main page text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 705e06be7f dlopen.3: Minor fix: remind reader that _init() and _fini() are obsolete
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 6445992d72 dlopen.3: Remove dladdr() content
This content will be migrated to a new page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 8ac45f42e7 dlopen.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 0a78ab7b0a dlopen.3: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk adb1cfab52 dlopen.3: Add VERSIONS section
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-08-08 17:35:43 +02:00
Michael Kerrisk 1e64c86bbf intro.1, ldd.1, clone.2, getgroups.2, getpid.2, getsockopt.2, ioctl_list.2, msgop.2, open.2, seccomp.2, setgid.2, setresuid.2, setreuid.2, setuid.2, sigaction.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, syscall.2, syscalls.2, umount.2, clock.3, dlopen.3, fmemopen.3, fpathconf.3, fputwc.3, fputws.3, fseek.3, fseeko.3, gcvt.3, getline.3, getwchar.3, hypot.3, if_nameindex.3, initgroups.3, popen.3, resolver.3, strcoll.3, strdup.3, tzset.3, ulimit.3, wcstombs.3, wctob.3, xdr.3, console_codes.4, random.4, filesystems.5, host.conf.5, hosts.5, proc.5, resolv.conf.5, securetty.5, credentials.7, feature_test_macros.7, hier.7, ipv6.7, packet.7, pthreads.7, raw.7, signal.7, tcp.7, user_namespaces.7, ld.so.8, ldconfig.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-29 22:30:09 +02:00
Michael Kerrisk b6fe25f722 dlopen.3: RTLD_NEXT works for symbols generally, not just functions
The common use case is for functions, but RTLD_NEXT
also applies to variable symbols.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 08:24:07 +01:00
Michael Kerrisk 99175a5826 dlopen.3: Add some details for RTLD_DEFAULT
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 08:24:07 +01:00
Michael Kerrisk 4251757a3a dlopen.3: Add some details on RTLD_NEXT and preloading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 08:24:07 +01:00
Michael Kerrisk fad3d64efc dlopen.3: Reformat text on RTLD_DEFAULT and RTLD_NEXT
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 08:24:02 +01:00
Michael Kerrisk cc2ddf2fd5 dlopen.3: dlclose() recursively closes dependent libraries
Note that dlclose() recursively closes dependent libraries
that were loaded by dlopen()

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-15 09:53:02 +01:00
Michael Kerrisk 4a1af09bd1 dlopen.3: Amend error in description of dlclose() behavior
The current text says that unloading depends on whether
the reference count falls to zero *and no other libraries
are using symbols in this library*. That latter text has
been there since man-pages-1.29, but it seems rather dubious.
How could the implementation know whether other libraries
are still using symbols in this library? Furthermore, no
other implementation's man page mentions this point.
Seems best to drop this point.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-15 09:53:02 +01:00
Michael Kerrisk cf2789f1c2 dlopen.3: Rename second dlopen() argument from "flag" to "flags"
This is more consistent with other such arguments

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-15 09:53:02 +01:00