Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2005 00:08:10 GMT
From:      "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   docs/78172: make_dev.9 says DEVFS functions use dev_t instead of 'struct cdev'
Message-ID:  <200502280008.j1S08Ah7024136@freebsd.czest.pl>
Resent-Message-ID: <200502280010.j1S0AAQB082610@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         78172
>Category:       docs
>Synopsis:       make_dev.9 says DEVFS functions use dev_t instead of 'struct cdev'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 28 00:10:10 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Wojciech A. Koszek
>Release:        FreeBSD 5.4-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD dunstan.freebsd.czest.pl 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #10: Sat Feb 26 23:44:07 CET 2005 dunstan@dunstan.freebsd.czest.pl:/usr/obj/usr/src/sys/HOME7 i386


>Description:
make_dev(9) says DEVFS functions take/return dev_t variables. Current
implementation takes/returns struct cdev. Attached patch [diff.0.make_dev.9]
correct mistakes in make_dev.9.
>How-To-Repeat:
Look at /usr/src/share/man/man9/make_dev.9:

[make_dev.9]
#include <sys/param.h>
#include <sys/conf.h>

dev_t
make_dev(struct cdevsw *cdevsw, int minor, uid_t uid, gid_t gid,
int perms, const char *fmt, ...);

dev_t
make_dev_alias(dev_t pdev, const char *fmt, ...);

void
destroy_dev(dev_t dev);

void
dev_depends(dev_t pdev, dev_t cdev);
[..]

These function use dev_t. But conf.h has diffrent declarations:

[/sys/sys/conf.h]
[..]
void	destroy_dev(struct cdev *_dev);
[..]
void	dev_depends(struct cdev *_pdev, struct cdev *_cdev);
[..]
struct cdev *make_dev(struct cdevsw *_devsw, int _minor, uid_t _uid, gid_t _gid,
		int _perms, const char *_fmt, ...) __printflike(6, 7);
[..]
struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3);
[..]

>Fix:

--- diff.0.make_dev.9 begins here ---

Patch against FreeBSD 5.4-PRERELEASE, kern.osreldate: 503102.

diff -upr /usr/src/share/man/man9/make_dev.9 src/share/man/man9/make_dev.9
--- /usr/src/share/man/man9/make_dev.9	Thu Jul 29 20:57:37 2004
+++ src/share/man/man9/make_dev.9	Mon Feb 28 00:03:44 2005
@@ -33,24 +33,24 @@
 .Nm destroy_dev ,
 .Nm dev_depends
 .Nd manage
-.Vt dev_t Ns 's
+.Vt cdev Ns 's
 and DEVFS registration for devices
 .Sh SYNOPSIS
 .In sys/param.h
 .In sys/conf.h
-.Ft dev_t
+.Ft struct cdev
 .Fn make_dev "struct cdevsw *cdevsw" "int minor" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ...
-.Ft dev_t
-.Fn make_dev_alias "dev_t pdev" "const char *fmt" ...
+.Ft struct cdev
+.Fn make_dev_alias "struct cdev pdev" "const char *fmt" ...
 .Ft void
-.Fn destroy_dev "dev_t dev"
+.Fn destroy_dev "struct cdev dev"
 .Ft void
-.Fn dev_depends "dev_t pdev" "dev_t cdev"
+.Fn dev_depends "struct cdev pdev" "struct cdev cdev"
 .Sh DESCRIPTION
 The
 .Fn make_dev
 function creates a
-.Fa dev_t
+.Fa cdev
 structure for a new device.
 If DEVFS is available, it is also notified of
 the presence of the new device.
@@ -92,7 +92,7 @@ are defined in
 The
 .Fn make_dev_alias
 function takes the returned
-.Ft dev_t
+.Ft cdev
 from
 .Fn make_dev
 and makes another (aliased) name for this device.
@@ -104,7 +104,7 @@ prior to calling
 The
 .Fn destroy_dev
 function takes the returned
-.Fa dev_t
+.Fa cdev
 from
 .Fn make_dev
 and destroys the registration for that device.
--- diff.0.make_dev.9 ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502280008.j1S08Ah7024136>