OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [compat/] [tmpnam.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * Copyright (c) 1988 Regents of the University of California.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms are permitted
6
 * provided that this notice is preserved and that due credit is given
7
 * to the University of California at Berkeley. The name of the University
8
 * may not be used to endorse or promote products derived from this
9
 * software without specific written prior permission. This software
10
 * is provided ``as is'' without express or implied warranty.
11
 *
12
 * RCS: @(#) $Id: tmpnam.c,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
13
 */
14
 
15
#include <sys/param.h>
16
#include <sys/stat.h>
17
#include <sys/file.h>
18
#include <stdio.h>
19
 
20
/*
21
 * Use /tmp instead of /usr/tmp, because L_tmpname is only 14 chars
22
 * on some machines (like NeXT machines) and /usr/tmp will cause
23
 * buffer overflows.
24
 */
25
 
26
#ifdef P_tmpdir
27
#   undef P_tmpdir
28
#endif
29
#define P_tmpdir        "/tmp"
30
 
31
char *
32
tmpnam(s)
33
        char *s;
34
{
35
        static char name[50];
36
        char *mktemp();
37
 
38
        if (!s)
39
                s = name;
40
        (void)sprintf(s, "%s/XXXXXX", P_tmpdir);
41
        return(mktemp(s));
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.