minimal plan9port to cross-build Jehanne

This commit is contained in:
2021-12-22 10:35:45 +01:00
commit c43269a19e
245 changed files with 26213 additions and 0 deletions

19
lib/lib9/opentemp.c Normal file
View File

@ -0,0 +1,19 @@
#include <u.h>
#include <libc.h>
int
opentemp(char *template, int mode)
{
int fd, fd1;
fd = mkstemp(template);
if(fd < 0)
return -1;
if((fd1 = open(template, mode)) < 0){
remove(template);
close(fd);
return -1;
}
close(fd);
return fd1;
}