Page MenuHomeFreeBSD

Delete obsolete Solaris compat header file `stdlib.h`
ClosedPublic

Authored by zlei on Feb 22 2023, 5:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 2:01 PM
Unknown Object (File)
Wed, Nov 20, 9:03 AM
Unknown Object (File)
Oct 29 2024, 1:00 PM
Unknown Object (File)
Oct 1 2024, 11:31 AM
Unknown Object (File)
Oct 1 2024, 9:18 AM
Unknown Object (File)
Sep 23 2024, 8:42 PM
Unknown Object (File)
Sep 18 2024, 11:42 PM
Unknown Object (File)
Sep 17 2024, 5:49 AM
Subscribers

Details

Summary

This drops function getexecname() redirection.

Historically getexecname() is a compatibility definition. Since openzfs has its own implementation of function getexecname() in libspl and has been merged into base, the compat header file stdlib.h is no longer needed and should not be used.

Also without this fix libspl will end up an incompatible version of getprogname() with libc. In particular, if zfs is enabled, programs such as pgrep in /rescue can be wrongly statically linked with libspl and will not function properly.

PR: 269738
MFC after: 1 week
Fixes: 9e5787d2284e Merge OpenZFS support in to HEAD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

  1. This file can simply be removed, no?
  2. Will this break the use of getexecname() in contrib/opensolaris/tools/ctf/common/utils.c? I think we can simply change that to use getprogname(). Or even better, get rid of getpname() and modify the single caller in dump.c to use getprogname() directly.
  1. This file can simply be removed, no?
  2. Will this break the use of getexecname() in contrib/opensolaris/tools/ctf/common/utils.c? I think we can simply change that to use getprogname(). Or even better, get rid of getpname() and modify the single caller in dump.c to use getprogname() directly.

It may break contrib/opensolaris/tools/ctf/common/utils.c, I'll check that.

In D38733#881451, @zlei wrote:
  1. This file can simply be removed, no?
  2. Will this break the use of getexecname() in contrib/opensolaris/tools/ctf/common/utils.c? I think we can simply change that to use getprogname(). Or even better, get rid of getpname() and modify the single caller in dump.c to use getprogname() directly.

It may break contrib/opensolaris/tools/ctf/common/utils.c, I'll check that.

Yes you're right !

ctfdump is actually linked against getprogname() in libc. So we can safely get rid of getpname().

BTW, after debugging with lldb I can confirm ztest is calling getprogname() in libspl.

In D38733#881594, @zlei wrote:
In D38733#881451, @zlei wrote:
  1. This file can simply be removed, no?
  2. Will this break the use of getexecname() in contrib/opensolaris/tools/ctf/common/utils.c? I think we can simply change that to use getprogname(). Or even better, get rid of getpname() and modify the single caller in dump.c to use getprogname() directly.

It may break contrib/opensolaris/tools/ctf/common/utils.c, I'll check that.

Yes you're right !

ctfdump is actually linked against getprogname() in libc. So we can safely get rid of getpname().

And with D38740 we should be able to completely remove this stdlib.h header.

BTW, after debugging with lldb I can confirm ztest is calling getprogname() in libspl.

zlei retitled this revision from zfs: Drop function getexecname() redirection to Delete unneeded Solaris compat header file `stdlib.h`.
zlei edited the summary of this revision. (Show Details)

Remove the compat header file stdlib.h

This revision is now accepted and ready to land.Feb 23 2023, 5:45 PM
zlei retitled this revision from Delete unneeded Solaris compat header file `stdlib.h` to Delete obsolete Solaris compat header file `stdlib.h`.Feb 23 2023, 5:46 PM
zlei edited the summary of this revision. (Show Details)