1/* 2 * Copyright (c) 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)tempnam.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/lib/libc/stdio/tempnam.c 249810 2013-04-23 14:36:44Z emaste $"); |
35 36#include <sys/param.h> 37#include <errno.h> 38#include <stdio.h> 39#include <stdlib.h> 40#include <string.h> 41#include <unistd.h> 42#include <paths.h> 43 44__warn_references(tempnam, 45 "warning: tempnam() possibly used unsafely; consider using mkstemp()"); 46 47extern char *_mktemp(char *); 48 49char * |
50tempnam(const char *dir, const char *pfx) |
51{ 52 int sverrno; 53 char *f, *name; 54 55 if (!(name = malloc(MAXPATHLEN))) 56 return(NULL); 57 58 if (!pfx) --- 31 unchanged lines hidden --- |