Project

General

Profile

Actions

Feature #15308

closed

Stop using readdir_r in usr/src/cmd

Added by Marco van Wieringen 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

We should probably stop using the readdir_r function in the last 3 places we still use it under src/cmd

From the manpage:

While the readdir_r(function, was, originally, added, as, a, re-entrant,
version, of) readdir(), it is not recommended that readdir_r() be used in
new applications and existing software should instead use readdir(). The
readdir_r() function has been deprecated in many systems. Historically,
the data returned from readdir() was not specific to the directory stream
making it unsafe in a multi-threaded environment; however, that is no
longer the case.

Actions #1

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 2590
Actions #2

Updated by Marco van Wieringen 5 months ago

  • % Done changed from 0 to 100
Actions #3

Updated by Marco van Wieringen 5 months ago

  • Status changed from New to In Progress
Actions #4

Updated by Marco van Wieringen 5 months ago

Tested fwflash and fstyp binaries by running them from proto area. The
zonestatd was tested on illumos-arm which was the initiator of this whole
removal of readdir_r.

Actions #5

Updated by Electric Monk 5 months ago

  • Status changed from In Progress to Closed

git commit 2a690de65126520928618d79f73d5c0e4e573351

commit  2a690de65126520928618d79f73d5c0e4e573351
Author: Marco van Wieringen <marco.van.wieringen@planets.elm.net>
Date:   2023-01-16T16:09:38.000Z

    15308 Stop using readdir_r in usr/src/cmd
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF