tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: procfs files vs symlink



On Tue, Jan 11, 2022 at 11:34:45AM +0100, Martin Husemann wrote:
> On Tue, Jan 11, 2022 at 11:10:24AM +0100, Manuel Bouyer wrote:
> > +static inline bool
> > +procfs_proc_is_linux_compat(void)
> > +{
> > +	const char *emulname = curlwp->l_proc->p_emul->e_name;
> > +	return (strncmp(emulname, "linux", 5) == 0);
> > +}
> 
> Not a big deal, but wouldn't it be better to give this behaviour a
> symbolic name and use a bit in e_flags for it? This seems to be mostly
> unused so far (or I did something wrong when searching for it).

Maybe, but there's already code like this in procfs. I just cut-n-pasted
it in a function for my need (and we could use this function in other
places in procfs as well, but this would be a different commit)

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index