Page MenuHomeFreeBSD

libutil: move ftime to libutil
ClosedPublic

Authored by oshogbo on May 7 2023, 11:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 3, 10:28 PM
Unknown Object (File)
Wed, Dec 11, 2:12 AM
Unknown Object (File)
Nov 29 2024, 8:58 PM
Unknown Object (File)
Nov 28 2024, 9:03 PM
Unknown Object (File)
Nov 24 2024, 8:38 PM
Unknown Object (File)
Nov 23 2024, 9:29 PM
Unknown Object (File)
Nov 22 2024, 11:12 PM
Unknown Object (File)
Nov 21 2024, 6:41 AM

Details

Summary

It seems that there are still some applications that use ftime(3)
(for example, science/siconos, and sysutils/lcdproc). The issue
is that we don't build libcompat as a shared library anymore.
The easiest solution is to move it to libutil, until we
deprecate it for good.

This solution was proposed by kib@ in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.
Author of that bug refers to the issue with science/siconos,
and recently I had similar issue with sysutils/lcdproc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo added a reviewer: kib.

The easiest solution is to move it to libc, until we deprecate it for good.

If we export something from libc, it is there forever. AFAIR this was the main reason why I left it untouched.

Might be, move it to libutil instead?

lib/libcompat/4.1/ftime.c
41

This is too rude, and in principle could cause a grief from the compiler. Perhaps a better approach would be to change sys/timeb.h to do something like this

#if !defined(_IN_LIBC) && defined(__GNUC__)
#warning
#endif

Then define _IN_LIBC before including the header.

oshogbo retitled this revision from libc: move ftime to libc to libutil: move ftime to libutil.May 12 2023, 2:05 PM
oshogbo edited the summary of this revision. (Show Details)
oshogbo edited the summary of this revision. (Show Details)

kib@ thank you. Moved to libuitl.

lib/libutil/ftime.c
36

I suggest to change the protection symbol name to _IN_LIBUTIL, this way it is more consistent with existing practice of IN_RTLD/IN_LIBSA/IN_LIBDL

Yes, thats make sense. Thank you.

kib added inline comments.
lib/libcompat/Makefile
12

Did you checked that buildworld succeed?

Anyway, eventually you might want to move ftime sources to lib/libutil.

This revision is now accepted and ready to land.May 15 2023, 9:56 AM
lib/libcompat/Makefile
12

Yes, I have.

I have moved it to the lib/libutil, maybe phabricator didn't refresh your cache or something:
{F61226090}

lib/libcompat/Makefile
12

I see what you did now. The compat/4.1 confused me, and is it needed? libutil is single-directory library, why add the complication?

This revision was automatically updated to reflect the committed changes.