lkml.org 
[lkml]   [2000]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: devfs question
Andrew Pimlott writes:
> On Tue, Jul 18, 2000 at 05:59:12PM -0400, Richard Gooch wrote:
> > Khimenko Victor writes:
>
> > > - if ((tty = rindex(ttyn, '/')))
> > > - ++tty;
> > > + if (strncmp(ttyn, "/dev/", 5) == 0)
> > > + tty = ttyn+5;
> > > else
> >
> > Hm. util-linux-2.10f doesn't have this, 2.10h does. 2.10g isn't on
> > kernel.org.
> >
> > However, you really should have swapped to index(3) instead (or
> > better, strchr(3) which is POSIX). Building an assumption on /dev
> > isn't very good either. It still wouldn't be 100% correct (it'll fall
> > over if your device nodes/devfs mountpoint are deeper), but it would
> > be better.
>
> Perhaps best to look for a purely numerical last component, and in
> that case take the last two components.

That would break the old names. "/dev/tty1" would not match to "tty1".

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.056 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site