P_tmpdir in stdio.h

302 views
Skip to first unread message

Jan Wieck

unread,
Jul 28, 2011, 8:43:42 AM7/28/11
to minix3
Both /usr/src/include/stdio.h and /usr/src/nbsd_include/stdio.h define
P_tmpdir as "/var/tmp", a directory that doesn't exist by default. The
nbsd stdio.h has a comment that says:

System V/ANSI C: this is the wrong way to do this, do *not* use these.

Of course, good old groff IS using it and fails when creating the .ps
versions of clang man pages.

How do we fix this?

A) Stop groff from using P_tmpdir and default to "/usr/tmp".

B) Change stdio.h to "/usr/tmp".

C) Let "make world" create a symlink /var/tmp -> /usr/tmp.

D) Any combination of the above.

I personally lean towards A) + B). Since nbsd tells us that groff is
doing it wrong, A) is the right thing to do anyway. But there may be
more packages out there using P_tmpdir and they don't fail during
compile time, they fail at runtime if and when they need a temp file.

Opinions?


Jan

--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin

Erik van der Kouwe

unread,
Jul 28, 2011, 9:02:00 AM7/28/11
to minix3
Hi,

> Both /usr/src/include/stdio.h and /usr/src/nbsd_include/stdio.h define
> P_tmpdir as "/var/tmp", a directory that doesn't exist by default. The
> nbsd stdio.h has a comment that says:

Actually, include/stdio.h specifies "/tmp" (see
http://git.minix3.org/?p=minix.git;a=blob;f=include/stdio.h;h=f8e355d77204eae1dd8bfe75101e299f67ceb46b;hb=HEAD).

With kind regards,
Erik

Jan Wieck

unread,
Jul 28, 2011, 9:34:10 AM7/28/11
to min...@googlegroups.com, Erik van der Kouwe

My bad, I didn't fetch/pull for 2 days :)

Never mind then ...

Jan Wieck

unread,
Jul 28, 2011, 9:37:27 AM7/28/11
to min...@googlegroups.com, Erik van der Kouwe
On 7/28/2011 9:34 AM, Jan Wieck wrote:
> On 7/28/2011 9:02 AM, Erik van der Kouwe wrote:
>> Hi,
>>
>>> Both /usr/src/include/stdio.h and /usr/src/nbsd_include/stdio.h define
>>> P_tmpdir as "/var/tmp", a directory that doesn't exist by default. The
>>> nbsd stdio.h has a comment that says:
>>
>> Actually, include/stdio.h specifies "/tmp" (see
>> http://git.minix3.org/?p=minix.git;a=blob;f=include/stdio.h;h=f8e355d77204eae1dd8bfe75101e299f67ceb46b;hb=HEAD).
>
> My bad, I didn't fetch/pull for 2 days :)
>
> Never mind then ...

Do mind! We install the nbsd_include/stdio.h in /usr/include now.

Erik van der Kouwe

unread,
Jul 28, 2011, 9:39:17 AM7/28/11
to Jan Wieck, min...@googlegroups.com
Hi,

>>> Both /usr/src/include/stdio.h and /usr/src/nbsd_include/stdio.h define
>>> P_tmpdir as "/var/tmp", a directory that doesn't exist by default. The
>>> nbsd stdio.h has a comment that says:
>>
>> Actually, include/stdio.h specifies "/tmp" (see
>> http://git.minix3.org/?p=minix.git;a=blob;f=include/stdio.h;h=f8e355d77204eae1dd8bfe75101e299f67ceb46b;hb=HEAD).
>
> My bad, I didn't fetch/pull for 2 days :)

Actually it has since the constant was added a year ago.

Please note that I'm referring to the MINIX libc one (include/stdio.h),
the NetBSD libc (nbsd_include/stdio.h) one is indeed inconsistent.

With kind regards,
Erik

Reply all
Reply to author
Forward
0 new messages