Bug 224016

Summary: [exp-run] Removal of basename_r()
Product: Ports & Packages Reporter: Ed Schouten <ed>
Component: Ports FrameworkAssignee: Sean Bruno <sbruno>
Status: Closed FIXED    
Severity: Affects Only Me CC: ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Ed Schouten freebsd_committer 2017-12-01 10:54:49 UTC
Now that the POSIX folks have agreed on requiring that basename() and dirname() have to be thread-safe, there is even less of a need to provide our FreeBSD-specific copy of basename_r(). Relevant links:

POSIX working group discussion: http://austingroupbugs.net/view.php?id=1064
Old exp-run for adding POSIX versions of basename() and dirname(): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209747

As we no longer make use of basename_r() in our own base system, I would hereby like to request an exp-run to see what happens if we remove it entirely. Here's a patch I'm planning on committing:


Comment 2 commit-hook freebsd_committer 2017-12-08 22:07:03 UTC
A commit references this bug:

Author: ed
Date: Fri Dec  8 22:06:18 UTC 2017
New revision: 326719
URL: https://svnweb.freebsd.org/changeset/base/326719

  Remove basename_r(3).

  Now that the POSIX working group is going to require that basename(3)
  and dirname(3) are thread-safe in future revisions of the standard,
  there is even less of a need to provide basename_r(3). Remove this
  function to prevent people from writing code that only builds on
  FreeBSD and Bionic.

  Removing this function seems to break exactly one port: sbruno@'s
  qemu-user-static. I will send him a pull request on GitHub in a bit.
  __FreeBSD_version will not be bumped, as any value from 2017 can be used
  to test for the presence of a thread-safe basename(3)/dirname(3).

  PR:		https://bugs.freebsd.org/224016

Comment 3 Ed Schouten freebsd_committer 2017-12-08 22:13:25 UTC
Thanks for testing, Antoine!

I've just committed the change to remove basename_r(3) from the base system. I also sent a pull request to Sean to fix the build of qemu-user-static on FreeBSD HEAD:


I'm reassigning this bug to Sean to ensure this won't slip off the radar.
Comment 4 commit-hook freebsd_committer 2017-12-17 00:14:30 UTC
A commit references this bug:

Author: sbruno
Date: Sun Dec 17 00:14:17 UTC 2017
New revision: 456518
URL: https://svnweb.freebsd.org/changeset/ports/456518


  Update to 2.11.50 + patches from submitters.  Upstream introduced some git
  nonsense with remotes inside their repos.  Change the way we fetch our
  distributions with GH_TUPLE instead of the previous way.  Clean up a couple
  lines commented out for the PCAP features that aren't stored in a patch, but
  merely direct committed to this tree.

  - Remove the interpreter name and interpreter prefix when retrieving the
    argument vectors using kvm_getargv  (Mikael Urankar)

  - No need to check msg_controllen: msg_controllen can have the value 0 and
    the kernel discards negative value  (Mikael Urankar)

  - Implement/modify kevent64 related syscalls.  (Mikael Urankar)

  - Implement ktimer_{create, delete, settime, gettime} (Mikael Urankar)

  - Stop using basename_r(3). Fix build after FreeBSD svn r326719 (Ed Shouten)

  Changelogs can be found at https://github.com/seanbruno/qemu-bsd-user

  PR:	224016