Page MenuHomeFreeBSD

Implement new make_dev_args() API
AbandonedPublic

Authored by hselasky on Nov 2 2015, 3:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 7, 7:30 AM
Unknown Object (File)
Tue, Jul 7, 3:11 AM
Unknown Object (File)
Mon, Jul 6, 11:58 PM
Unknown Object (File)
Mon, Jul 6, 9:06 PM
Unknown Object (File)
Sun, Jul 5, 9:39 AM
Unknown Object (File)
May 3 2026, 11:05 PM
Unknown Object (File)
Apr 28 2026, 10:39 AM
Unknown Object (File)
Apr 5 2026, 7:34 PM
Subscribers

Details

Summary

To solve races setting character device variables, a new character device API is adviced.

Example:

struct cdev *pcdev;
int retval;

retval = MAKE_DEV_ARGS(&pcdev, (.si_uid = 0, .si_gid = 0,.si_mode = 0777), "testdev");

#define MAKE_DEV_ARGS(ppdev,args,...) \

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

hselasky retitled this revision from to Implement new make_dev_args() API.
hselasky updated this object.
hselasky edited the test plan for this revision. (Show Details)
hselasky added reviewers: kib, rwatson, glebius, jhb.
hselasky set the repository for this revision to rS FreeBSD src repository - subversion.

I am sorry, apparently I missed this review when you posted it.

I did prototyped very similar patch last time we talked. Differences are in the handling of the make_dev_args structure grow, I made it completely automatic without manual checks for the version. Also, I think my handling of (obsoleted) unit numbers is, in some sense, better.

I will put my variation onto review in a second.

UPDATE: D4746