[PATCH v2 1/1] ldconfig: add --install option

Florian Weimer fweimer@redhat.com
Wed Jun 3 15:25:10 GMT 2026


* DJ Delorie:

> Add --install option, which copies a pre-built ld.so.cache into place,
> honoring the cache and root options and defaults.  This gives the user
> a canonical "correct" way to install a pre-built cache.

It avoids truncating the file in place.  This is what cp does, leading
to crashes when /etc/ld.so.conf is read.

> +      /* If the two files are on the same filesystem, we can just
> +	 rename it.  */
> +      if (rename (source, cache_file) == 0)
> +	{
> +	  /* A simple rename was sufficient.  */
> +	  close (src_fd);
> +	  exit (0);
> +	}

Can we please always make a copy, so that the original file does not get
deleted mysteriously?

Thanks,
Florian



More information about the Libc-alpha mailing list