Rev 2754 | Rev 3261 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2754 | Rev 3238 | ||
|---|---|---|---|
| Line 36... | Line 36... | ||
| 36 | #include <unistd.h> |
36 | #include <unistd.h> |
| 37 | #include <ctype.h> |
37 | #include <ctype.h> |
| 38 | #include <limits.h> |
38 | #include <limits.h> |
| 39 | #include <align.h> |
39 | #include <align.h> |
| 40 | #include <sys/types.h> |
40 | #include <sys/types.h> |
| 41 | - | ||
| - | 41 | #include <malloc.h> |
|
| 42 | 42 | ||
| 43 | /* Dummy implementation of mem/ functions */ |
43 | /* Dummy implementation of mem/ functions */ |
| 44 | 44 | ||
| 45 | void *memset(void *s, int c, size_t n) |
45 | void *memset(void *s, int c, size_t n) |
| 46 | { |
46 | { |
| Line 351... | Line 351... | ||
| 351 | while ((*dest++ = *src++)) |
351 | while ((*dest++ = *src++)) |
| 352 | ; |
352 | ; |
| 353 | return orig; |
353 | return orig; |
| 354 | } |
354 | } |
| 355 | 355 | ||
| - | 356 | char * strdup(const char *s1) |
|
| - | 357 | { |
|
| - | 358 | size_t len = strlen(s1) + 1; |
|
| - | 359 | void *ret = malloc(len); |
|
| - | 360 | ||
| - | 361 | if (ret == NULL) |
|
| - | 362 | return (char *) NULL; |
|
| - | 363 | ||
| - | 364 | return (char *) memcpy(ret, s1, len); |
|
| - | 365 | } |
|
| - | 366 | ||
| 356 | /** @} |
367 | /** @} |
| 357 | */ |
368 | */ |