There is already a libc function that opens a file without the
application having to chose a filename - see 'man tmpfile'. Of course,
the temporary file is present in /tmp for a short time, but it's not a
problem provided that the libc implementation is safe.
(A quick examination of the libc5 source reveals that tmpfile opens a
file with flags O_CREAT|O_EXCL and permissions 0666; it relies on your
umask being conservative to keep temporary data private.)
Having a system call would make tmpfile more efficient, but I can't
think of any programs creating so many temporary files that a system
call would make a noticable difference.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu