Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1039747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:08:18+00:00 2026-05-16T15:08:18+00:00

I have an ANSI C program that dynamically loads a .so file using dlopen()

  • 0

I have an ANSI C program that dynamically loads a .so file using dlopen() passing RTLD_LAZY. I receive

Undefined symbol "_nss_cache_cycle_prevention_function"

warnings whenever the .so file is accessed in FreeBSD 7.2. nss_cache_cycle_prevention_function() is not one of my program’s functions and I imagine must be coming from FreeBSD. This might also be a problem on Linux too although I am not experiencing the issue there. I would prefer not to load FreeBSD specific header files into my program. I would like to either include this function in a portable way or suppress these warnings.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:08:19+00:00Added an answer on May 16, 2026 at 3:08 pm

    What do you mean saying “I receive warning”? Does your program
    examine the value returned by dlerror() and prints it if it is not NULL?

    The _nss_cache_cycle_prevention_function is a marker symbol which is used by nsdispatch(3) on FreeBSD to determine whether to employ the services of nscd(8), the name service caching daemon. It is perfectly normal that it does not exist in an
    executable or a shared library.

    But when nsdispatch(3) executes dlsym(3), and the symbol is not found, the error will be set. And dlerror(3) returns the description of the last error, and not the description of the error of the last call. I suspect that’s what you are hitting.

    The solution (quite portable) would be to:

    • for dlopen(3), check its return value before using dlerror() to see whether there was an error at all;
    • for dlsym(3), since NULL is a valid return value,
      to call dlerror() in a void context before the call to dlsym(3); that will clear any previous error, so that whatever the second call to dlerror(3) returns later on can be trusted.

    In general, it will not harm anything to call an empty dlerror() before any other dl* calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ANSI C program comprising two files. The first file contains the
I have a little c# console program that outputs some text using Console.WriteLine. I
I have a program that uses ansi terminal codes to do fancy stuff like
I have some ANSI C code that I developed on my Mac, but when
I have a UNIX application written in ansi C that writes data directly to
I have a old school c program that now and then need to tell
I have a CGI script (compiled C program) that outputs its command line arguments
I have a text file and it can be ANSI (with ISO-8859-2 charset), UTF-8,
My program has to read files that use various encodings. They may be ANSI,
I have an ANSI C program in Linux CentOS 64-bit computer containing the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.