Changeset 75724 in vbox for trunk/src/VBox/Additions/common/VBoxGuest/lib
- Timestamp:
- Nov 25, 2018 7:12:16 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestCtrl.cpp
r71364 r75724 37 37 #include <VBox/HostServices/GuestControlSvc.h> 38 38 39 #ifndef RT_OS_WINDOWS 40 # include <signal.h> 41 #endif 42 39 43 #include "VBoxGuestR3LibInternal.h" 40 44 … … 99 103 * one for retriving the actual message parameters. Not this weird 100 104 * stuff, to put it rather bluntly. 105 * 106 * Note! As a result of this weird design, we are not able to correctly 107 * retrieve message if we're interrupted by a signal, like SIGCHLD. 108 * Because IPRT wants to use waitpid(), we're forced to have a handler 109 * installed for SIGCHLD, so when working with child processes there 110 * will be signals in the air and we will get VERR_INTERRUPTED returns. 111 * The way HGCM handles interrupted calls is to silently (?) drop them 112 * as they complete (see VMMDev), so the server knows little about it 113 * and just goes on to the next message inline. 114 * 115 * So, as a "temporary" mesasure, we block SIGCHLD here while waiting, 116 * because it will otherwise be impossible do simple stuff like 'mkdir' 117 * on a mac os x guest, and probably most other unix guests. 101 118 */ 102 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 119 #ifdef RT_OS_WINDOWS 120 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 121 #else 122 sigset_t SigSet; 123 sigemptyset(&SigSet); 124 sigaddset(&SigSet, SIGCHLD); 125 sigprocmask(SIG_BLOCK, &SigSet, NULL); 126 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 127 sigprocmask(SIG_UNBLOCK, &SigSet, NULL); 128 #endif 103 129 if ( rc == VERR_TOO_MUCH_DATA 104 130 || RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.