Commit b53ce1e6 authored by Russ Cox's avatar Russ Cox

lib9: make safe for automatic builds

R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5615046
parent 3692726f
......@@ -85,7 +85,7 @@ LIB9OFILES=\
ifeq ($(GOHOSTOS),windows)
LIB9OFILES+=\
win32.$O\
windows.$O\
else
LIB9OFILES+=\
......
// +build !windows
/*
Plan 9 from User Space src/lib9/await.c
http://code.swtch.com/plan9port/src/tip/src/lib9/await.c
......
/*
* The authors of this software are Rob Pike and Ken Thompson,
* with contributions from Mike Burrows and Sean Dorward.
*
* Copyright (c) 2002-2006 by Lucent Technologies.
* Portions Copyright (c) 2004 Google Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose without fee is hereby granted, provided that this entire notice
* is included in all copies of any software which is or includes a copy
* or modification of this software and in all copies of the supporting
* documentation for such software.
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES
* NOR GOOGLE INC MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING
* THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
#include <u.h>
#include <libc.h>
#include "fmtdef.h"
int
__errfmt(Fmt *f)
{
char *s;
s = strerror(errno);
return fmtstrcpy(f, s);
}
/*
Plan 9 from User Space src/lib9/fork.c
http://code.swtch.com/plan9port/src/tip/src/lib9/fork.c
Copyright 2001-2007 Russ Cox. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <u.h>
#include <signal.h>
#include <libc.h>
#include "9proc.h"
#undef fork
int
p9fork(void)
{
int pid;
sigset_t all, old;
sigfillset(&all);
sigprocmask(SIG_SETMASK, &all, &old);
pid = fork();
if(pid == 0){
_clearuproc();
_p9uproc(0);
}
sigprocmask(SIG_SETMASK, &old, nil);
return pid;
}
// +build !windows
/*
Plan 9 from User Space src/lib9/getuser.c
http://code.swtch.com/plan9port/src/tip/src/lib9/getuser.c
......
// +build !windows
/*
Plan 9 from User Space src/lib9/jmp.c
http://code.swtch.com/plan9port/src/tip/src/lib9/jmp.c
......
// +build !windows
/*
Plan 9 from User Space src/lib9/notify.c
http://code.swtch.com/plan9port/src/tip/src/lib9/notify.c
......
// +build !windows
/*
Plan 9 from User Space src/lib9/rfork.c
http://code.swtch.com/plan9port/src/tip/src/lib9/rfork.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment