/* defined in urandom_read_aux.c */ void urand_read_without_sema(int iter_num, int iter_cnt, int read_sz); /* these are coming from urandom_read_lib{1,2}.c */ void urandlib_read_with_sema(int iter_num, int iter_cnt, int read_sz); void urandlib_read_without_sema(int iter_num, int iter_cnt, int read_sz);
int urandlib_api(void);
COMPAT_VERSION(urandlib_api_old, urandlib_api, LIBURANDOM_READ_1.0.0) int urandlib_api_old(void); int urandlib_api_sameoffset(void);
int main(int argc, char *argv[])
{ int fd = open("/dev/urandom", O_RDONLY); int count = 4; bool report_pid = false;
if (fd < 0) return 1;
if (argc >= 2)
count = atoi(argv[1]); if (argc >= 3) {
report_pid = true; /* install SIGPIPE handler to catch when parent closes their * end of the pipe (on the other side of our stdout)
*/
signal(SIGPIPE, handle_sigpipe);
}
/* report PID and wait for parent process to send us "signal" by * closing stdout
*/ if (report_pid) { while (!parent_ready) {
fprintf(stdout, "%d\n", getpid());
fflush(stdout);
} /* at this point stdout is closed, parent process knows our * PID and is ready to trace us
*/
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.