flag on /dev/shmem files

Does anyone know why the “n” attribute is set on files placed on
/dev/shmem, and is there any way to avoid that? In particular, many
utilities will not process the files – they say they’re not “regular”
files.

Thanks,

lew

“Lewis Donzis” <lew@nospam.donzis.com> wrote in message
news:3E5EDF09.DE7288FA@nospam.donzis.com

Does anyone know why the “n” attribute is set on files placed on
/dev/shmem, and is there any way to avoid that?

No, /dev/shmem isn’t a full feature file system. It has limited capability.

In particular, many
utilities will not process the files – they say they’re not “regular”
files.

Use a real ram disk, look at devb-ram or efsys-ram (not sure of name) or
Rob’s ram disk driver (www.parse.com)

Thanks,

lew

Lewis Donzis <lew@nospam.donzis.com> wrote:

Does anyone know why the “n” attribute is set on files placed on
/dev/shmem

They are made name-special files to satisfy S_TYPEISSHM(), since
they are effectively shared-memory objects.

and is there any way to avoid that? In particular, many
utilities will not process the files

Sadly not. A number of utilities have been modified to accept
name-special files as well as regular files; do you have examples
of some which will not work?

An alternative would be to use a “real” temporary filesystem,
either disk or ram (6.2.1 provides built-in ramdisk facilities).

John Garvey wrote:

Sadly not. A number of utilities have been modified to accept
name-special files as well as regular files; do you have examples
of some which will not work?

Well, gzip and mv are a couple of examples.

An alternative would be to use a “real” temporary filesystem,
either disk or ram (6.2.1 provides built-in ramdisk facilities).

OK, thanks for the info.

lew

Mario Charest wrote:

Use a real ram disk, look at devb-ram or efsys-ram (not sure of name) or
Rob’s ram disk driver (> www.parse.com> )

Thanks, that’s good info.

lew

LESS is another utility that doesn’t like files in /dev/shmem.

Murf

John Garvey wrote:

Lewis Donzis <> lew@nospam.donzis.com> > wrote:
Does anyone know why the “n” attribute is set on files placed on
/dev/shmem

They are made name-special files to satisfy S_TYPEISSHM(), since
they are effectively shared-memory objects.

and is there any way to avoid that? In particular, many
utilities will not process the files

Sadly not. A number of utilities have been modified to accept
name-special files as well as regular files; do you have examples
of some which will not work?

An alternative would be to use a “real” temporary filesystem,
either disk or ram (6.2.1 provides built-in ramdisk facilities).

Mario Charest postmaster@127.0.0.1 wrote:

“Lewis Donzis” <> lew@nospam.donzis.com> > wrote in message
news:> 3E5EDF09.DE7288FA@nospam.donzis.com> …
Does anyone know why the “n” attribute is set on files placed on
/dev/shmem, and is there any way to avoid that?

No, /dev/shmem isn’t a full feature file system. It has limited capability.

In particular, many
utilities will not process the files – they say they’re not “regular”
files.

Use a real ram disk, look at devb-ram or efsys-ram (not sure of name) or
Rob’s ram disk driver (> www.parse.com> )

If you read the resource manager documentation, the resource manager
gets to say what kind of file this name reprsents. teh purpose of this
type information is so that a program knows what features should be
available for it.

If the resource manager is your own, it can lie about what kind of file
this is. It’s just another tool in the chain to keep track of what’s
what.

John A. Murphy <murf@perftech.com> wrote:

LESS is another utility that doesn’t like files in /dev/shmem.

Use “-f” – works with elvis and less.

$ printf “hello world” > /dev/shmem/fred
$ less /dev/shmem/fred
/dev/shmem/fred is not a regular file
$ less -f /dev/shmem/fred
hello world
/dev/shmem/fred (END)


Kirk Russell Bridlewood Software Testers Guild

Lewis Donzis <lew@nospam.donzis.com> wrote:

John Garvey wrote:
Sadly not. A number of utilities have been modified to accept
name-special files as well as regular files; do you have examples
of some which will not work?

Well, gzip and mv are a couple of examples.

I will create bug reports for these two.


Kirk Russell Bridlewood Software Testers Guild

Thanks! That will save a little time and a lot of cursing :slight_smile:.

Murf

kirk wrote:

John A. Murphy <> murf@perftech.com> > wrote:
LESS is another utility that doesn’t like files in /dev/shmem.

Use “-f” – works with elvis and less.

$ printf “hello world” > /dev/shmem/fred
$ less /dev/shmem/fred
/dev/shmem/fred is not a regular file
$ less -f /dev/shmem/fred
hello world
/dev/shmem/fred (END)


Kirk Russell Bridlewood Software Testers Guild