public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] NAME_MAX and RAMFS
@ 2002-05-16 13:21 Stephen Polkowski
  2002-05-28 11:13 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Polkowski @ 2002-05-16 13:21 UTC (permalink / raw)
  To: eocs

Hi all,

	I've noticed a problem with the NAME_MAX and the RAMFS filesystem.  My 
problem is with the lenght of a filename.  When you read directory the 
name it is copied from the directory entry.  The amount copied is based 
on NAME_MAX which is set by _POSIX_NAME_MAX.  The default is only 15 
bytes (kind of small).  However, the size of a filename in RAMFS is the 
left over space from a ramfs_dirent.  The default ramfs_dirent is 32. 
The size of a RAMFS dirent is controlled by CYGNUM_RAMFS_DIRENT_SIZE, 
which is user settable.

	Ok, my problem is that the length of a filename is controlled in two 
separate places, namely NAME_MAX and CYGNUM_RAMFS_DIRENT_SIZE. It 
appears that the two different sizes aren't kept in check.  Which of the 
two should control the size of a filename?  Shouldn't the configuration 
tools keep the two values in check?  What do you think?

Steve

-- 
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] NAME_MAX and RAMFS
  2002-05-16 13:21 [ECOS] NAME_MAX and RAMFS Stephen Polkowski
@ 2002-05-28 11:13 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2002-05-28 11:13 UTC (permalink / raw)
  To: Stephen Polkowski; +Cc: eocs

Stephen Polkowski wrote:
> 
> Hi all,
> 
>         I've noticed a problem with the NAME_MAX and the RAMFS filesystem.  My
> problem is with the lenght of a filename.  When you read directory the
> name it is copied from the directory entry.  The amount copied is based
> on NAME_MAX which is set by _POSIX_NAME_MAX.  The default is only 15
> bytes (kind of small).  However, the size of a filename in RAMFS is the
> left over space from a ramfs_dirent.  The default ramfs_dirent is 32.
> The size of a RAMFS dirent is controlled by CYGNUM_RAMFS_DIRENT_SIZE,
> which is user settable.
> 
>         Ok, my problem is that the length of a filename is controlled in two
> separate places, namely NAME_MAX and CYGNUM_RAMFS_DIRENT_SIZE. It
> appears that the two different sizes aren't kept in check.  Which of the
> two should control the size of a filename?  Shouldn't the configuration
> tools keep the two values in check?  What do you think?

Imagine a FAT FS with only 8.3 names, versus a wonderfully complex fully
featured FS capable of any name length. What should NAME_MAX be then?
Surely not 11 for the whole system! So NAME_MAX is specified by the OS, but
that doesn't necessarily reflect the true requirements of nor provision by
any particular underlying FS. The two quantities are unrelated.

Although if we had a more thorough POSIX implementation you could use
pathconf/fpathconf to get the correct value for a particular FS, but we
don't :).

In the meantime I'll increase the default NAME_MAX to something a little
nicer like 64. I note that a standards committee is proposing upping the
*minimum* to 256 (and PATH_MAX to 1024) in future versions of POSIX, but
that's a bit much to jump now.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-28 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-16 13:21 [ECOS] NAME_MAX and RAMFS Stephen Polkowski
2002-05-28 11:13 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).