P2align 47 l6 imull ecxebx addl ecxesi decl ecx testl

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: == NULL) unix_error("Fopen error"); return fp; } void Fputs(const char *ptr, FILE *stream) { if (fputs(ptr, stream) == EOF) unix_error("Fputs error"); } size_t Fread(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t n; if (((n = fread(ptr, size, nmemb, stream)) < nmemb) && ferror(stream)) unix_error("Fread error"); return n; } void Fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { if (fwrite(ptr, size, nmemb, stream) < nmemb) unix_error("Fwrite error"); } /************************************************ * Wrappers for Pthreads thread control functions ************************************************/ void Pthread_create(pthread_t *tidp, pthread_attr_t *attrp, void * (*routine)(void *), void *argp) { int rc; A.5. THE CSAPP.C SOURCE FILE 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 681 if ((rc = pthread_create(tidp, attrp, routine, argp)) !=...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online