mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
set RFNOTEG when we can
This commit is contained in:
parent
14695b90ac
commit
17558fbe2d
3 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
! Actually sparc32 assembly.
|
||||||
|
! Debian's sparc64 port is a 32-bit user space.
|
||||||
|
|
||||||
.section ".text", #alloc, #execinstr
|
.section ".text", #alloc, #execinstr
|
||||||
.align 8
|
.align 8
|
||||||
.skip 16
|
.skip 16
|
||||||
|
|
|
@ -76,10 +76,11 @@ _threadspawn(int fd[3], char *cmd, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
case 0:
|
case 0:
|
||||||
/* can't RFNOTEG - will lose tty */
|
/* can't RFNOTEG - will lose tty */
|
||||||
/* rfork(RFNOTEG); */
|
|
||||||
dup2(fd[0], 0);
|
dup2(fd[0], 0);
|
||||||
dup2(fd[1], 1);
|
dup2(fd[1], 1);
|
||||||
dup2(fd[2], 2);
|
dup2(fd[2], 2);
|
||||||
|
if(!isatty(0) && !isatty(1) && !isatty(2))
|
||||||
|
rfork(RFNOTEG);
|
||||||
for(i=3; i<100; i++)
|
for(i=3; i<100; i++)
|
||||||
if(i != p[1])
|
if(i != p[1])
|
||||||
close(i);
|
close(i);
|
||||||
|
|
|
@ -46,6 +46,14 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||||
extern pid_t rfork_thread(int, void*, int(*)(void*), void*);
|
extern pid_t rfork_thread(int, void*, int(*)(void*), void*);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__sun__)
|
||||||
|
# define mcontext libthread_mcontext
|
||||||
|
# define mcontext_t libthread_mcontext_t
|
||||||
|
# define ucontext libthread_ucontext
|
||||||
|
# define ucontext_t libthread_ucontext_t
|
||||||
|
# include "sparc-ucontext.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__arm__)
|
#if defined(__arm__)
|
||||||
int getmcontext(mcontext_t*);
|
int getmcontext(mcontext_t*);
|
||||||
void setmcontext(const mcontext_t*);
|
void setmcontext(const mcontext_t*);
|
||||||
|
@ -53,6 +61,7 @@ void setmcontext(const mcontext_t*);
|
||||||
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
|
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct Context Context;
|
typedef struct Context Context;
|
||||||
typedef struct Execjob Execjob;
|
typedef struct Execjob Execjob;
|
||||||
typedef struct Proc Proc;
|
typedef struct Proc Proc;
|
||||||
|
|
Loading…
Reference in a new issue