comparison src/thread/linux/SDL_systhread.c @ 1338:604d73db6802

Removed uses of stdlib.h and string.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 09:29:18 +0000
parents 3692456e7b0f
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1337:c687f06c7473 1338:604d73db6802
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* Linux thread management routines for SDL */ 23 /* Linux thread management routines for SDL */
24 24
25 #include "SDL_stdlib.h"
25 #include "SDL_error.h" 26 #include "SDL_error.h"
26 #include "SDL_thread.h" 27 #include "SDL_thread.h"
27 #include "SDL_systhread.h" 28 #include "SDL_systhread.h"
28 29
29 #ifdef FORK_HACK 30 #ifdef FORK_HACK
136 #endif 137 #endif
137 } 138 }
138 139
139 #else /* Linux-specific clone() based implementation */ 140 #else /* Linux-specific clone() based implementation */
140 141
141 #include <stdlib.h>
142 #include <errno.h> 142 #include <errno.h>
143 #include <unistd.h> 143 #include <unistd.h>
144 #include <sys/wait.h> 144 #include <sys/wait.h>
145 145
146 146
225 doesn't work .. and the child thread is still a zombie, so kill() 225 doesn't work .. and the child thread is still a zombie, so kill()
226 doesn't work. 226 doesn't work.
227 */ 227 */
228 char command[1024]; 228 char command[1024];
229 229
230 sprintf(command, 230 SDL_snprintf(command, SDL_arraysize(command),
231 "ps ax|fgrep -v fgrep|fgrep -v '<zombie>'|fgrep %d >/dev/null", 231 "ps ax|fgrep -v fgrep|fgrep -v '<zombie>'|fgrep %d >/dev/null",
232 thread->handle); 232 thread->handle);
233 while ( system(command) == 0 ) 233 while ( system(command) == 0 )
234 sleep(1); 234 sleep(1);
235 #endif 235 #endif