Summing these gives address 0x80489d2 8048902 8048907

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: (dup2(fd1, fd2) == -1) unix_error("dup2 error"); } /************************************** * Wrapper for memory mapping functions **************************************/ void *Mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) { void *ptr; if ((ptr = mmap(addr, len, prot, flags, fd, offset)) == ((void *) -1)) unix_error("mmap error"); return(ptr); } void Munmap(void *start, size_t length) { A.5. THE CSAPP.C SOURCE FILE 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 679 if (munmap(start, length) < 0) unix_error("munmap error"); } /*************************************************** * Wrappers for dynamic storage allocation functions ***************************************************/ void *Malloc(size_t size) { void *p; if ((p = malloc(size)) == NULL) unix_error("Malloc error"); return p; } void *Calloc(size_t nmemb, size_t size) { void *p; if...
View Full Document

Ask a homework question - tutors are online