mirror of
https://github.com/golang/go
synced 2024-11-21 22:44:40 -07:00
lib9: make safe for automatic builds
R=golang-dev, adg, bradfitz CC=golang-dev https://golang.org/cl/5615046
This commit is contained in:
parent
3692726f32
commit
b53ce1e662
@ -85,7 +85,7 @@ LIB9OFILES=\
|
||||
|
||||
ifeq ($(GOHOSTOS),windows)
|
||||
LIB9OFILES+=\
|
||||
win32.$O\
|
||||
windows.$O\
|
||||
|
||||
else
|
||||
LIB9OFILES+=\
|
||||
|
@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
Plan 9 from User Space src/lib9/await.c
|
||||
http://code.swtch.com/plan9port/src/tip/src/lib9/await.c
|
||||
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
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;
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
Plan 9 from User Space src/lib9/getuser.c
|
||||
http://code.swtch.com/plan9port/src/tip/src/lib9/getuser.c
|
||||
|
@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
Plan 9 from User Space src/lib9/jmp.c
|
||||
http://code.swtch.com/plan9port/src/tip/src/lib9/jmp.c
|
||||
|
@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
Plan 9 from User Space src/lib9/notify.c
|
||||
http://code.swtch.com/plan9port/src/tip/src/lib9/notify.c
|
||||
|
@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
Plan 9 from User Space src/lib9/rfork.c
|
||||
http://code.swtch.com/plan9port/src/tip/src/lib9/rfork.c
|
||||
|
Loading…
Reference in New Issue
Block a user