comparison restartOp.c @ 2:f362b20de51e

Remove trailing whitespaces.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 22 Feb 2015 18:03:26 +0100
parents e70ea46d6073
children
comparison
equal deleted inserted replaced
1:05c8e0aef77d 2:f362b20de51e
34 pid_t endPid; 34 pid_t endPid;
35 35
36 do { 36 do {
37 endPid=wait(status); 37 endPid=wait(status);
38 } while ((endPid==-1) && (errno==EINTR)); 38 } while ((endPid==-1) && (errno==EINTR));
39 39
40 return endPid; 40 return endPid;
41 } 41 }
42 */ 42 */
43 /* 43 /*
44 pid_t waitpid_rs(pid_t pid, int *status, int options) 44 pid_t waitpid_rs(pid_t pid, int *status, int options)
46 pid_t endPid; 46 pid_t endPid;
47 47
48 do { 48 do {
49 endPid=waitpid(pid,status,options); 49 endPid=waitpid(pid,status,options);
50 } while ((endPid==-1) && (errno==EINTR)); 50 } while ((endPid==-1) && (errno==EINTR));
51 51
52 return endPid; 52 return endPid;
53 } 53 }
54 */ 54 */
55 55
56 /********************************************************/ 56 /********************************************************/
57 /* sleep */ 57 /* sleep */
58 /********************************************************/ 58 /********************************************************/
59 59
60 unsigned int sleep_rs(unsigned int seconds) 60 unsigned int sleep_rs(unsigned int seconds)
61 { 61 {
62 int nbSecondsElapsed = 0; 62 int nbSecondsElapsed = 0;
63 63
64 do { 64 do {
65 65
66 seconds = seconds - nbSecondsElapsed; 66 seconds = seconds - nbSecondsElapsed;
67 67
68 nbSecondsElapsed = sleep(seconds); 68 nbSecondsElapsed = sleep(seconds);
69 69
70 } while (nbSecondsElapsed!=0); 70 } while (nbSecondsElapsed!=0);
71 71
72 return 0; // Zero if the requested time has elapsed 72 return 0; // Zero if the requested time has elapsed
73 } 73 }
74 74
75 75
76 /********************************************************/ 76 /********************************************************/
158 */ 158 */
159 159
160 /********************************************************/ 160 /********************************************************/
161 /* msgsnd, msgrcv */ 161 /* msgsnd, msgrcv */
162 /********************************************************/ 162 /********************************************************/
163 /* 163 /*
164 int msgsnd_rs(int msqid, void *msgp, int msgsz, int msgflg) 164 int msgsnd_rs(int msqid, void *msgp, int msgsz, int msgflg)
165 { 165 {
166 int returnValue = 0; 166 int returnValue = 0;
167 167
168 do { 168 do {
169 returnValue = msgsnd(msqid,msgp,msgsz,msgflg); 169 returnValue = msgsnd(msqid,msgp,msgsz,msgflg);
170 } while ((returnValue==-1) && (errno==EINTR)); 170 } while ((returnValue==-1) && (errno==EINTR));
171 171
172 return returnValue; 172 return returnValue;
173 } 173 }
174 */ 174 */
175 /* 175 /*
176 int msgrcv_rs(int msqid, void *msgp, int msgsz,long msgtyp,int msgflg) 176 int msgrcv_rs(int msqid, void *msgp, int msgsz,long msgtyp,int msgflg)
177 { 177 {
178 int returnValue = 0; 178 int returnValue = 0;
179 179
180 do { 180 do {
181 returnValue = msgrcv(msqid,msgp,msgsz,msgtyp,msgflg); 181 returnValue = msgrcv(msqid,msgp,msgsz,msgtyp,msgflg);
182 } while ((returnValue==-1) && (errno==EINTR)); 182 } while ((returnValue==-1) && (errno==EINTR));
183 183
184 return returnValue; 184 return returnValue;
185 } 185 }
186 */ 186 */
187 187
188 /********************************************************/ 188 /********************************************************/