| Summary: | devname(3)'s man page needs an example | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Documentation | Reporter: | fn <fn> | ||||
| Component: | Books & Articles | Assignee: | Tom Rhodes <trhodes> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Responsible Changed From-To: freebsd-doc->trhodes I like things like this, assign this PR to me. Hey there, I tested this code against FreeBSD 5.2.1 and it seemed to execute fine, though I could not get it to work with the O_RDWR flag added to fd(). That more likely has something to do with my being a cruddy c programmer though, so if someone more in the know could look at that portion it might be good. :) I've attached the manpage diff to add this example to the devname(3) man page. Cheers, Marc State Changed From-To: open->patched Patched in CURRENT, MFC pending. State Changed From-To: patched->closed MFC complete, close this PR. Thanks! |
devname(3)'s man page is hard to figure out. Sure, it includes an xref to stat(2), but I think a little bit more info can help. Fix: I suggest adding an example. Something like EXAMPLE int fd; struct stat buf; char *name; fd = open("/dev/tun", O_RDWR); fstat(fd, &buf) printf("devname is /dev/%s\n", devname(buf.st_rdev, S_IFCHR)) prints out devname is /dev/tun5 How-To-Repeat: man 3 devname