/* $NetBSD: tmp.c,v 1.11 2003/08/07 11:32:34 jdolecek Exp $ */ /*- * Copyright (c) 2000-2003 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Ben Harris and Jaromir Dolecek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Peter McIlroy. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #ifndef lint __RCSID("$NetBSD: tmp.c,v 1.11 2003/08/07 11:32:34 jdolecek Exp $"); __SCCSID("@(#)tmp.c 8.1 (Berkeley) 6/6/93"); #endif /* not lint */ #include #include #include #include #include #include #include #include #include #include "sort.h" #include "pathnames.h" #define _NAME_TMP "sort.XXXXXXXX" FILE * ftmp() { sigset_t set, oset; FILE *fp; int fd; char path[MAXPATHLEN]; (void)snprintf(path, sizeof(path), "%s%s%s", tmpdir, (tmpdir[strlen(tmpdir)-1] != '/') ? "/" : "", _NAME_TMP); sigfillset(&set); (void)sigprocmask(SIG_BLOCK, &set, &oset); if ((fd = mkstemp(path)) < 0) err(2, "ftmp: mkstemp(\"%s\")", path); if (!(fp = fdopen(fd, "w+"))) err(2, "ftmp: fdopen(\"%s\")", path); (void)unlink(path); (void)sigprocmask(SIG_SETMASK, &oset, NULL); return (fp); } 0000'>2005-02-05CreateDiskQueueData() doesn't need to use void * for raidPtr.oster 2004-03-04Cleanup one more leftover 'row' variable. Cleanup function prototypesoster 2004-02-24occured -> occurred. From Peter Postma.wiz 2004-01-01Nuke a bunch of unused variables:oster 2003-12-29[Having received a definite lack of strenuous objection, a small amountoster 2003-02-09constify somejdolecek 2002-10-04As part of the effort to get RAIDframe playing nicely with LOCKDEBUG,oster 2002-09-15Nuke unlockingOp -- it was only used for the userland version of theoster 2002-09-15Remove a couple of unneeded structure members.oster 2002-09-15'buf2' is unused. Nuke it.oster 2002-08-02- AuxFunc is no longer used.oster 2001-10-04Step 2 of the disentanglement. We now look to <dev/raidframe/*> foroster 2000-02-13Get recent changes into the tree:oster 2000-01-08Make raidPtr a 'RF_Raid_t *' like it's supposed to be.oster 1999-02-05Phase 2 of the RAIDframe cleanup. The source is now closer to KNFoster 1999-01-26RAIDframe cleanup, phase 1. Nuke simulator support, user-land driver,oster 1998-11-13RAIDframe, version 1.1, from the Parallel Data Laboratory atoster