Blob
- Date:
- Message:
- 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.
- Actions:
- History | Blame | Raw File
1 /*2 TO DO4 can get disposition info out of imap extended structure if needed5 sizes in stat/ls ?6 translate character sets in =? subjects8 fetch headers, bodies on demand10 cache headers, bodies on disk12 cache message information on disk across runs14 body.jpg16 */18 #include "a.h"20 Imap *imap;22 void23 usage(void)24 {25 fprint(2, "usage: mailfs [-DVtx] [-m mtpt] [-s srvname] [-r root] [-u user] server\n");26 threadexitsall("usage");27 }29 int30 threadmaybackground(void)31 {32 return 1;33 }35 void36 threadmain(int argc, char **argv)37 {38 char *server, *srvname, *root, *user;39 int mode;40 char *mtpt;42 srvname = "mail";43 root = "";44 mode = Unencrypted;45 mtpt = nil;46 user = nil;47 ARGBEGIN{48 default:49 usage();50 case 'D':51 chatty9p++;52 break;53 case 'V':54 chattyimap++;55 break;56 case 'm':57 mtpt = EARGF(usage());58 break;59 case 's':60 srvname = EARGF(usage());61 break;62 case 't':63 mode = Tls;64 break;65 case 'u':66 user = EARGF(usage());67 break;68 case 'x':69 mode = Cmd;70 break;71 case 'r':72 root = EARGF(usage());73 break;74 }ARGEND76 quotefmtinstall();77 fmtinstall('$', sxfmt);79 if(argc != 1)80 usage();81 server = argv[0];83 mailthreadinit();84 boxinit();85 fsinit0();87 if((imap = imapconnect(server, mode, root, user)) == nil)88 sysfatal("imapconnect: %r");89 threadpostmountsrv(&fs, srvname, mtpt, 0);90 }