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
F97813937: D38733.diff
Tue, Oct 1, 9:18 AM
Unknown Object (File)
Mon, Sep 23, 8:42 PM
Unknown Object (File)
Wed, Sep 18, 11:42 PM
Unknown Object (File)
Tue, Sep 17, 5:49 AM
Unknown Object (File)
Wed, Sep 11, 3:49 PM
Unknown Object (File)
Wed, Sep 11, 3:49 PM
Unknown Object (File)
Wed, Sep 11, 3:49 PM
Unknown Object (File)
Mon, Sep 9, 2:19 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)