aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-12-30 00:10:11 -0500
committerRuss Cox <rsc@swtch.com>2020-12-30 00:12:14 -0500
commitb3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8 (patch)
tree0cebec89bb62594af9c5310e1ba99a4dee65b51b /src/cmd/upas
parent5b37d9126474864b5299426e27b2af37fcc96dd0 (diff)
downloadplan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.tar.gz
plan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.tar.bz2
plan9port-b3a20a96eb2b91a5b0b8a8fb506e20a2fb50ebe8.zip
libthread: add threadmaybackground
Programs that want to background themselves now need to define threadmaybackground returning 1. This avoids a confusing (to people and debuggers) extra parent process for all the threaded programs that will never want to background themselves.
Diffstat (limited to 'src/cmd/upas')
-rw-r--r--src/cmd/upas/fs/fs.c6
-rw-r--r--src/cmd/upas/nfs/main.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/upas/fs/fs.c b/src/cmd/upas/fs/fs.c
index dc6ff3ba..32968e67 100644
--- a/src/cmd/upas/fs/fs.c
+++ b/src/cmd/upas/fs/fs.c
@@ -155,6 +155,12 @@ notifyf(void *a, char *s)
noted(NDFLT);
}
+int
+threadmaybackground(void)
+{
+ return 1;
+}
+
void
threadmain(int argc, char *argv[])
{
diff --git a/src/cmd/upas/nfs/main.c b/src/cmd/upas/nfs/main.c
index c72a4849..68ae141b 100644
--- a/src/cmd/upas/nfs/main.c
+++ b/src/cmd/upas/nfs/main.c
@@ -26,6 +26,12 @@ usage(void)
threadexitsall("usage");
}
+int
+threadmaybackground(void)
+{
+ return 1;
+}
+
void
threadmain(int argc, char **argv)
{