adendum to: Re: LFS 5.0 Patch-2.5.4 Chapt 5 mktemp

Bill's LFS Login lfsbill at
Fri Jan 23 16:47:22 PST 2004

On Sat, 24 Jan 2004, Allard Welter wrote:

> > On Friday 23 January 2004 23:51, jmh wrote:
> > >
> > > patch.o(.text+0x2d22): In function 'make_temp':...use of
> > > mktemp is dangerous, better use 'mkstemp'
> > >
> > > during make.
> > >
> > > Is this something to fix or should I just ignore it?
> > >
> > > jmh
> >
> > mktemp and mkstemp do the same thing (both create a unique temporary file)
> ><snip>

> > Regards - Allard
> >

You switched subjects on us! The below is not related to mktemp/mkstmp.
tsk, tsk!  ;)

> Thought I'd do some reading instead. The following is from linux-2.4.24/
> Documentation/filesystems/tmpfs.txt as I'm sure you've all studied diligently
> <quote>
> 2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
>    POSIX shared memory (shm_open, shm_unlink). Adding the following
>    line to /etc/fstab should take care of this:
>         tmpfs   /dev/shm        tmpfs   defaults        0 0
>    Remember to create the directory that you intend to mount tmpfs on
>    if necessary (/dev/shm is automagically created if you use devfs).
>    This mount is _not_ needed for SYSV shared memory. The internal
>    mount is used for that. (In the 2.3 kernel versions it was
>    necessary to mount the predecessor of tmpfs (shm fs) to use SYSV
>    shared memory)
> 3) Some people (including me) find it very convenient to mount it
>    e.g. on /tmp and /var/tmp and have a big swap partition. And now
>    loop mounts of tmpfs files do work, so mkinitrd shipped by most
>    distributions should succeed with a tmpfs /tmp.
> <unquote>
> So it seems that the entry in the LFS fstab doesn't have much of a function
> since LFS uses sysvinit. Perhaps it's an idea to follow point 3 above??

Sysvinit is not the same as SYS-V IPC (which includes semaphores, shared
memory and message queues). Sysvinit really refs the way that boot-time
scripts and initialization are handled.

I can't say if any programs in LFS/BLFS still depend on SYS-V IPC shared
memory or not. I presume some do. And how many depend on POSIX shared
memory is also something I don't know.

There may be some info in the archives. I recall seeing a thread on it a
couple months back. I guess searching with just POSIX would get you
somehwre close, but I'm sure more keywords would then be needed.

> I've been rebooting several times to see the results, everything seems fine
> sans /dev/shm entry and finally I see tmpfs doing something on /tmp

I don't recall seeing anything that identified bad results if POSIX
shared memory wasn't availble. I think someone said most programs are
smart enough to test for it and ... (I don't rember what it does then).

IIRC, Greg had done some investigation regarding it and had the scoop on

> Cheers - Allard

NOTE: I'm on a new ISP, if I'm in your address book ...
Bill Maltby
Fix line above & use it to mail me direct.

More information about the lfs-support mailing list